DD.WellWorkover.Cloud/AsbCloudApp/Repositories/INotificationRepository.cs

62 lines
2.1 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using AsbCloudApp.Data;
using AsbCloudApp.Requests;
using AsbCloudApp.Services;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Repositories;
/// <summary>
/// Репозиторий для уведомлений
/// </summary>
public interface INotificationRepository : ICrudRepository<NotificationDto>
{
/// <summary>
/// Получение уведомлений по параметрам
/// </summary>
/// <param name="idUser"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<PaginationContainer<NotificationDto>> GetNotificationsAsync(int idUser,
NotificationRequest request,
CancellationToken cancellationToken);
/// <summary>
/// Получение всех уведомлений
/// </summary>
/// <param name="idUser"></param>
/// <param name="isSent"></param>
/// <param name="idTransportType"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IEnumerable<NotificationDto>> GetAllAsync(int? idUser, bool? isSent, int? idTransportType,
CancellationToken cancellationToken);
/// <summary>
/// Обновление уведомлений
/// </summary>
/// <param name="notifications"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> UpdateRangeAsync(IEnumerable<NotificationDto> notifications, CancellationToken cancellationToken);
/// <summary>
/// Удаление уведомлений по параметрам
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> DeleteAsync(NotificationDeleteRequest request,
CancellationToken cancellationToken);
/// <summary>
/// Получение количества непрочтенных уведомлений
/// </summary>
/// <param name="idUser"></param>
/// <param name="idTransportType"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> GetUnreadCountAsync(int idUser, int idTransportType, CancellationToken cancellationToken);
}