Make MarkBookingRefunded synchronous so refunds cancel instantly

It was ShouldQueue, so on QUEUE_CONNECTION=database with no worker running
(or just queue lag), a booking stayed Confirmed in the UI until a worker
processed the job — refund actions in Filament looked like they hadn't
taken effect without a page reload. A refund is always initiated from a
request already waiting on it (the Filament action or the API endpoint),
so there's no reason to defer the status flip.
This commit is contained in:
Nyan Lin Paing
2026-09-03 10:51:43 +07:00
parent e555413295
commit 825320a117
2 changed files with 8 additions and 7 deletions
@@ -29,7 +29,7 @@ test('does not touch a booking that already moved on for another reason', functi
expect($booking->refresh()->status)->toBe(BookingStatus::Cancelled);
});
test('does not crash if the booking was soft-deleted before this queued listener ran', function () {
test('does not crash if the booking was soft-deleted before this listener ran', function () {
$booking = Booking::factory()->create(['status' => BookingStatus::Confirmed]);
$payment = Payment::factory()->completed()->create(['booking_id' => $booking->id, 'gateway' => PaymentMethod::KbzMiniApp]);
$refund = Refund::factory()->create(['payment_id' => $payment->id, 'status' => RefundStatus::Completed]);