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
+3 -3
View File
@@ -2,7 +2,7 @@
namespace App\Helpers;
use App\Enums\Product\ProductBillingCycle;
use App\Support\BillingCycleCatalog;
use App\Models\Invoice;
use App\Models\Order;
use Illuminate\Support\Str;
@@ -37,9 +37,9 @@ class OrderHelper
*/
public static function cycleToMonths(?string $cycle): int
{
$enum = ProductBillingCycle::tryFrom($cycle ?? '')
$months = BillingCycleCatalog::monthsFor($cycle)
?? throw new \InvalidArgumentException("Unknown billing cycle: " . ($cycle ?? 'null'));
return $enum === ProductBillingCycle::ONE_TIME ? 1 : $enum->months();
return $months ?: 1;
}
}