@php $badge = function (\App\Support\Badges\BadgeDomain $domain, ?string $state): ?\App\Support\Badges\BadgeSpec { return filled($state) ? \App\Support\Badges\BadgeRenderer::spec($domain, $state) : null; }; $badges = [ 'Coverage' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2CoverageLevel, $details['coverage_level'] ?? null), 'Evidence' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2EvidenceState, $details['evidence_state'] ?? null), 'Identity' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2IdentityState, $details['identity_state'] ?? null), 'Claim' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2ClaimState, $details['claim_state'] ?? null), ]; $productFields = [ 'Resource type' => $details['resource_type'] ?? null, 'Provider connection' => $details['provider_connection'] ?? null, 'Last captured' => $details['last_captured'] ?? null, 'Capture outcome' => $details['capture_outcome'] ?? null, ]; $sourceBadge = $badge(\App\Support\Badges\BadgeDomain::CoverageV2SourceClass, $details['source_class'] ?? null); $technicalFields = [ 'Canonical type' => $details['canonical_type'] ?? null, 'Canonical key' => $details['canonical_resource_key'] ?? null, 'Evidence hash' => $details['evidence_hash'] ?? null, 'Source contract' => $details['source_contract_key'] ?? null, 'Source version' => $details['source_version'] ?? null, 'Source schema hash' => $details['source_schema_hash'] ?? null, 'Identity reason' => $details['identity_reason_code'] ?? null, ]; $hasTechnicalDetails = collect($technicalFields)->contains(fn ($value): bool => filled($value)) || $sourceBadge !== null || filled($details['operation_run_url'] ?? null); $typedSummary = $details['typed_render_summary'] ?? null; $compareSummary = is_array($typedSummary) && is_array($typedSummary['compare_summary'] ?? null) ? $typedSummary['compare_summary'] : null; $summaryFields = is_array($typedSummary) && is_array($typedSummary['summary_fields'] ?? null) ? $typedSummary['summary_fields'] : []; @endphp
@foreach ($badges as $label => $spec) @if ($spec) {{ $label }}: {{ $spec->label }} @endif @endforeach
@if (($details['blockers'] ?? []) !== [])
Activation blockers
@foreach ($details['blockers'] as $blocker) {{ $blocker }} @endforeach
@endif @if (is_array($typedSummary))
{{ $typedSummary['resource_type'] ?? 'Typed summary' }}
@if ($summaryFields !== []) @foreach ($summaryFields as $field) @if (is_array($field) && filled($field['value'] ?? null))
{{ $field['label'] ?? 'Summary' }}
{{ $field['value'] }}
@endif @endforeach @else @foreach ([ 'Display name' => $typedSummary['display_name'] ?? null, 'State' => $typedSummary['state'] ?? null, 'Grant controls' => $typedSummary['grant_controls'] ?? null, 'Session controls' => $typedSummary['session_controls'] ?? null, 'Claim state' => $typedSummary['claim_state'] ?? null, 'Identity state' => $typedSummary['identity_state'] ?? null, 'Last captured' => $typedSummary['last_captured'] ?? null, ] as $label => $value) @if (filled($value))
{{ $label }}
{{ $value }}
@endif @endforeach @endif
@foreach (['targets' => 'Targets', 'conditions' => 'Conditions'] as $summaryKey => $heading) @if (($typedSummary[$summaryKey] ?? []) !== [])
{{ $heading }}
@foreach ($typedSummary[$summaryKey] as $row) @if (is_array($row) && filled($row['value'] ?? null))
{{ $row['label'] ?? 'Summary' }}
{{ $row['value'] }}
@endif @endforeach
@endif @endforeach @if ($compareSummary !== null)
Compare summary
{{ $compareSummary['status'] ?? 'Compare summary unavailable' }} @if (filled($compareSummary['previous_captured'] ?? null)) Previous comparable evidence: {{ $compareSummary['previous_captured'] }} @endif
@if (($compareSummary['changes'] ?? []) !== [])
@foreach ($compareSummary['changes'] as $change) @if (is_array($change))
{{ $change['label'] ?? 'Changed field' }}
{{ str((string) ($change['classification'] ?? 'changed'))->replace('_', ' ')->headline() }} ยท {{ str((string) ($change['importance'] ?? 'informational'))->replace('_', ' ')->headline() }}
@endif @endforeach
@endif
@endif @foreach ([ 'unsupported_fields' => ['Unsupported fields', 'warning', 'heroicon-m-exclamation-triangle'], 'redacted_fields' => ['Redacted fields', 'gray', 'heroicon-m-shield-check'], ] as $summaryKey => [$heading, $color, $icon]) @if (($typedSummary[$summaryKey] ?? []) !== [])
{{ $heading }}
@foreach ($typedSummary[$summaryKey] as $field) {{ $field }} @endforeach
@endif @endforeach
@endif
@foreach ($productFields as $label => $value) @if (filled($value))
{{ $label }}
{{ $value }}
@endif @endforeach
@if ($hasTechnicalDetails)
View technical details
@if ($sourceBadge)
Source: {{ $sourceBadge->label }}
@endif
@foreach ($technicalFields as $label => $value) @if (filled($value))
{{ $label }}
{{ $value }}
@endif @endforeach
@if (filled($details['operation_run_url'] ?? null)) {{ $details['operation_run_label'] ?? 'Open operation' }} @endif
@endif