feat: add past slot validation to appointment controllers and update SlotCard component

This commit is contained in:
hamed
2026-06-11 20:00:02 +03:30
parent c1df5b73e7
commit c05ac7ca51
3 changed files with 27 additions and 0 deletions
@@ -173,6 +173,10 @@ class AppointmentController extends BaseController
return $this->error(ErrorCodes::ERR_VALIDATION_001, 'doctor_uuid، slot_start و slot_end الزامی است', 422);
}
if ($slotStart < time()) {
return $this->error(ErrorCodes::ERR_VALIDATION_001, 'زمان این اسلات گذشته است', 422);
}
$doctor = $this->doctorRepo->findByUuid($doctorUuid);
if ($doctor === null) {
return $this->error(ErrorCodes::ERR_VALIDATION_002, 'دکتر یافت نشد', 404);