26 lines
642 B
PHP
26 lines
642 B
PHP
<?php
|
|
|
|
namespace App\Domains\Catalog\Services;
|
|
|
|
use App\Domains\Cart\Services\ExpireCartReservationsService;
|
|
use App\Domains\Purchase\Services\CheckoutService;
|
|
|
|
class ExpireStockReservationsService
|
|
{
|
|
public function __construct(
|
|
private readonly CheckoutService $checkout,
|
|
private readonly ExpireCartReservationsService $carts,
|
|
) {}
|
|
|
|
/**
|
|
* @return array{purchases: int, cart_items: int}
|
|
*/
|
|
public function expireOverdue(): array
|
|
{
|
|
return [
|
|
'purchases' => $this->checkout->expireOverduePurchases(),
|
|
'cart_items' => $this->carts->expireOverdue(),
|
|
];
|
|
}
|
|
}
|