shoc-backend/SeaHaven.DataServices/Interfaces/IVendorOperationsDataService.cs
Alexandre Brandizzi da0b29f769 feat(notifications): serve the Notification Center feed grouped by reason
Adds GET /api/notifications, a per-user read model derived from live
work-order state: Unassigned (grouped, High), No Vendor and Aveta Missing
(per work order, Medium) and Vendor Conflict, account-scoped from claims
and ordered by section severity with a fixed reason tie-break.
2026-09-18 12:40:37 -03:00

35 lines
2.9 KiB
C#

using Data.SeaHavenIndustries;
using SeaHaven.DataServices.Models;
namespace SeaHaven.DataServices.Interfaces
{
public interface IVendorOperationsDataService
{
Task<IReadOnlyList<int>> GetAssignedWorkOrderIdsAsync(CancellationToken cancellationToken);
Task<IReadOnlyList<NoVendorCandidateReadModel>> GetNoVendorWorkOrdersAsync(DateTime cutoff, IReadOnlyCollection<int> excludeIds, CancellationToken cancellationToken);
Task<IReadOnlyList<ScheduledDispatchReadModel>> GetActiveScheduledDispatchesAsync(CancellationToken cancellationToken);
/// <summary>Same windows limited to work orders of <paramref name="accountId"/>; null is org-wide.</summary>
Task<IReadOnlyList<ScheduledDispatchReadModel>> GetActiveScheduledDispatchesAsync(int? accountId, CancellationToken cancellationToken);
Task<IReadOnlyList<ActiveVendorReadModel>> GetActiveVendorsAsync(CancellationToken cancellationToken);
Task<IReadOnlyList<SitePreferredVendor>> GetSitePreferredVendorsAsync(int locationId, CancellationToken cancellationToken);
Task<List<SitePreferredVendor>> GetSitePreferredVendorsForReplaceAsync(int locationId, CancellationToken cancellationToken);
Task<bool> LocationExistsAsync(int locationId, CancellationToken cancellationToken);
Task<Dictionary<int, Vendor>> GetVendorsByIdsAsync(IReadOnlyCollection<int> vendorIds, CancellationToken cancellationToken);
Task<IReadOnlyList<InsightDispatchData>> GetInsightDispatchDataAsync(DateTime? from, DateTime? to, int? locationId, string? trade, int? vendorId, CancellationToken cancellationToken);
Task<Vendor?> GetVendorForUpdateAsync(int vendorId, CancellationToken cancellationToken);
Task<VendorCompletionDocument?> GetCompletionDocumentForUpdateAsync(int documentId, CancellationToken cancellationToken);
Task<Dispatch?> GetDispatchForUpdateAsync(int dispatchId, CancellationToken cancellationToken);
Task<WorkOrder?> GetWorkOrderForUpdateAsync(int workOrderId, CancellationToken cancellationToken);
Task<Dispatch?> GetExistingActiveDispatchForWorkOrderAsync(int workOrderId, CancellationToken cancellationToken);
Task<string> GenerateNextDispatchNumberAsync(CancellationToken cancellationToken);
Task<string> GenerateNextPONumberAsync(CancellationToken cancellationToken);
Task AddDispatchAsync(Dispatch dispatch, CancellationToken cancellationToken);
Task StageWorkOrderAuditAsync(WorkOrderAuditLog log, CancellationToken cancellationToken);
Task StageVendorAuditAsync(VendorAuditLog log, CancellationToken cancellationToken);
Task AddSitePreferredVendorAsync(SitePreferredVendor preference, CancellationToken cancellationToken);
Task RemoveSitePreferredVendorsAsync(IEnumerable<SitePreferredVendor> preferences, CancellationToken cancellationToken);
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
}
}