TenantAtlas/apps/platform/app/Support/ResolutionGuidance/ResolutionCase.php
Ahmed Darrazi a6ff903093
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 3m45s
feat: review output resolve actions v1 (spec 351)
Implemented the first version of review output resolve actions. Included a ReviewOutputResolveActionMapper, commands to seed browser fixtures, updated CustomerReviewWorkspace, EnvironmentReviewResource, UI enforcement, and related views. Also added extensive unit, feature, and browser tests, and updated the design coverage matrix.
2026-06-04 02:48:18 +02:00

113 lines
3.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\ResolutionGuidance;
final class ResolutionCase
{
/**
* @param array<string, int|string> $scope
* @param array{
* key:string,
* label:string,
* type:string,
* url:?string,
* icon:string,
* kind:string,
* action_name:?string,
* capability:?string,
* requires_confirmation:bool,
* audit_event:?string,
* operation_run_type:?string,
* disabled_reason:?string
* } $primaryAction
* @param list<array{
* key:string,
* label:string,
* type:string,
* url:?string,
* icon:string,
* kind:string,
* action_name:?string,
* capability:?string,
* requires_confirmation:bool,
* audit_event:?string,
* operation_run_type:?string,
* disabled_reason:?string
* }> $secondaryActions
* @param list<array{type:string,id:int|string}> $sourceRefs
* @param list<array{type:string,id:int|string}> $evidenceRefs
* @param array<string, string> $technicalDetails
* @return array{
* key:string,
* scope:array<string, int|string>,
* severity:string,
* status:string,
* title:string,
* reason:string,
* impact:string,
* primary_action:array{
* key:string,
* label:string,
* type:string,
* url:?string,
* icon:string,
* kind:string,
* action_name:?string,
* capability:?string,
* requires_confirmation:bool,
* audit_event:?string,
* operation_run_type:?string,
* disabled_reason:?string
* },
* secondary_actions:list<array{
* key:string,
* label:string,
* type:string,
* url:?string,
* icon:string,
* kind:string,
* action_name:?string,
* capability:?string,
* requires_confirmation:bool,
* audit_event:?string,
* operation_run_type:?string,
* disabled_reason:?string
* }>,
* source_refs:list<array{type:string,id:int|string}>,
* evidence_refs:list<array{type:string,id:int|string}>,
* technical_details:array<string, string>
* }
*/
public static function make(
string $key,
array $scope,
string $severity,
string $status,
string $title,
string $reason,
string $impact,
array $primaryAction,
array $secondaryActions = [],
array $sourceRefs = [],
array $evidenceRefs = [],
array $technicalDetails = [],
): array {
return [
'key' => $key,
'scope' => array_filter($scope, static fn (mixed $value): bool => $value !== ''),
'severity' => $severity,
'status' => $status,
'title' => $title,
'reason' => $reason,
'impact' => $impact,
'primary_action' => $primaryAction,
'secondary_actions' => array_values($secondaryActions),
'source_refs' => array_values($sourceRefs),
'evidence_refs' => array_values($evidenceRefs),
'technical_details' => $technicalDetails,
];
}
}