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
@@ -0,0 +1,25 @@
<?php
namespace Tests\Feature;
use App\Support\ProductBillingCycles;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ProductBillingCyclesTest extends TestCase
{
use RefreshDatabase;
public function test_defaults_and_saved_cycles(): void
{
$this->assertSame(['annually'], ProductBillingCycles::forType('domain'));
$this->assertContains('monthly', ProductBillingCycles::forType('vps'));
ProductBillingCycles::save(['hosting' => ['monthly', 'annually'], 'domain' => ['annually', 'biennially']]);
$this->assertSame(['monthly', 'annually'], ProductBillingCycles::forType('hosting'));
$this->assertTrue(ProductBillingCycles::allows('domain', 'biennially'));
$this->assertFalse(ProductBillingCycles::allows('hosting', 'quarterly'));
$this->assertTrue(ProductBillingCycles::allows('hosting', 'onetime'));
}
}