feat: Reimplement order and invoice management with new service and repository layers, introduce compression middleware, and update database schema.

This commit is contained in:
pbao9
2026-03-12 09:30:29 +07:00
parent 7f6264c87f
commit 1e09ccf17b
87 changed files with 2348 additions and 2612 deletions
@@ -2,15 +2,31 @@
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
{
public function createItem($orderId, array $data);
/**
* Create an order item for the given order.
* Addon selections are serialised into addons_meta JSON.
*/
public function createItem(int $orderId, array $data): OrderItem;
public function processPayment($order, $method);
/**
* Mark order as completed, update the related invoice as paid.
*/
public function processPayment(Order $order, string $method): Order;
public function hasPendingOrder($customerId);
/**
* Return true if the customer has any pending orders.
*/
public function hasPendingOrder(int $customerId): bool;
public function getOrders($customerId, array $filters);
/**
* Paginated order list for a customer, with optional filters.
*/
public function getOrders(int $customerId, array $filters): LengthAwarePaginator;
}