TenantAtlas/apps/platform/app/Support/Badges/Domains/CoverageV2IdentityStateBadge.php
Ahmed Darrazi d1f7fbd4c6
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m15s
feat: add coverage v2 operator surface
2026-06-26 14:48:49 +02:00

27 lines
963 B
PHP

<?php
declare(strict_types=1);
namespace App\Support\Badges\Domains;
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeMapper;
use App\Support\Badges\BadgeSpec;
final class CoverageV2IdentityStateBadge implements BadgeMapper
{
public function spec(mixed $value): BadgeSpec
{
$state = BadgeCatalog::normalizeState($value);
return match ($state) {
'stable' => new BadgeSpec('Stable', 'success', 'heroicon-m-check-circle'),
'derived' => new BadgeSpec('Derived', 'warning', 'heroicon-m-link'),
'identity_conflict' => new BadgeSpec('Identity conflict', 'danger', 'heroicon-m-exclamation-triangle'),
'missing_external_id' => new BadgeSpec('Missing external ID', 'danger', 'heroicon-m-identification'),
'unsupported_identity' => new BadgeSpec('Unsupported identity', 'danger', 'heroicon-m-no-symbol'),
default => BadgeSpec::unknown(),
};
}
}