<?php

declare(strict_types=1);

namespace App\Support\Ai;

use App\Support\Audit\AuditActionId;

final readonly class AiExecutionDecision
{
    /**
     * @param  list<string>  $dataClassifications
     * @param  array<string, mixed>  $auditMetadata
     */
    public function __construct(
        public string $outcome,
        public AiDecisionReasonCode $reasonCode,
        public string $workspaceAiPolicyMode,
        public ?string $matchedOperationalControlScope,
        public string $useCaseKey,
        public string $requestedProviderClass,
        public array $dataClassifications,
        public string $sourceFamily,
        public AuditActionId $auditAction,
        public array $auditMetadata,
    ) {}

    public function isAllowed(): bool
    {
        return $this->outcome === 'allowed';
    }

    public function isBlocked(): bool
    {
        return $this->outcome === 'blocked';
    }
}