feat(appointment): implement immutable booking mode after first save and update API documentation

This commit is contained in:
hamed
2026-07-15 23:33:00 +03:30
parent ad94c165e8
commit 2df16c6d29
5 changed files with 176 additions and 32 deletions
+12
View File
@@ -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,
];