removed all references to credits. now credits are completely replaced by addons.

This commit is contained in:
Codex Agent
2025-12-01 15:50:17 +01:00
parent b8e515a03c
commit 28539754a7
76 changed files with 97 additions and 2533 deletions

View File

@@ -26,7 +26,13 @@ class PackageLimitEvaluatorTest extends TestCase
public function test_assess_event_creation_returns_null_when_allowance_available(): void
{
$tenant = Tenant::factory()->create(['event_credits_balance' => 2]);
$tenant = Tenant::factory()->create();
$package = Package::factory()->reseller()->create(['max_events_per_year' => 5]);
TenantPackage::factory()->for($tenant)->for($package)->create([
'used_events' => 1,
'expires_at' => now()->addMonth(),
'active' => true,
]);
$violation = $this->evaluator->assessEventCreation($tenant);
@@ -39,7 +45,7 @@ class PackageLimitEvaluatorTest extends TestCase
'max_events_per_year' => 1,
]);
$tenant = Tenant::factory()->create(['event_credits_balance' => 0]);
$tenant = Tenant::factory()->create();
TenantPackage::factory()->create([
'tenant_id' => $tenant->id,
@@ -59,17 +65,6 @@ class PackageLimitEvaluatorTest extends TestCase
$this->assertSame(0, $violation['meta']['remaining']);
}
public function test_assess_event_creation_returns_credit_violation_when_no_credits(): void
{
$tenant = Tenant::factory()->create(['event_credits_balance' => 0]);
$violation = $this->evaluator->assessEventCreation($tenant);
$this->assertNotNull($violation);
$this->assertSame('event_credits_exhausted', $violation['code']);
$this->assertSame('credits', $violation['meta']['scope']);
}
public function test_assess_photo_upload_returns_violation_when_photo_limit_reached(): void
{
$package = Package::factory()->endcustomer()->create([