2023-08-04 09:47:22 +05:00
|
|
|
using System.Collections.Generic;
|
2023-07-10 16:56:55 +05:00
|
|
|
using AsbCloudApp.Data;
|
2023-07-11 18:57:25 +05:00
|
|
|
using AsbCloudApp.Requests;
|
2023-07-10 16:56:55 +05:00
|
|
|
using AsbCloudApp.Services;
|
2023-07-28 11:37:27 +05:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2023-07-10 16:56:55 +05:00
|
|
|
|
|
|
|
namespace AsbCloudApp.Repositories;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Репозиторий для уведомлений
|
|
|
|
/// </summary>
|
|
|
|
public interface INotificationRepository : ICrudRepository<NotificationDto>
|
|
|
|
{
|
2024-07-04 11:02:45 +05:00
|
|
|
/// <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);
|
2023-07-27 17:33:20 +05:00
|
|
|
|
2024-07-04 11:02:45 +05:00
|
|
|
/// <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);
|
2023-08-04 09:47:22 +05:00
|
|
|
|
2024-07-04 11:02:45 +05:00
|
|
|
/// <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);
|
2023-07-28 11:37:27 +05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Получение количества непрочтенных уведомлений
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="idUser"></param>
|
2024-07-04 11:02:45 +05:00
|
|
|
/// <param name="idTransportType"></param>
|
2023-07-28 11:37:27 +05:00
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
/// <returns></returns>
|
2023-07-31 17:55:49 +05:00
|
|
|
Task<int> GetUnreadCountAsync(int idUser, int idTransportType, CancellationToken cancellationToken);
|
2023-07-10 16:56:55 +05:00
|
|
|
}
|