98 lines
3.7 KiB
C#
98 lines
3.7 KiB
C#
using Persistence.Models;
|
||
using Persistence.Models.Requests;
|
||
|
||
namespace Persistence.Client.Clients.Interfaces;
|
||
|
||
/// <summary>
|
||
/// Клиент для работы с записями ChangeLog
|
||
/// </summary>
|
||
public interface IChangeLogClient : IDisposable
|
||
{
|
||
/// <summary>
|
||
/// Добавить одну запись
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dto"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Добавить несколько записей
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Импорт с заменой: удаление старых строк и добавление новых
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удалить одну запись
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> Delete(Guid id, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удалить несколько записей
|
||
/// </summary>
|
||
/// <param name="ids"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> DeleteRange(IEnumerable<Guid> ids, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Получение актуальных данных на определенную дату (с пагинацией)
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="moment"></param>
|
||
/// <param name="filterRequest"></param>
|
||
/// <param name="paginationRequest"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Получение исторических данных за определенный период времени
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dateBegin"></param>
|
||
/// <param name="dateEnd"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<DatesRangeDto?> GetDatesRange(Guid idDiscriminator, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Обновить одну запись
|
||
/// </summary>
|
||
/// <param name="dto"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> Update(DataWithWellDepthAndSectionDto dto, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Обновить несколько записей
|
||
/// </summary>
|
||
/// <param name="dtos"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> UpdateRange(IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
||
} |