feat(appointment): implement immutable booking mode after first save and update API documentation
This commit is contained in:
@@ -79,6 +79,16 @@ class WeeklySchedule
|
||||
return array_merge(self::DEFAULT_META, $this->setting[self::META_KEY] ?? []);
|
||||
}
|
||||
|
||||
/**
|
||||
* booking_mode ذخیرهشده بهصورت خام (بدون merge پیشفرض). null یعنی هنوز
|
||||
* صریحاً ثبت نشده — تا وقتی null است، انتخاب روش قابلتغییر است؛ پس از اولین
|
||||
* ثبت، قفل میشود.
|
||||
*/
|
||||
public function getStoredBookingMode(): ?string
|
||||
{
|
||||
return $this->setting[self::META_KEY]['booking_mode'] ?? null;
|
||||
}
|
||||
|
||||
public function setMeta(array $meta): self
|
||||
{
|
||||
$current = $this->getMeta();
|
||||
@@ -111,6 +121,8 @@ class WeeklySchedule
|
||||
'doctor_uuid' => $this->doctor->getUuid(),
|
||||
'schedule' => $this->getDaySchedule(),
|
||||
'meta' => $this->getMeta(),
|
||||
// نوع نوبتدهی پس از اولین ثبت قفل میشود (پنل توگل را غیرفعال میکند).
|
||||
'booking_mode_locked' => $this->getStoredBookingMode() !== null,
|
||||
'created_at' => $this->createdAt,
|
||||
'updated_at' => $this->updatedAt,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user