TenantAtlas/apps/platform/app/Services/Evidence/EvidenceAnchorResult.php
ahmido 77f499b60e feat: add evidence anchor reconciliation contracts and readiness fixes (#464)
Automated PR created by Codex via Gitea API.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #464
2026-06-21 09:39:14 +00:00

97 lines
3.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Services\Evidence;
final class EvidenceAnchorResult
{
public const string TYPE_CURRENT_SCOPE_EVIDENCE = 'CURRENT_SCOPE_EVIDENCE';
public const string TYPE_REVIEW_DRAFT_EVIDENCE = 'REVIEW_DRAFT_EVIDENCE';
public const string TYPE_REVIEW_RELEASED_EVIDENCE = 'REVIEW_RELEASED_EVIDENCE';
public const string TYPE_CUSTOMER_SAFE_EVIDENCE_SUMMARY = 'CUSTOMER_SAFE_EVIDENCE_SUMMARY';
public const string TYPE_TECHNICAL_EVIDENCE_DETAIL = 'TECHNICAL_EVIDENCE_DETAIL';
public const string TYPE_NO_VALID_EVIDENCE = 'NO_VALID_EVIDENCE';
public const string STATE_READY = 'Ready';
public const string STATE_NEEDS_ATTENTION = 'Needs attention';
public const string STATE_BLOCKED = 'Blocked';
public const string STATE_EXPIRED = 'Expired';
public const string STATE_NOT_CONFIGURED = 'Not configured';
public const string STATE_UNKNOWN = 'Unknown';
/**
* @param list<string> $blockingReasons
*/
public function __construct(
public readonly string $anchorType,
public readonly string $state,
public readonly ?int $evidenceSnapshotId,
public readonly ?string $targetRoute,
public readonly bool $isCurrent,
public readonly bool $isReleaseBound,
public readonly bool $isCustomerSafe,
public readonly bool $isTechnicalOnly,
public readonly bool $isPartial,
public readonly bool $isSuperseded,
public readonly bool $isExpired,
public readonly bool $canLink,
public readonly bool $canViewTechnicalDetail,
public readonly string $primaryReason,
public readonly array $blockingReasons,
public readonly string $displayLabel,
) {}
/**
* @return array{
* anchor_type:string,
* state:string,
* evidence_snapshot_id:int|null,
* target_route:string|null,
* is_current:bool,
* is_release_bound:bool,
* is_customer_safe:bool,
* is_technical_only:bool,
* is_partial:bool,
* is_superseded:bool,
* is_expired:bool,
* can_link:bool,
* can_view_technical_detail:bool,
* primary_reason:string,
* blocking_reasons:list<string>,
* display_label:string
* }
*/
public function toArray(): array
{
return [
'anchor_type' => $this->anchorType,
'state' => $this->state,
'evidence_snapshot_id' => $this->evidenceSnapshotId,
'target_route' => $this->targetRoute,
'is_current' => $this->isCurrent,
'is_release_bound' => $this->isReleaseBound,
'is_customer_safe' => $this->isCustomerSafe,
'is_technical_only' => $this->isTechnicalOnly,
'is_partial' => $this->isPartial,
'is_superseded' => $this->isSuperseded,
'is_expired' => $this->isExpired,
'can_link' => $this->canLink,
'can_view_technical_detail' => $this->canViewTechnicalDetail,
'primary_reason' => $this->primaryReason,
'blocking_reasons' => $this->blockingReasons,
'display_label' => $this->displayLabel,
];
}
}