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

113 lines
4.2 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Data.User;
using System.Collections.Generic;
2021-08-29 17:25:16 +05:00
using System.Threading;
using System.Threading.Tasks;
2024-08-19 10:01:07 +05:00
namespace AsbCloudApp.Services;
/// <summary>
/// Программа бурения
/// </summary>
public interface IDrillingProgramService
2021-08-29 17:25:16 +05:00
{
2022-08-05 17:52:42 +05:00
/// <summary>
2024-08-19 10:01:07 +05:00
/// Получить пользователей доступных для назначения в публикаторы или акцепторы
2022-08-05 17:52:42 +05:00
/// </summary>
2024-08-19 10:01:07 +05:00
/// <param name="idWell"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<UserDto>> GetAvailableUsers(int idWell, CancellationToken token = default);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Части программы бурения
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<FileCategoryDto>> GetCategoriesAsync(CancellationToken token = default);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Состояние программы бурения
/// </summary>
/// <param name="idWell"></param>
/// <param name="idUser"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<DrillingProgramStateDto> GetStateAsync(int idWell, int idUser,
CancellationToken token = default);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Загрузить файл
/// </summary>
/// <param name="idWell"></param>
/// <param name="idFileCategory"></param>
/// <param name="idUser"></param>
/// <param name="fileFullName"></param>
/// <param name="fileStream"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> AddFile(int idWell, int idFileCategory, int idUser, string fileFullName, System.IO.Stream fileStream, CancellationToken token = default);
/// <summary>
/// Добавить часть программы бурения
/// </summary>
/// <param name="idWell"></param>
/// <param name="idFileCategories"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> AddPartsAsync(int idWell, IEnumerable<int> idFileCategories, CancellationToken token = default);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Удалить часть программы бурения
/// </summary>
/// <param name="idWell"></param>
/// <param name="idFileCategories"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> RemovePartsAsync(int idWell, IEnumerable<int> idFileCategories, CancellationToken token = default);
/// <summary>
/// Назначить пользователю роль
/// </summary>
/// <param name="idWell"></param>
/// <param name="idFileCategory"></param>
/// <param name="idUser"></param>
/// <param name="idUserRole"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> AddUserAsync(int idWell, int idFileCategory, int idUser, int idUserRole, CancellationToken token = default);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Удалить пользователя
/// </summary>
/// <param name="idWell"></param>
/// <param name="idFileCategory"></param>
/// <param name="idUser"></param>
/// <param name="idUserRole"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> RemoveUserAsync(int idWell, int idFileCategory, int idUser, int idUserRole, CancellationToken token = default);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Добавить или изменить отметку для файла (согласование/отклонение)
/// </summary>
/// <param name="fileMarkDto"></param>
/// <param name="idUser"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> AddOrReplaceFileMarkAsync(FileMarkDto fileMarkDto, int idUser, CancellationToken token);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Удалить отметку с файла
/// </summary>
/// <param name="idFileMark"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> MarkAsDeletedFileMarkAsync(int idFileMark, CancellationToken token);
2022-08-05 17:52:42 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Сбросить ошибку формирования
/// </summary>
/// <param name="idWell"></param>
void ClearError(int idWell);
2021-08-29 17:25:16 +05:00
}