forked from ddrilling/AsbCloudServer
102 lines
3.7 KiB
C#
102 lines
3.7 KiB
C#
using AsbCloudApp.Data;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace AsbCloudApp.Services
|
||
{
|
||
/// <summary>
|
||
/// сервис операций по скважине
|
||
/// </summary>
|
||
public interface IWellOperationService
|
||
{
|
||
/// <summary>
|
||
/// список названий операций
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
IEnumerable<WellOperationCategoryDto> GetCategories();
|
||
|
||
// 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,
|
||
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>
|
||
/// Получить операцию по id
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<WellOperationDto> GetAsync(int id, CancellationToken token);
|
||
|
||
//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);
|
||
|
||
//todo: id Не нужны
|
||
/// <summary>
|
||
/// Обновить существующую операцию
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idOperation"></param>
|
||
/// <param name="item"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> UpdateAsync(int idWell, int idOperation, WellOperationDto item,
|
||
CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удалить операции по id
|
||
/// </summary>
|
||
/// <param name="ids"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> DeleteAsync(IEnumerable<int> ids, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Список секций
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
IDictionary<int, string> GetSectionTypes();
|
||
|
||
/// <summary>
|
||
/// дата/время первой операции по скважине
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <returns></returns>
|
||
DateTimeOffset? FirstOperationDate(int idWell);
|
||
}
|
||
}
|