## Summary - implement Spec 177 inventory coverage truth across resolver, badges, KPIs, coverage page, and operation run detail surfaces - add repo-native spec artifacts for the feature under `specs/177-inventory-coverage-truth` - add unit, feature, and browser coverage for truth derivation, continuity, and inventory item filter/pagination smoke paths ## Testing - `vendor/bin/sail bin pint --dirty --format agent` - focused Spec 177 browser smoke file passed with 2 tests / 57 assertions - extended inventory-focused test pack passed with 52 tests / 434 assertions Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #208
26 lines
811 B
PHP
26 lines
811 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 InventoryCoverageStateBadge implements BadgeMapper
|
|
{
|
|
public function spec(mixed $value): BadgeSpec
|
|
{
|
|
$state = BadgeCatalog::normalizeState($value);
|
|
|
|
return match ($state) {
|
|
'succeeded' => new BadgeSpec('Succeeded', 'success', 'heroicon-m-check-circle'),
|
|
'failed' => new BadgeSpec('Failed', 'danger', 'heroicon-m-x-circle'),
|
|
'skipped' => new BadgeSpec('Skipped', 'warning', 'heroicon-m-minus-circle'),
|
|
'unknown' => new BadgeSpec('Unknown', 'gray', 'heroicon-m-question-mark-circle'),
|
|
default => BadgeSpec::unknown(),
|
|
};
|
|
}
|
|
}
|