Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 59s
Implemented the first version of the operator resolution guidance framework. Added new foundation classes (ResolutionCase, ResolutionAction) and a ReviewPackOutputResolutionAdapter. Updated the Customer Review Workspace and Environment Review Resource to use the new adapter. Added extensive test coverage for the framework and UI integrations.
109 lines
3.1 KiB
PHP
109 lines
3.1 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,
|
|
* 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,
|
|
* 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,
|
|
* 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,
|
|
* 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,
|
|
];
|
|
}
|
|
}
|