using Data.SeaHavenIndustries; using Data.SeaHavenIndustries.Enums; namespace SeaHaven.DataServices.Interfaces { // Read-side projection for the global Services registry. The linked // completion template is projected to id/name only — full template // entities are never materialized. public class ServiceRegistryRow { public int Id { get; set; } public string Name { get; set; } = ""; public string Trade { get; set; } = ""; public string IconKey { get; set; } = ""; public bool RequiresCompletionDocument { get; set; } public bool IsActive { get; set; } public int? CompletionDocTemplateId { get; set; } public string? CompletionDocTemplateName { get; set; } public List SupportedWorkOrderTypes { get; set; } = new(); } public class LinkedTemplateSummary { public int Id { get; set; } public string Name { get; set; } = ""; } public interface IServicesRegistryDataService { Task> GetServiceRowsAsync(bool? isActive, WorkOrderType? workOrderType, CancellationToken cancellationToken); Task GetServiceRowByIdAsync(int id, CancellationToken cancellationToken); Task GetServiceForUpdateAsync(int id, CancellationToken cancellationToken); Task NormalizedNameExistsAsync(string normalizedName, int? excludeServiceId, CancellationToken cancellationToken); Task GetActiveTemplateSummaryAsync(int templateId, CancellationToken cancellationToken); Task AddServiceAsync(Service service, CancellationToken cancellationToken); Task SaveServiceAsync(Service service, IReadOnlyCollection supportedWorkOrderTypes, CancellationToken cancellationToken); Task DeactivateServiceAsync(int id, CancellationToken cancellationToken); } }