feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.

This commit is contained in:
pbao9
2026-02-11 17:02:07 +07:00
parent 58a9aa685b
commit 556b2c02e6
47 changed files with 1367 additions and 497 deletions
@@ -0,0 +1,31 @@
<?php
namespace App\Repositories\Api\Order;
use App\Models\Order;
use App\Repositories\Api\BaseApiRepository;
class OrderRepository extends BaseApiRepository implements OrderRepositoryInterface
{
public function getModel()
{
return Order::class;
}
public function createItem($orderId, array $data)
{
return \App\Models\OrderItem::create(array_merge(
['order_id' => $orderId],
$data
));
}
public function processPayment($order, $method)
{
return $order->update([
'status' => 'paid',
'payment_method' => $method,
'paid_at' => now()
]);
}
}