<?php

declare(strict_types=1);

use App\Services\Entitlements\WorkspaceCommercialLifecycleResolver;
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeDomain;

it('maps commercial lifecycle states through the shared badge catalog', function (string $state, string $label, string $color): void {
    $spec = BadgeCatalog::spec(BadgeDomain::CommercialLifecycleState, $state);

    expect($spec->label)->toBe($label)
        ->and($spec->color)->toBe($color)
        ->and($spec->icon)->not->toBeNull();
})->with([
    'trial' => [WorkspaceCommercialLifecycleResolver::STATE_TRIAL, 'Trial', 'info'],
    'grace' => [WorkspaceCommercialLifecycleResolver::STATE_GRACE, 'Grace', 'warning'],
    'active paid' => [WorkspaceCommercialLifecycleResolver::STATE_ACTIVE_PAID, 'Active paid', 'success'],
    'suspended read-only' => [WorkspaceCommercialLifecycleResolver::STATE_SUSPENDED_READ_ONLY, 'Suspended / read-only', 'danger'],
]);
