using ScadaLink.Commons.Entities.Notifications;

namespace ScadaLink.Commons.Interfaces.Repositories;

public interface INotificationRepository
{
    // NotificationList
    Task<NotificationList?> GetNotificationListByIdAsync(int id, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<NotificationList>> GetAllNotificationListsAsync(CancellationToken cancellationToken = default);
    Task<NotificationList?> GetListByNameAsync(string name, CancellationToken cancellationToken = default);
    Task AddNotificationListAsync(NotificationList list, CancellationToken cancellationToken = default);
    Task UpdateNotificationListAsync(NotificationList list, CancellationToken cancellationToken = default);
    Task DeleteNotificationListAsync(int id, CancellationToken cancellationToken = default);

    // NotificationRecipient
    Task<NotificationRecipient?> GetRecipientByIdAsync(int id, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<NotificationRecipient>> GetRecipientsByListIdAsync(int notificationListId, CancellationToken cancellationToken = default);
    Task AddRecipientAsync(NotificationRecipient recipient, CancellationToken cancellationToken = default);
    Task UpdateRecipientAsync(NotificationRecipient recipient, CancellationToken cancellationToken = default);
    Task DeleteRecipientAsync(int id, CancellationToken cancellationToken = default);

    // SmtpConfiguration
    Task<SmtpConfiguration?> GetSmtpConfigurationByIdAsync(int id, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<SmtpConfiguration>> GetAllSmtpConfigurationsAsync(CancellationToken cancellationToken = default);
    Task AddSmtpConfigurationAsync(SmtpConfiguration configuration, CancellationToken cancellationToken = default);
    Task UpdateSmtpConfigurationAsync(SmtpConfiguration configuration, CancellationToken cancellationToken = default);
    Task DeleteSmtpConfigurationAsync(int id, CancellationToken cancellationToken = default);

    Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
}
