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:
@@ -40,7 +40,6 @@ class AvailabilityController extends BaseController
|
||||
private readonly WeeklyScheduleRepository $schedules,
|
||||
private readonly DoctorRepository $doctors,
|
||||
private readonly BranchResolver $branches,
|
||||
private readonly \App\Course\Repository\TreatmentCourseRepository $courses,
|
||||
) {}
|
||||
|
||||
#[Route('/api/v1/appointment-availability', name: 'appointment_availability', methods: ['POST'])]
|
||||
@@ -111,7 +110,6 @@ class AvailabilityController extends BaseController
|
||||
$step,
|
||||
null,
|
||||
$this->strategyFor($data['doctor_uuid'] ?? null),
|
||||
$this->preferredResourceIds($user, $data['course_uuid'] ?? null),
|
||||
);
|
||||
|
||||
return $this->success([
|
||||
@@ -194,37 +192,6 @@ class AvailabilityController extends BaseController
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* منبع ترجیحیِ یک دورهٔ درمان — «همان اپراتور جلسهٔ قبل».
|
||||
*
|
||||
* ترجیح است نه فیلتر: اگر آزاد نباشد، استراتژی به ترتیب پایه برمیگردد و رزرو
|
||||
* انجام میشود. اجبار یعنی بیمار دو هفته منتظر بماند.
|
||||
*
|
||||
* @return list<int>
|
||||
*/
|
||||
private function preferredResourceIds(User $user, mixed $courseUuid): array
|
||||
{
|
||||
if (!is_string($courseUuid) || $courseUuid === '') {
|
||||
return [];
|
||||
}
|
||||
|
||||
$course = $this->courses->findByUuid($courseUuid);
|
||||
|
||||
if ($course === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
[$entityType, $entityId] = $this->branches->pair($user);
|
||||
|
||||
if ($course->getEntityType() !== $entityType || $course->getEntityId() !== $entityId) {
|
||||
throw new AppException(ErrorCodes::ERR_NOT_FOUND_001, 'دوره یافت نشد', 404);
|
||||
}
|
||||
|
||||
$preferred = $course->getPreferredResource();
|
||||
|
||||
return $preferred === null ? [] : [(int) $preferred->getId()];
|
||||
}
|
||||
|
||||
private function assertResourceMode(mixed $doctorUuid, DoctorAddress $address): void
|
||||
{
|
||||
if (!is_string($doctorUuid) || $doctorUuid === '') {
|
||||
|
||||
Reference in New Issue
Block a user