|
@@ -260,13 +260,19 @@ class ScheduleService
|
|
|
|
|
|
|
|
switch (Auth::user()?->type) {
|
|
switch (Auth::user()?->type) {
|
|
|
case UserTypeEnum::CLIENT:
|
|
case UserTypeEnum::CLIENT:
|
|
|
|
|
+ $user = $schedule->provider?->user;
|
|
|
|
|
+
|
|
|
|
|
+ if(!$user) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$notificationService->create([
|
|
$notificationService->create([
|
|
|
'title' => __('notifications.schedule_cancelled_title'),
|
|
'title' => __('notifications.schedule_cancelled_title'),
|
|
|
'description' => __('notifications.client_cancelled_schedule_description'),
|
|
'description' => __('notifications.client_cancelled_schedule_description'),
|
|
|
'origin' => 'schedule',
|
|
'origin' => 'schedule',
|
|
|
'origin_id' => $schedule->id,
|
|
'origin_id' => $schedule->id,
|
|
|
'type' => NotificationTypeEnum::SCHEDULE_PROVIDER_CLIENT_CANCELLED->value,
|
|
'type' => NotificationTypeEnum::SCHEDULE_PROVIDER_CLIENT_CANCELLED->value,
|
|
|
- 'user_id' => $schedule->provider->user_id,
|
|
|
|
|
|
|
+ 'user_id' => $user->id,
|
|
|
]);
|
|
]);
|
|
|
$this->sendClientCancelledPush($schedule);
|
|
$this->sendClientCancelledPush($schedule);
|
|
|
|
|
|
|
@@ -362,17 +368,17 @@ class ScheduleService
|
|
|
// =====================================================
|
|
// =====================================================
|
|
|
|
|
|
|
|
// TESTE LOCAL: dispara 15 segundos depois do pagamento
|
|
// TESTE LOCAL: dispara 15 segundos depois do pagamento
|
|
|
- ScheduleStartingSoonJob::dispatch($schedule->id)
|
|
|
|
|
- ->delay(now()->addSeconds(15));
|
|
|
|
|
|
|
+ // ScheduleStartingSoonJob::dispatch($schedule->id)
|
|
|
|
|
+ // ->delay(now()->addSeconds(15));
|
|
|
|
|
|
|
|
- /*
|
|
|
|
|
- PRODUÇÃO: dispara 1 hora antes do início
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // PRODUÇÃO: dispara 1 hora antes do início
|
|
|
|
|
|
|
|
- $notification_date_time = $start_date_time->copy()->subHour();
|
|
|
|
|
|
|
+ $notification_date_time = $start_date_time->copy()->subHour();
|
|
|
|
|
|
|
|
- ScheduleStartingSoonJob::dispatch($schedule->id)
|
|
|
|
|
- ->delay($notification_date_time);
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ ScheduleStartingSoonJob::dispatch($schedule->id)
|
|
|
|
|
+ ->delay($notification_date_time);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// =====================================================
|
|
// =====================================================
|
|
|
// StartScheduleJob
|
|
// StartScheduleJob
|