2026-04-28 18:55:14 -05:00
|
|
|
using Data.SeaHavenIndustries;
|
2026-07-24 17:35:34 -03:00
|
|
|
using SeaHaven.DataServices.Dto;
|
|
|
|
|
using SeaHaven.DataServices.Models;
|
2026-04-28 18:55:14 -05:00
|
|
|
|
|
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IDispatchDataService
|
|
|
|
|
{
|
|
|
|
|
Task<Dispatch?> GetByIdAsync(int id);
|
|
|
|
|
Task<Dispatch?> GetByIdWithDetailsAsync(int id);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task<Dispatch?> GetByIdWithVendorAndWorkOrderAsync(int id);
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<IEnumerable<Dispatch>> GetAllAsync();
|
|
|
|
|
Task<IEnumerable<Dispatch>> GetByVendorIdAsync(int vendorId);
|
2026-05-14 11:00:12 -05:00
|
|
|
Task<IEnumerable<Dispatch>> GetByWorkOrderIdAsync(int workOrderId);
|
|
|
|
|
Task<IEnumerable<Dispatch>> GetByWorkOrderIdsAsync(IEnumerable<int> workOrderIds);
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<IEnumerable<Dispatch>> GetByStatusAsync(string status);
|
|
|
|
|
Task<(IEnumerable<Dispatch> Items, int TotalCount)> GetPagedAsync(int page, int pageSize, string? search = null, string? status = null);
|
|
|
|
|
Task<Dispatch> AddAsync(Dispatch dispatch);
|
|
|
|
|
Task UpdateAsync(Dispatch dispatch);
|
|
|
|
|
Task DeleteAsync(int id);
|
|
|
|
|
Task<bool> ExistsAsync(int id);
|
|
|
|
|
Task<string> GenerateNextDispatchNumberAsync();
|
2026-05-14 11:00:12 -05:00
|
|
|
Task<string> GenerateNextPONumberAsync();
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<int> CountAsync();
|
2026-05-14 11:00:12 -05:00
|
|
|
Task<IEnumerable<DispatchChecklistItem>> GetChecklistItemsAsync(int dispatchId);
|
|
|
|
|
Task<DispatchChecklistItem?> GetChecklistItemByIdAsync(int id);
|
|
|
|
|
Task AddChecklistItemAsync(DispatchChecklistItem item);
|
|
|
|
|
Task UpdateChecklistItemAsync(DispatchChecklistItem item);
|
|
|
|
|
Task<IEnumerable<DispatchSignoff>> GetSignoffsAsync(int dispatchId);
|
|
|
|
|
Task AddSignoffAsync(DispatchSignoff signoff);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task StageSignoffAsync(DispatchSignoff signoff, CancellationToken cancellationToken);
|
2026-05-14 11:00:12 -05:00
|
|
|
Task<bool> HasSignoffTypeAsync(int dispatchId, string signoffType);
|
|
|
|
|
Task<IEnumerable<DispatchWorkOrder>> GetDispatchWorkOrdersAsync(int dispatchId);
|
|
|
|
|
Task AddDispatchWorkOrderAsync(DispatchWorkOrder dispatchWorkOrder);
|
2026-07-24 17:35:34 -03:00
|
|
|
|
|
|
|
|
Task<DispatchListResult> GetListAsync(DispatchListQuery query, CancellationToken cancellationToken);
|
|
|
|
|
Task<DispatchDetailDTO?> GetDetailAsync(int id, CancellationToken cancellationToken);
|
|
|
|
|
Task<DispatchDetailReadModel?> GetDispatchDetailAsync(int id);
|
|
|
|
|
Task<IReadOnlyList<VendorDispatchSummaryData>> GetVendorDispatchSummariesAsync(
|
|
|
|
|
int vendorId, string? status, CancellationToken cancellationToken);
|
|
|
|
|
Task<Dispatch?> GetVendorDispatchDetailAsync(
|
|
|
|
|
int id, int vendorId, CancellationToken cancellationToken);
|
|
|
|
|
Task<Dispatch?> GetVendorDispatchForMutationAsync(
|
|
|
|
|
int id, int vendorId, CancellationToken cancellationToken);
|
|
|
|
|
Task<IReadOnlyList<PortalChecklistItemData>> GetPortalChecklistAsync(
|
|
|
|
|
int dispatchId, CancellationToken cancellationToken);
|
|
|
|
|
Task<IReadOnlyList<PortalSignoffData>> GetPortalSignoffsAsync(
|
|
|
|
|
int dispatchId, CancellationToken cancellationToken);
|
|
|
|
|
Task<DispatchChecklistItem?> GetChecklistItemForDispatchAsync(
|
|
|
|
|
int itemId, int dispatchId, CancellationToken cancellationToken);
|
|
|
|
|
Task StageAuditLogAsync(WorkOrderAuditLog log, CancellationToken cancellationToken);
|
|
|
|
|
Task<string?> GetDispatchDispatcherUserIdAsync(
|
|
|
|
|
int workOrderId, CancellationToken cancellationToken);
|
|
|
|
|
Task SaveChangesAsync(CancellationToken cancellationToken);
|
2026-04-28 18:55:14 -05:00
|
|
|
}
|
|
|
|
|
}
|