2024-01-26 17:23:21 +05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2024-01-19 17:48:45 +05:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using AsbCloudApp.Data;
|
2024-01-26 17:23:21 +05:00
|
|
|
|
using AsbCloudApp.Requests;
|
2024-01-19 17:48:45 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Repositories;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Репозиторий для записей с историей
|
|
|
|
|
/// </summary>
|
2024-01-26 17:23:21 +05:00
|
|
|
|
public interface IChangeLogRepository<TDto, TRequest>
|
|
|
|
|
where TDto : ChangeLogAbstract
|
|
|
|
|
where TRequest : ChangeLogBaseRequest
|
2024-01-19 17:48:45 +05:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавление записей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idUser"></param>
|
|
|
|
|
/// <param name="dtos"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-01-26 17:23:21 +05:00
|
|
|
|
Task<int> InsertRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token);
|
2024-01-19 17:48:45 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Редактирование записей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idUser"></param>
|
|
|
|
|
/// <param name="dtos"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-01-26 17:23:21 +05:00
|
|
|
|
Task<int> UpdateRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавление записей с удалением старых (для импорта)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idUser"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> Clear(int idUser, TRequest request, CancellationToken token);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Удаление записей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idUser"></param>
|
|
|
|
|
/// <param name="ids"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> DeleteRange(int idUser, IEnumerable<int> ids, CancellationToken token);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение дат изменений записей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<IEnumerable<DateOnly>> GetDatesChange(TRequest request, CancellationToken token);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение журнала изменений
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="date"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<IEnumerable<TDto>> GetChangeLog(TRequest request, DateOnly? date, CancellationToken token);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение записей по параметрам
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<IEnumerable<TDto>> Get(TRequest request, CancellationToken token);
|
2024-01-19 17:48:45 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|