2024-10-31 17:02:48 +05:00
|
|
|
|
using Persistence.Models;
|
2024-11-28 16:29:00 +05:00
|
|
|
|
using Persistence.Models.Requests;
|
2024-10-31 17:02:48 +05:00
|
|
|
|
|
|
|
|
|
namespace Persistence.Repositories;
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-02 12:05:12 +05:00
|
|
|
|
/// Интерфейс для работы с историческими данными
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-10-31 17:02:48 +05:00
|
|
|
|
/// <typeparam name="TDto"></typeparam>
|
2024-11-29 11:52:47 +05:00
|
|
|
|
public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWithWellDepthAndSectionDto>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавление записей
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idUser">пользователь, который добавляет</param>
|
2024-11-26 11:47:42 +05:00
|
|
|
|
/// <param name="idDiscriminator">ключ справочника</param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="dtos"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
Task<int> InsertRange(Guid idUser, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// Пометить записи как удаленные
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// <param name="idUser"></param>
|
|
|
|
|
/// <param name="ids">ключи записей</param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
Task<int> MarkAsDeleted(Guid idUser, IEnumerable<Guid> ids, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// Пометить записи как удаленные
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
/// <param name="idUser"></param>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// <param name="idDiscriminator">дискриминатор таблицы</param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
Task<int> MarkAsDeleted(Guid idUser, Guid idDiscriminator, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Очистить и добавить новые
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idUser"></param>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
/// <param name="idDiscriminator"></param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="dtos"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
Task<int> ClearAndInsertRange(Guid idUser, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// Редактирование записей
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// <param name="idUser">пользователь, который редактирует</param>
|
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="dtos"></param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
Task<int> UpdateRange(Guid idUser, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// Получение актуальных записей на определенный момент времени (с пагинацией)
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="moment">текущий момент времени</param>
|
|
|
|
|
/// <param name="request">параметры запроса</param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest request, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
/// Получение измененных записей за период времени
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
/// <param name="idDiscriminator"></param>
|
|
|
|
|
/// <param name="dateBegin"></param>
|
|
|
|
|
/// <param name="dateEnd"></param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
Task<IEnumerable<ChangeLogDto>> GetChangeLogForDate(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// </summary>
|
2024-11-27 17:59:37 +05:00
|
|
|
|
/// <param name="idDiscriminator"></param>
|
2024-10-31 15:01:12 +05:00
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-28 16:29:00 +05:00
|
|
|
|
Task<IEnumerable<DateOnly>> GetDatesChange(Guid idDiscriminator, CancellationToken token);
|
2024-10-31 15:01:12 +05:00
|
|
|
|
}
|