2024-12-16 15:38:46 +05:00
|
|
|
|
using DD.Persistence.Models;
|
2025-01-13 17:45:49 +05:00
|
|
|
|
using DD.Persistence.Models.Common;
|
2024-12-16 15:38:46 +05:00
|
|
|
|
using DD.Persistence.Models.Requests;
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
2024-12-16 15:38:46 +05:00
|
|
|
|
namespace DD.Persistence.Client.Clients.Interfaces;
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Клиент для работы с записями ChangeLog
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IChangeLogClient : IDisposable
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавить одну запись
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-12-11 14:56:31 +05:00
|
|
|
|
Task<int> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавить несколько записей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="dtos"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-12-11 14:56:31 +05:00
|
|
|
|
Task<int> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Импорт с заменой: удаление старых строк и добавление новых
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="dtos"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-12-11 14:56:31 +05:00
|
|
|
|
Task<int> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <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>
|
2024-12-11 14:56:31 +05:00
|
|
|
|
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение исторических данных за определенный период времени
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="dateBegin"></param>
|
|
|
|
|
/// <param name="dateEnd"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-12-11 14:56:31 +05:00
|
|
|
|
Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-12-11 14:56:31 +05:00
|
|
|
|
Task<DatesRangeDto?> GetDatesRange(Guid idDiscriminator, CancellationToken token);
|
2024-12-10 13:55:01 +05:00
|
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
}
|