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

126 lines
4.8 KiB
C#
Raw Normal View History

2021-09-10 11:28:57 +05:00
using AsbCloudApp.Data;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
2022-08-09 11:10:01 +05:00
/// <summary>
/// сервис операций по скважине
/// </summary>
public interface IWellOperationService
{
2022-08-09 11:10:01 +05:00
/// <summary>
/// список названий операций
/// </summary>
/// <returns></returns>
IEnumerable<WellOperationCategoryDto> GetCategories();
2022-08-09 11:10:01 +05:00
// TODO: объединить параметры в объект запроса
/// <summary>
/// Получить список операций
/// </summary>
/// <param name="idWell"></param>
/// <param name="operationType"></param>
/// <param name="sectionTypeIds"></param>
/// <param name="operationCategoryIds"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <param name="minDepth"></param>
/// <param name="maxDepth"></param>
/// <param name="skip"></param>
/// <param name="take"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<PaginationContainer<WellOperationDto>> GetOperationsAsync(
int idWell,
int? operationType = null,
2022-12-07 09:02:04 +05:00
IEnumerable<int> sectionTypeIds = null,
IEnumerable<int> operationCategoryIds = null,
DateTime begin = default,
DateTime end = default,
double minDepth = double.MinValue,
double maxDepth = double.MaxValue,
int skip = 0,
int take = 32,
CancellationToken token = default);
/// <summary>
/// Получить статистику операции по скважине с группировкой по категориям
/// </summary>
/// <param name="idWell"></param>
/// <param name="operationType"></param>
/// <param name="sectionTypeIds"></param>
/// <param name="operationCategoryIds"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <param name="minDepth"></param>
/// <param name="maxDepth"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<WellGroupOpertionDto>> GetGroupOperationsStatAsync(
int idWell,
int? operationType = null,
2022-12-07 09:02:04 +05:00
IEnumerable<int> sectionTypeIds = null,
IEnumerable<int> operationCategoryIds = null,
DateTime begin = default,
DateTime end = default,
double minDepth = double.MinValue,
double maxDepth = double.MaxValue,
CancellationToken token = default);
2022-08-09 11:10:01 +05:00
/// <summary>
/// Получить операцию по id
/// </summary>
/// <param name="id"></param>
/// <param name="token"></param>
/// <returns></returns>
2022-12-07 09:02:04 +05:00
Task<WellOperationDto> GetOrDefaultAsync(int id, CancellationToken token);
2022-08-09 11:10:01 +05:00
//todo: idWell Не нужен
/// <summary>
/// Добавить несколько операций за один раз
/// </summary>
/// <param name="idWell"></param>
/// <param name="wellOperationDtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> InsertRangeAsync(int idWell,
IEnumerable<WellOperationDto> wellOperationDtos, CancellationToken token);
2022-08-09 11:10:01 +05:00
//todo: id Не нужны
/// <summary>
/// Обновить существующую операцию
/// </summary>
/// <param name="idWell"></param>
/// <param name="idOperation"></param>
/// <param name="item"></param>
/// <param name="token"></param>
/// <returns></returns>
2021-09-10 11:28:57 +05:00
Task<int> UpdateAsync(int idWell, int idOperation, WellOperationDto item,
CancellationToken token);
2022-08-09 11:10:01 +05:00
/// <summary>
/// Удалить операции по id
/// </summary>
/// <param name="ids"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> DeleteAsync(IEnumerable<int> ids, CancellationToken token);
2022-08-09 11:10:01 +05:00
/// <summary>
/// Список секций
/// </summary>
/// <returns></returns>
IDictionary<int, string> GetSectionTypes();
2022-08-09 11:10:01 +05:00
/// <summary>
/// дата/время первой операции по скважине
/// </summary>
/// <param name="idWell"></param>
/// <returns></returns>
2022-05-06 16:35:16 +05:00
DateTimeOffset? FirstOperationDate(int idWell);
}
}