DD.WellWorkover.Cloud/AsbCloudApp/Services/IReportService.cs

74 lines
2.8 KiB
C#

using AsbCloudApp.Data;
using AsbCloudApp.Requests;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
/// <summary>
/// Сервис рапортов
/// </summary>
public interface IReportService
{
/// <summary>
/// Поставить рапорт в очередь на формирование
/// </summary>
/// <param name="idWell"></param>
/// <param name="idUser"></param>
/// <param name="request"></param>
/// <param name="handleReportProgress"></param>
/// <returns></returns>
string EnqueueCreateReportWork(int idWell, int idUser, ReportParametersRequest request,
Action<object, string> handleReportProgress);
/// <summary>
/// Создание отчета
/// </summary>
/// <param name="idWell"></param>
/// <param name="idUser"></param>
/// <param name="request"></param>
/// <param name="progressHandler"></param>
/// <param name="token"></param>
/// <returns></returns>
Task CreateReportAsync(int idWell, int idUser, ReportParametersRequest request, Action<object, string> progressHandler, CancellationToken token);
/// <summary>
/// Получить предполагаемый список страниц рапорта
/// </summary>
/// <param name="idWell"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <param name="stepSeconds"></param>
/// <param name="format"></param>
/// <returns></returns>
int GetReportPagesCount(int idWell, DateTime begin, DateTime end,
int stepSeconds, int format);
/// <summary>
/// получить диапазон дат за которые есть данные
/// </summary>
/// <param name="idWell"></param>
/// <returns></returns>
DatesRangeDto? GetDatesRangeOrDefault(int idWell);
/// <summary>
/// Список готовых рапортов
/// </summary>
/// <param name="idWell"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ReportPropertiesDto>> GetAllReportsByWellAsync(int idWell, CancellationToken token);
/// <summary>
/// Удаление отчетов, если превышен их период хранения
/// </summary>
/// <param name="lifetime">период хранения отчетов</param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> DeleteAllOldReportsAsync(TimeSpan lifetime, CancellationToken token);
}
}