<?php

namespace ReallySimplePlugins\RSS\Core\Features\Vulnerability\Interfaces;

use ReallySimplePlugins\RSS\Core\Features\Vulnerability\Dtos\VulnerabilitySnapshotDto;

/**
 * Defines the decision contract for sending vulnerability notification emails.
 *
 * Implementations encapsulate notification policy rules without performing delivery.
 */
interface VulnerabilityNotificationPolicyInterface
{
    /**
     * Determines whether a notification should be sent for the current snapshot.
     */
    public function shouldSend(VulnerabilitySnapshotDto $current, ?VulnerabilitySnapshotDto $previous): bool;

    /**
     * Determines whether notifications may be sent in the current execution context.
     */
    public function canSend(): bool;

    /**
     * Returns the reason for the last send decision, intended for logging or debugging.
     *
     * @return non-empty-string
     */
    public function getReason(): string;
}
