33 lines
931 B
PHP
33 lines
931 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;
|
|
|
|
/**
|
|
* Mark order as completed, update the related invoice as paid.
|
|
*/
|
|
public function processPayment(Order $order, string $method): Order;
|
|
|
|
/**
|
|
* 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;
|
|
}
|