## Summary - implement the provider capability registry and derived capability evaluation flow - update provider connections, onboarding, required-permissions diagnostics, and provider blocker translation to use capability-first summaries - add bounded unit, feature, and browser test coverage plus the prepared Spec 283 artifacts ## Notes - branch: `283-provider-capability-registry` - commit: `74e75c3e` - no additional validation commands were run in this git/PR flow step Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #342
25 lines
897 B
PHP
25 lines
897 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 ProviderCapabilityStatusBadge implements BadgeMapper
|
|
{
|
|
public function spec(mixed $value): BadgeSpec
|
|
{
|
|
$state = BadgeCatalog::normalizeState($value);
|
|
|
|
return match ($state) {
|
|
'supported' => new BadgeSpec('Supported', 'success', 'heroicon-m-check-circle'),
|
|
'missing' => new BadgeSpec('Missing', 'warning', 'heroicon-m-exclamation-triangle'),
|
|
'blocked' => new BadgeSpec('Blocked', 'danger', 'heroicon-m-x-circle'),
|
|
'unknown' => new BadgeSpec('Unknown', 'gray', 'heroicon-m-question-mark-circle'),
|
|
'not_applicable' => new BadgeSpec('Not applicable', 'gray', 'heroicon-m-minus-circle'),
|
|
default => BadgeSpec::unknown(),
|
|
};
|
|
}
|
|
}
|