Files
portal-api/app/Repositories/Api/Order/OrderRepositoryInterface.php
T
baodev0 7314313198 Refactor order payment process and enhance invoice details
- Updated `payOrder` method in `OrderControllerRefactor` to accept `orderNum` instead of `id` for better clarity and functionality.
- Implemented `findByOrderNum` method in `OrderRepository` to retrieve orders based on order number and customer ID.
- Enhanced `InvoiceDetailResource` to include VMware details and removed unnecessary fields.
- Added `service_plan_id` to `ProductResource` and updated the `Product` model to establish a relationship with `ServicePlan`.
- Created `ServicePlan` and `ServicePlanPlesk` models along with their respective controllers and migrations for managing hosting service plans.
- Updated API routes to include endpoints for managing service plans.
- Modified email templates to standardize support phone number across various customer communications.
2026-08-11 10:12:25 +07:00

38 lines
1.1 KiB
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;
/**
* Find an order by order_num, scoped to the owning customer.
*/
public function findByOrderNum(string $orderNum, int $customerId): ?Order;
}