feat(refund): add support for event date suspension in cart invalidation process
This commit is contained in:
@@ -15,9 +15,12 @@ class InvalidateEventDateCartsService
|
||||
public function __construct(private readonly StockReservationService $reservations) {}
|
||||
|
||||
/** @param Collection<int, int> $eventDateIds */
|
||||
public function invalidate(Tenant $tenant, Collection $eventDateIds): void
|
||||
{
|
||||
DB::transaction(function () use ($tenant, $eventDateIds): void {
|
||||
public function invalidate(
|
||||
Tenant $tenant,
|
||||
Collection $eventDateIds,
|
||||
string $reason = StockReservationService::REASON_EVENT_DATE_RESCHEDULED,
|
||||
): void {
|
||||
DB::transaction(function () use ($tenant, $eventDateIds, $reason): void {
|
||||
$carts = Cart::query()
|
||||
->where('tenant_codigo', $tenant->codigo)
|
||||
->where('status', Cart::STATUS_ACTIVE)
|
||||
@@ -44,7 +47,7 @@ class InvalidateEventDateCartsService
|
||||
|
||||
$this->reservations->releaseCurrentCartReservation(
|
||||
$cart,
|
||||
StockReservationService::REASON_EVENT_DATE_RESCHEDULED,
|
||||
$reason,
|
||||
);
|
||||
|
||||
// Reuse the existing expired-cart flow: stale mutations receive the
|
||||
|
||||
Reference in New Issue
Block a user