Refactor booking system: Remove unused policies, packages, and related entities
- Removed package consumption flags and related properties from PriceQuote. - Eliminated unused domain event publishing for policies and waitlist in Schedule. - Cleaned up BookingEngineSeeder by removing package and policy related logic. - Updated SeedScenariosCommand to reflect removal of policies from output. - Dropped policy, package, treatment course, cancellation, waitlist, and domain event tables in migration. - Removed domain event assertions from tests related to resource blocking.
This commit is contained in:
@@ -45,7 +45,6 @@ class AppointmentController extends BaseController
|
||||
private readonly \App\Appointment\Service\AppointmentInsuranceService $appointmentInsurance,
|
||||
private readonly \App\Appointment\Service\ServiceBookingCalculator $serviceCalculator,
|
||||
private readonly \App\Appointment\Service\ServiceRescheduleService $rescheduleService,
|
||||
private readonly \App\Shared\Event\DomainEventPublisher $domainEvents,
|
||||
private readonly \Psr\Log\LoggerInterface $logger,
|
||||
) {}
|
||||
|
||||
@@ -73,27 +72,6 @@ class AppointmentController extends BaseController
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* ثبت رویداد دامنهٔ «نوبت انجام شد».
|
||||
*
|
||||
* جدا از `AppointmentEvent` است و جایگزینش نمیشود: آن، تایملاینِ خواندهشده توسط
|
||||
* اپراتور است و این، صندوق خروجی برای مصرفکنندههای بیرونی. هر دو مسیرِ تغییر
|
||||
* وضعیت (اندپوینت اختصاصی و `PATCH`) بعد از ذخیرهٔ موفق به اینجا میرسند، چون
|
||||
* رویدادِ کاری که هنوز ذخیره نشده، دروغ است.
|
||||
*/
|
||||
private function recordCompletion(Appointment $appointment): void
|
||||
{
|
||||
$this->domainEvents->recordAndFlush(
|
||||
$appointment->getEntityType(),
|
||||
$appointment->getEntityId(),
|
||||
\App\Shared\Event\DomainEvents::APPOINTMENT_COMPLETED,
|
||||
[
|
||||
'appointment_uuid' => $appointment->getUuid(),
|
||||
'slot_start' => $appointment->getSlotStart(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// ── Public: available slots ───────────────────────────────────────────────
|
||||
|
||||
#[OA\Get(
|
||||
@@ -978,7 +956,6 @@ class AppointmentController extends BaseController
|
||||
}
|
||||
|
||||
if ($newStatus === Appointment::STATUS_COMPLETED) {
|
||||
$this->recordCompletion($appointment);
|
||||
}
|
||||
|
||||
return $this->success(['data' => $appointment->toArray()]);
|
||||
@@ -1254,7 +1231,6 @@ class AppointmentController extends BaseController
|
||||
}
|
||||
|
||||
if ($completed) {
|
||||
$this->recordCompletion($appointment);
|
||||
}
|
||||
|
||||
return $this->success(['data' => $appointment->toArray()]);
|
||||
|
||||
Reference in New Issue
Block a user