<?php

declare(strict_types=1);

namespace App\Services;

/** DIAR workflow separation-of-duties guard backed by DiarAccessPolicy. */
final class DiarWorkflowAuthorization
{
    /** @return array<int,string> */
    public function roleCodes(): array
    {
        return (new DiarAccessPolicy())->roleCodes();
    }

    public function canAssign(): bool
    {
        return (new DiarAccessPolicy())->canPerform('assign');
    }

    /** @param array<string,mixed> $case */
    public function canReview(array $case): bool
    {
        return (new DiarAccessPolicy())->canPerform('review', $case);
    }

    /** @param array<string,mixed> $case */
    public function canRecordEvidence(array $case): bool
    {
        return (new DiarAccessPolicy())->canPerform('evidence', $case);
    }

    /** @param array<string,mixed> $case */
    public function canRequestInformation(array $case): bool
    {
        return (new DiarAccessPolicy())->canPerform('request_information', $case);
    }

    /** @param array<string,mixed> $case */
    public function canProposeFinding(array $case): bool
    {
        return (new DiarAccessPolicy())->canPerform('propose_finding', $case);
    }

    public function canSupervisorReview(): bool
    {
        return (new DiarAccessPolicy())->canPerform('supervisor_review');
    }

    public function canManagementApprove(): bool
    {
        return (new DiarAccessPolicy())->canPerform('management_approve');
    }

    public function canManageCorrectiveActions(): bool
    {
        return (new DiarAccessPolicy())->canPerform('corrective_action');
    }

    public function canClose(): bool
    {
        return (new DiarAccessPolicy())->canPerform('close');
    }

    public function canReopen(): bool
    {
        return (new DiarAccessPolicy())->canPerform('reopen');
    }
}
