|
|
@@ -165,7 +165,7 @@ class ScheduleService
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-
|
|
|
+ //
|
|
|
public function updateStatus($id, string $status, bool $fromPackage = false)
|
|
|
{
|
|
|
try {
|
|
|
@@ -251,7 +251,7 @@ class ScheduleService
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
+ //tem que chamar o status cancel por causa da regra de push
|
|
|
case 'cancelled':
|
|
|
$notificationService = app(NotificationService::class);
|
|
|
|
|
|
@@ -265,7 +265,7 @@ class ScheduleService
|
|
|
'type' => NotificationTypeEnum::SCHEDULE_PROVIDER_CLIENT_CANCELLED->value,
|
|
|
'user_id' => $schedule->provider->user_id,
|
|
|
]);
|
|
|
- $this->sendProviderCancelledPush($schedule);
|
|
|
+ $this->sendClientCancelledPush($schedule);
|
|
|
|
|
|
break;
|
|
|
|
|
|
@@ -278,7 +278,8 @@ class ScheduleService
|
|
|
'type' => NotificationTypeEnum::SCHEDULE_CLIENT_PROVIDER_CANCELLED->value,
|
|
|
'user_id' => $schedule->client->user_id,
|
|
|
]);
|
|
|
- $this->sendClientCancelledPush($schedule);
|
|
|
+
|
|
|
+ $this->sendProviderCancelledPush($schedule);
|
|
|
|
|
|
break;
|
|
|
|
|
|
@@ -564,12 +565,12 @@ class ScheduleService
|
|
|
$cancelled_by = Auth::user()->type;
|
|
|
|
|
|
$schedule->update([
|
|
|
- 'status' => 'cancelled',
|
|
|
'cancel_text' => $cancelText,
|
|
|
'cancelled_by' => $cancelled_by,
|
|
|
]);
|
|
|
|
|
|
$this->cascadeCancelServicePackages($schedule, $cancelText, $cancelled_by);
|
|
|
+ $this->updateStatus($id, 'cancelled');
|
|
|
|
|
|
$actor = Auth::user()?->type;
|
|
|
|