T003-T018b: Add workspace_baselines.view/manage capabilities, role mappings, baseline_capture/baseline_compare operation labels, severity summary keys, 5 migrations, 4 models, 4 factories, BaselineScope, BaselineReasonCodes, BaselineProfileStatus badge domain + mapper.
26 lines
810 B
PHP
26 lines
810 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Badges\Domains;
|
|
|
|
use App\Models\BaselineProfile;
|
|
use App\Support\Badges\BadgeCatalog;
|
|
use App\Support\Badges\BadgeMapper;
|
|
use App\Support\Badges\BadgeSpec;
|
|
|
|
final class BaselineProfileStatusBadge implements BadgeMapper
|
|
{
|
|
public function spec(mixed $value): BadgeSpec
|
|
{
|
|
$state = BadgeCatalog::normalizeState($value);
|
|
|
|
return match ($state) {
|
|
BaselineProfile::STATUS_DRAFT => new BadgeSpec('Draft', 'gray', 'heroicon-m-pencil-square'),
|
|
BaselineProfile::STATUS_ACTIVE => new BadgeSpec('Active', 'success', 'heroicon-m-check-circle'),
|
|
BaselineProfile::STATUS_ARCHIVED => new BadgeSpec('Archived', 'warning', 'heroicon-m-archive-box'),
|
|
default => BadgeSpec::unknown(),
|
|
};
|
|
}
|
|
}
|