<?php

namespace NoahVet\Reef\Domain\Security\Port;

/**
 * Outbound port: reads existing policy result etags from the IAM.
 * Used to determine whether a sync is needed before publishing.
 */
interface PolicyResultStoreInterface
{
    /**
     * Returns the etag stored in the IAM for a single subject, or null if not found.
     */
    public function findEtag(string $policyName, string $subjectIdentifier): ?string;

    /**
     * Returns a map of subjectIdentifier => etag for a batch of subjects.
     * Missing subjects are simply absent from the result.
     *
     * @param string[] $subjectIdentifiers
     *
     * @return array<string, string>
     */
    public function findEtags(string $policyName, array $subjectIdentifiers): array;
}
