2026-06-14 21:32:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Domain\Ports\Repositories;
|
|
|
|
|
|
|
|
|
|
use Domain\Models\Entities\Order;
|
|
|
|
|
use Domain\Models\ValueObjects\Entities\OrderId;
|
|
|
|
|
use Shared\DDD\Repository;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @extends Repository<OrderId, Order>
|
|
|
|
|
*/
|
|
|
|
|
interface OrderRepository extends Repository
|
|
|
|
|
{
|
|
|
|
|
public function find(OrderId $id): ?Order;
|
|
|
|
|
|
2026-11-16 19:57:06 +01:00
|
|
|
public function findForUpdate(OrderId $id): ?Order;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<OrderId>
|
|
|
|
|
*/
|
|
|
|
|
public function findStalePendingOrderIds(\DateTimeInterface $olderThan): array;
|
|
|
|
|
|
2026-06-14 21:32:07 +02:00
|
|
|
public function persist(Order $order): void;
|
|
|
|
|
|
|
|
|
|
public function delete(Order $order): void;
|
|
|
|
|
}
|