feat(billing): renewals, coupons, VAT numbering, billing cycles and invoice payment tracking

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-19 16:37:56 +07:00
co-authored by Claude Sonnet 5.5
parent ea9a53f742
commit 25f23d541e
134 changed files with 4926 additions and 185 deletions
@@ -2,6 +2,7 @@
namespace App\Http\Resources\Api\Admin;
use App\Support\Billing\BillingDuplicateDetector;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -12,6 +13,7 @@ class OrderResource extends JsonResource
return [
'id' => $this->id,
'order_num' => $this->order_num,
'duplicate' => BillingDuplicateDetector::forOrder($this->id),
'customer' => $this->whenLoaded('customer', fn() => [
'id' => $this->customer->id,
'uuid' => $this->customer->uuid,
@@ -95,6 +97,7 @@ class OrderResource extends JsonResource
])),
'sub_total' => $this->sub_total,
'discount_amount' => $this->discount_amount,
'coupon_code' => $this->coupon_code,
'total' => $this->total,
// Order has no payment_id FK — `payment` relation is always null. Fall back to
// the raw payment_method string instead of letting whenLoaded() mask it with null.