1eb6e972b0
Bulk CommentChecker pass: fills in <param>/<inheritdoc> tags on public APIs across all 23 src/ projects so the doc-coverage gate is green. Also adds a Sister Projects section to CLAUDE.md pointing at the MxAccess Gateway and OtOpcUa sibling repos, and gitignores local credential captures (*login*.txt) and the wonder-app-vd03 deploy/ artifacts.
100 lines
5.6 KiB
C#
100 lines
5.6 KiB
C#
using ScadaLink.Commons.Entities.Notifications;
|
|
|
|
namespace ScadaLink.Commons.Interfaces.Repositories;
|
|
|
|
public interface INotificationRepository
|
|
{
|
|
// NotificationList
|
|
/// <summary>Gets a notification list by ID.</summary>
|
|
/// <param name="id">The notification list ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>The notification list, or null if not found.</returns>
|
|
Task<NotificationList?> GetNotificationListByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Gets all notification lists.</summary>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>A read-only list of notification lists.</returns>
|
|
Task<IReadOnlyList<NotificationList>> GetAllNotificationListsAsync(CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Gets a notification list by name.</summary>
|
|
/// <param name="name">The notification list name.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>The notification list, or null if not found.</returns>
|
|
Task<NotificationList?> GetListByNameAsync(string name, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Adds a new notification list.</summary>
|
|
/// <param name="list">The notification list to add.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task AddNotificationListAsync(NotificationList list, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Updates an existing notification list.</summary>
|
|
/// <param name="list">The notification list to update.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task UpdateNotificationListAsync(NotificationList list, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Deletes a notification list by ID.</summary>
|
|
/// <param name="id">The notification list ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task DeleteNotificationListAsync(int id, CancellationToken cancellationToken = default);
|
|
|
|
// NotificationRecipient
|
|
/// <summary>Gets a notification recipient by ID.</summary>
|
|
/// <param name="id">The recipient ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>The notification recipient, or null if not found.</returns>
|
|
Task<NotificationRecipient?> GetRecipientByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Gets all recipients in a notification list.</summary>
|
|
/// <param name="notificationListId">The notification list ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>A read-only list of recipients.</returns>
|
|
Task<IReadOnlyList<NotificationRecipient>> GetRecipientsByListIdAsync(int notificationListId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Adds a new notification recipient.</summary>
|
|
/// <param name="recipient">The recipient to add.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task AddRecipientAsync(NotificationRecipient recipient, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Updates an existing notification recipient.</summary>
|
|
/// <param name="recipient">The recipient to update.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task UpdateRecipientAsync(NotificationRecipient recipient, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Deletes a notification recipient by ID.</summary>
|
|
/// <param name="id">The recipient ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task DeleteRecipientAsync(int id, CancellationToken cancellationToken = default);
|
|
|
|
// SmtpConfiguration
|
|
/// <summary>Gets an SMTP configuration by ID.</summary>
|
|
/// <param name="id">The SMTP configuration ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>The SMTP configuration, or null if not found.</returns>
|
|
Task<SmtpConfiguration?> GetSmtpConfigurationByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Gets all SMTP configurations.</summary>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>A read-only list of SMTP configurations.</returns>
|
|
Task<IReadOnlyList<SmtpConfiguration>> GetAllSmtpConfigurationsAsync(CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Adds a new SMTP configuration.</summary>
|
|
/// <param name="configuration">The SMTP configuration to add.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task AddSmtpConfigurationAsync(SmtpConfiguration configuration, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Updates an existing SMTP configuration.</summary>
|
|
/// <param name="configuration">The SMTP configuration to update.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task UpdateSmtpConfigurationAsync(SmtpConfiguration configuration, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Deletes an SMTP configuration by ID.</summary>
|
|
/// <param name="id">The SMTP configuration ID.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task DeleteSmtpConfigurationAsync(int id, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>Saves pending changes to the repository.</summary>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>The number of entities saved.</returns>
|
|
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
|
|
}
|