TenantAtlas/app/Support/Badges/Domains/TenantStatusBadge.php
ahmido 641bb4afde feat: implement tenant lifecycle operability semantics (#172)
## Summary
- implement Spec 143 tenant lifecycle, operability, and tenant-context semantics across chooser, tenant management, onboarding, and canonical operation viewers
- add centralized tenant lifecycle and operability support types, audit action coverage, and lifecycle-aware badge and action handling
- add feature and unit coverage for tenant chooser eligibility, global search scoping, canonical operation access, onboarding authorization, and lifecycle presentation

## Testing
- vendor/bin/sail artisan test --compact
- vendor/bin/sail bin pint --dirty --format agent

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #172
2026-03-15 09:08:36 +00:00

24 lines
772 B
PHP

<?php
namespace App\Support\Badges\Domains;
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeMapper;
use App\Support\Badges\BadgeSpec;
final class TenantStatusBadge implements BadgeMapper
{
public function spec(mixed $value): BadgeSpec
{
$state = BadgeCatalog::normalizeTenantLifecycle($value);
return match ($state) {
'draft' => new BadgeSpec('Draft', 'gray', 'heroicon-m-document'),
'onboarding' => new BadgeSpec('Onboarding', 'warning', 'heroicon-m-arrow-path'),
'active' => new BadgeSpec('Active', 'success', 'heroicon-m-check-circle'),
'archived' => new BadgeSpec('Archived', 'gray', 'heroicon-m-archive-box'),
default => BadgeSpec::unknown(),
};
}
}