2026-08-11 10:45:37 -03:00
|
|
|
using System.Security.Claims;
|
2026-07-24 17:35:34 -03:00
|
|
|
using Data.SeaHavenIndustries;
|
|
|
|
|
using Data.SeaHavenIndustries.Enums;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using SeaHaven.DataServices.Models;
|
2026-04-28 18:55:14 -05:00
|
|
|
using SeaHaven.Services.DTOs;
|
|
|
|
|
|
|
|
|
|
namespace SeaHaven.Services.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IWorkOrderService
|
|
|
|
|
{
|
|
|
|
|
Task<WorkOrderDTO?> GetWorkOrderByIdAsync(int id);
|
|
|
|
|
Task<WorkOrderDTO?> GetWorkOrderByIdWithDetailsAsync(int id);
|
|
|
|
|
Task<IEnumerable<WorkOrderDTO>> GetAllWorkOrdersAsync();
|
|
|
|
|
Task<PagedResult<WorkOrderDTO>> GetWorkOrdersPagedAsync(int page, int pageSize, string? search = null, string? status = null, string? priority = null);
|
2026-08-11 10:45:37 -03:00
|
|
|
Task<int> CreateWorkOrderAsync(CreateWorkOrderDTO dto, ClaimsPrincipal user, string userId);
|
2026-05-14 11:00:12 -05:00
|
|
|
Task<bool> UpdateWorkOrderAsync(int id, UpdateWorkOrderDTO dto, string userId);
|
|
|
|
|
Task<bool> DeleteWorkOrderAsync(int id, string userId);
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<bool> WorkOrderExistsAsync(int id);
|
|
|
|
|
Task<string> GenerateNextInternalWONumberAsync();
|
|
|
|
|
Task<int> GetTotalWorkOrderCountAsync();
|
2026-07-24 17:35:34 -03:00
|
|
|
|
|
|
|
|
Task<(IEnumerable<WorkOrderListItemReadModel> Items, int TotalCount)> GetWorkOrderListPagedAsync(
|
|
|
|
|
int page, int pageSize, string? search, string? status, string? assignee,
|
2026-08-11 10:45:37 -03:00
|
|
|
int? locationId, string? sortBy, string? sortDir, int? accountId = null);
|
2026-08-11 11:57:37 -03:00
|
|
|
Task<WorkOrderDetailReadModel?> GetWorkOrderDetailAsync(int id, int? accountId = null);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task<FilteredWorkOrderPageDTO> GetFilteredWorkOrdersAsync(
|
|
|
|
|
string[] assignto, int[]? location, string[]? priority,
|
2026-08-11 11:57:37 -03:00
|
|
|
string[]? status, string[]? duedate, string search, string sort, string sortby, int page, int pageSize,
|
|
|
|
|
int? accountId = null);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task<FilteredWorkOrderPageDTO> GetFilteredWorkOrders2Async(
|
|
|
|
|
string[] assignto, int[]? location, string[]? priority,
|
2026-08-11 11:57:37 -03:00
|
|
|
string[]? status, string[]? duedate, string search, string sort, string sortby, int page, int pageSize,
|
|
|
|
|
int? accountId = null);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task<WorkOrderDTO?> ChangeStatusAsync(int id, string status, string userId);
|
|
|
|
|
Task<ChangeAssignmentResult?> ChangeAssignmentAsync(int id, string? assignTo, string userId);
|
2026-08-11 10:45:37 -03:00
|
|
|
Task<int> CreateWorkOrderWithDetailsAsync(CreateWorkOrderWithDetailsInput input, ClaimsPrincipal user, string userId);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task<bool> UpdateWorkOrderWithDetailsAsync(UpdateWorkOrderWithDetailsInput input, string userId);
|
|
|
|
|
Task<bool> DeleteWorkOrderCascadeAsync(int id, string userId);
|
2026-08-11 14:52:02 -03:00
|
|
|
Task<Comments> AddCommentAsync(AddCommentInput input, ClaimsPrincipal user, string userId);
|
|
|
|
|
Task<CommentResult> AddCommentJsonAsync(AddCommentInput input, ClaimsPrincipal user, string userId);
|
2026-08-11 15:18:29 -03:00
|
|
|
Task<IEnumerable<CommentListItemReadModel>> GetCommentsAsync(ClaimsPrincipal user);
|
2026-08-11 14:52:02 -03:00
|
|
|
Task<IEnumerable<CommentListItemReadModel>?> GetCommentsByWorkorderIdAsync(int woid, ClaimsPrincipal user);
|
2026-08-11 11:57:37 -03:00
|
|
|
Task<IEnumerable<WorkOrder>> GetWorkordersDDAsync(int? accountId = null);
|
|
|
|
|
Task<IEnumerable<WorkorderFilterVM>> GetWorkordersAsync(int? accountId = null);
|
2026-04-28 18:55:14 -05:00
|
|
|
}
|
|
|
|
|
}
|