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. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #422
113 lines
3.2 KiB
PHP
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,
|
|
];
|
|
}
|
|
}
|