From 42433a8cbf9370fd00e88825f06e13f178d588a6 Mon Sep 17 00:00:00 2001 From: rinsvent Date: Sun, 17 May 2026 21:53:04 +0700 Subject: [PATCH] feat: add invalidation --- app/Services/SlotService.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Services/SlotService.php b/app/Services/SlotService.php index cfb8bb9..0ce26d1 100644 --- a/app/Services/SlotService.php +++ b/app/Services/SlotService.php @@ -99,6 +99,8 @@ class SlotService $lockedHold->status = HoldStatus::Confirmed; $lockedHold->save(); + $this->invalidateAvailabilityCache(); + return $lockedHold->load('slot'); }); } @@ -121,6 +123,8 @@ class SlotService $lockedHold->status = HoldStatus::Cancelled; $lockedHold->save(); + $this->invalidateAvailabilityCache(); + return $lockedHold->load('slot'); }); } @@ -142,4 +146,9 @@ class SlotService ->where('idempotency_key', $idempotencyKey) ->first(); } + + private function invalidateAvailabilityCache(): void + { + Cache::forget(self::AVAILABILITY_CACHE_KEY); + } }