persistence/DD.Persistence/API/IChangeLogApi.cs

110 lines
4.7 KiB
C#
Raw Normal View History

using Microsoft.AspNetCore.Mvc;
using DD.Persistence.Models;
using DD.Persistence.Models.Requests;
2024-11-08 18:24:52 +05:00
namespace DD.Persistence.API;
2024-11-08 18:24:52 +05:00
/// <summary>
/// Интерфейс для работы с API журнала изменений
2024-11-08 18:24:52 +05:00
/// </summary>
public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndSectionDto>
2024-11-08 18:24:52 +05:00
{
/// <summary>
/// Импорт с заменой: удаление старых строк и добавление новых
2024-11-08 18:24:52 +05:00
/// </summary>
2024-11-27 17:59:37 +05:00
/// <param name="idDiscriminator"></param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Получение данных на текущую дату (с пагинацией)
/// </summary>
/// <param name="idDiscriminator"></param>
/// <param name="filterRequest">параметры запроса фильтрации</param>
/// <param name="paginationRequest">параметры запроса пагинации</param>
2024-11-08 18:24:52 +05:00
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> GetCurrent(Guid idDiscriminator, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Получение данных на определенную дату (с пагинацией)
2024-11-08 18:24:52 +05:00
/// </summary>
2024-11-27 17:59:37 +05:00
/// <param name="idDiscriminator"></param>
/// <param name="moment"></param>
/// <param name="filterRequest">параметры запроса фильтрации</param>
/// <param name="paginationRequest">параметры запроса пагинации</param>
2024-11-08 18:24:52 +05:00
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
2024-11-27 17:59:37 +05:00
/// <summary>
/// Получение исторических данных за определенный период времени
/// </summary>
/// <param name="idDiscriminator"></param>
/// <param name="dateBegin"></param>
/// <param name="dateEnd"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-29 10:03:52 +05:00
Task<IActionResult> GetChangeLogForDate(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Добавить одну запись
/// </summary>
2024-11-27 17:59:37 +05:00
/// <param name="idDiscriminator"></param>
2024-11-08 18:24:52 +05:00
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-29 10:03:52 +05:00
Task<IActionResult> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Добавить несколько записей
/// </summary>
2024-11-27 17:59:37 +05:00
/// <param name="idDiscriminator"></param>
2024-11-08 18:24:52 +05:00
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-29 10:03:52 +05:00
Task<IActionResult> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Обновить одну запись
/// </summary>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> Update(DataWithWellDepthAndSectionDto dto, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Обновить несколько записей
/// </summary>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> UpdateRange(IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Удалить одну запись
/// </summary>
/// <param name="id"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-29 10:03:52 +05:00
Task<IActionResult> Delete(Guid id, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Удалить несколько записей
/// </summary>
/// <param name="ids"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-29 10:03:52 +05:00
Task<IActionResult> DeleteRange(IEnumerable<Guid> ids, CancellationToken token);
/// <summary>
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
/// </summary>
/// <param name="idDiscriminator"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-29 10:03:52 +05:00
Task<IActionResult> GetDatesChange(Guid idDiscriminator, CancellationToken token);
2024-11-08 18:24:52 +05:00
}