<?php

declare(strict_types=1);

namespace App\Framework\Notification\Dispatcher;

/**
 * Dispatch Strategy
 *
 * Defines how notifications should be dispatched across multiple channels
 */
enum DispatchStrategy: string
{
    /**
     * Send to ALL channels, regardless of success/failure
     * Continues even if some channels fail
     */
    case ALL = 'all';

    /**
     * Send to channels until first SUCCESS
     * Stops after first successful delivery
     */
    case FIRST_SUCCESS = 'first_success';

    /**
     * FALLBACK strategy - try channels in order
     * Only tries next channel if previous failed
     * Use case: Telegram -> Email -> SMS fallback chain
     */
    case FALLBACK = 'fallback';

    /**
     * Send to ALL channels, stop on FIRST FAILURE
     * All channels must succeed, or entire dispatch fails
     */
    case ALL_OR_NONE = 'all_or_none';
}
