using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;

namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery;

/// <summary>
/// Channel-specific delivery strategy for outbox notifications. Each adapter handles
/// a single <see cref="NotificationType"/>; the outbox dispatcher selects the adapter
/// matching a notification's type.
/// </summary>
public interface INotificationDeliveryAdapter
{
    /// <summary>The notification channel this adapter delivers.</summary>
    NotificationType Type { get; }

    /// <summary>
    /// Attempts delivery of the given notification and reports the classified outcome.
    /// </summary>
    /// <param name="notification">The notification to deliver.</param>
    /// <param name="cancellationToken">Token used to cancel the delivery attempt.</param>
    /// <returns>The outcome of the delivery attempt.</returns>
    Task<DeliveryOutcome> DeliverAsync(Notification notification, CancellationToken cancellationToken = default);
}
