Squashed commit of the following:
commit1dc4e29c69Author: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 13:58:03 2026 -0300 refactor(reservations): unify expiration command commit093e894cc3Author: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 13:48:09 2026 -0300 feat(cart): expire abandoned stock reservations commitfdf0f3328fAuthor: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 12:53:12 2026 -0300 refactor(stock): implement expiration for stock reservations and add configuration commit8d6bcdcc43Author: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 12:38:21 2026 -0300 refactor(cart): invalidate payment on actual changes commit3206e293ebAuthor: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 12:24:48 2026 -0300 refactor(cart): own checkout item editing commitaed99bd05eAuthor: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 12:14:57 2026 -0300 refactor(checkout): remove legacy purchase item reservations commitf1649e0e4bAuthor: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 12:06:29 2026 -0300 refactor(checkout): materialize purchase items on confirmation commite6c4b40a37Author: ncoronel <ncoronel@quo.ar> Date: Wed Aug 19 12:06:19 2026 -0300 feat(inventory): add traceable cart stock reservations
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Domains\Purchase\Services\CheckoutService;
|
||||
use App\Domains\Catalog\Services\ExpireStockReservationsService;
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
@@ -9,13 +9,13 @@ Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
|
||||
Artisan::command('purchases:expire', function (): void {
|
||||
$expiredCount = app(CheckoutService::class)
|
||||
->expireOverduePurchases();
|
||||
Artisan::command('reservations:expire', function (): void {
|
||||
$expired = app(ExpireStockReservationsService::class)->expireOverdue();
|
||||
|
||||
$this->info("Expired purchases: {$expiredCount}");
|
||||
})->purpose('Release stock reservations from expired purchases');
|
||||
$this->info("Expired purchases: {$expired['purchases']}");
|
||||
$this->info("Expired cart items: {$expired['cart_items']}");
|
||||
})->purpose('Release expired stock reservations from purchases and abandoned carts');
|
||||
|
||||
Schedule::command('purchases:expire')
|
||||
Schedule::command('reservations:expire')
|
||||
->everyMinute()
|
||||
->withoutOverlapping();
|
||||
|
||||
Reference in New Issue
Block a user