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,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();
|
||||
|
||||
Reference in New Issue
Block a user