feat: add invalidation

This commit is contained in:
rinsvent 2026-05-17 21:53:04 +07:00
parent 4c018d0bf7
commit 42433a8cbf

View File

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