|
@@ -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);
|
|
|
|
|
|