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:
co-authored by
Claude Sonnet 5.5
parent
ea9a53f742
commit
25f23d541e
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user