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
@@ -5,7 +5,7 @@ namespace App\Http\Requests\Api\Order;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use App\Enums\Product\ProductBillingCycle;
use App\Support\BillingCycleCatalog;
use App\Enums\Product\ProductTypeEnums;
use App\Models\Product;
@@ -35,11 +35,12 @@ class StoreOrderRequest extends FormRequest
{
return [
'product_id' => ['required', Rule::exists('products', 'uuid')->whereNull('deleted_at')],
'billing_cycle'=> ['required', Rule::enum(ProductBillingCycle::class)],
'billing_cycle'=> ['required', Rule::in([...BillingCycleCatalog::codes(), 'onetime'])],
'server_name' => $this->isHostingOrder()
? ['required', 'string', 'max:253', 'regex:'.self::DOMAIN_PATTERN]
: 'nullable|string|max:255',
'os_id' => 'nullable|integer',
'coupon_code' => 'nullable|string|max:50',
'addons' => 'array',
'addons.*.addon_id' => 'nullable|exists:product_addon,id',
'addons.*.qty' => 'nullable|integer|min:0|max:1000000',