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
+6 -2
View File
@@ -2,6 +2,8 @@
namespace App\Enums\Product;
use App\Support\BillingCycleCatalog;
enum ProductBillingCycle: string
{
case ONE_TIME = 'onetime';
@@ -40,14 +42,16 @@ enum ProductBillingCycle: string
public static function vietnameseLabelFor(?string $code): string
{
return self::tryFrom((string) $code)?->vietnameseLabel() ?? ($code ?: 'N/A');
return self::tryFrom((string) $code)?->vietnameseLabel()
?? BillingCycleCatalog::labelForCode($code)
?? ($code ?: 'N/A');
}
public static function vietnameseLabelForMonths(int $months): string
{
$cycle = collect(self::cases())->first(fn (self $case) => $case->months() === $months && $months > 0);
return $cycle?->vietnameseLabel() ?? $months . ' tháng';
return $cycle?->vietnameseLabel() ?? BillingCycleCatalog::labelForMonths($months);
}
public function months(): int