Files
portal-api/app/Repositories/Api/Order/OrderRepositoryInterface.php
T
2026-09-28 08:26:29 +07:00

35 lines
1007 B
PHP

<?php
namespace App\Repositories\Api\Order;
use App\Models\Order;
use App\Models\OrderItem;
use App\Repositories\BaseRepositoryInterface;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
interface OrderRepositoryInterface extends BaseRepositoryInterface
{
/**
* Create an order item for the given order.
* Addon selections are serialised into addons_meta JSON.
*/
public function createItem(int $orderId, array $data): OrderItem;
/**
* Return true if the customer has any pending orders.
*/
public function hasPendingOrder(int $customerId): bool;
/**
* Paginated order list for a customer, with optional filters.
*/
public function getOrders(int $customerId, array $filters): LengthAwarePaginator;
/**
* Find an order by order_num, scoped to the owning customer.
*/
public function findByOrderNum(string $orderNum, int $customerId): ?Order;
public function findForCustomer(int $id, int $customerId): ?Order;
}