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
@@ -2,6 +2,7 @@
namespace App\Repositories\Api\ServiceClient;
use App\Support\ProductBillingCycles;
use App\Models\Service;
use App\Repositories\Api\BaseApiRepository;
@@ -46,8 +47,13 @@ class ServiceClientRepository extends BaseApiRepository implements ServiceClient
public function getPricing(int $productId, string $billingCycle)
{
$pricing = $this->model->find($productId)
->pricings()
$product = $this->model->find($productId);
if (!ProductBillingCycles::allows($product->product_type, $billingCycle)) {
return null;
}
$pricing = $product->pricings()
->where('billing_cycle', $billingCycle)
->where('is_active', 1)
->first();