feat: clean credits users
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Enums\BillingProductPurpose;
|
||||
use App\Enums\CreditProductType;
|
||||
use App\Models\CreditProduct;
|
||||
use App\Models\BillingProduct;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
@@ -12,35 +11,22 @@ uses(RefreshDatabase::class);
|
||||
it('lists the subscription and certification offers for the mobile app', function () {
|
||||
Sanctum::actingAs(User::factory()->create());
|
||||
|
||||
CreditProduct::create([
|
||||
BillingProduct::create([
|
||||
'name' => 'Certification',
|
||||
'type' => CreditProductType::ONE_TIME,
|
||||
'purpose' => BillingProductPurpose::CERTIFICATION,
|
||||
'credits' => 0,
|
||||
'amount' => 1999,
|
||||
'currency' => 'eur',
|
||||
'stripe_price_id' => 'price_certification',
|
||||
'sort_order' => 20,
|
||||
]);
|
||||
CreditProduct::create([
|
||||
BillingProduct::create([
|
||||
'name' => 'Bowli Plus',
|
||||
'type' => CreditProductType::MONTHLY,
|
||||
'purpose' => BillingProductPurpose::SUBSCRIPTION,
|
||||
'credits' => 0,
|
||||
'amount' => 999,
|
||||
'currency' => 'eur',
|
||||
'stripe_price_id' => 'price_subscription',
|
||||
'sort_order' => 10,
|
||||
]);
|
||||
CreditProduct::create([
|
||||
'name' => 'Ancien pack',
|
||||
'type' => CreditProductType::ONE_TIME,
|
||||
'credits' => 5,
|
||||
'amount' => 299,
|
||||
'currency' => 'eur',
|
||||
'stripe_price_id' => 'price_legacy',
|
||||
]);
|
||||
|
||||
$this
|
||||
->getJson('/api/billing/products')
|
||||
->assertOk()
|
||||
|
||||
Reference in New Issue
Block a user