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); + } }