shoc-backend/Data.SeaHavenIndustries/Models/Service.cs
2026-09-16 17:07:59 -03:00

29 lines
1.3 KiB
C#

using Data.SeaHavenIndustries.Enums;
namespace Data.SeaHavenIndustries
{
// Global (tenant-scope free) Services registry. Services are never
// hard deleted; deactivation is a soft IsActive state change so historical
// work-order references remain resolvable.
public class Service : FullAuditEntity
{
public string Name { get; set; } = "";
public string NormalizedName { get; set; } = "";
public string Trade { get; set; } = "";
public string IconKey { get; set; } = "";
public bool RequiresCompletionDocument { get; set; }
public int? CompletionDocTemplateId { get; set; }
public virtual CompletionDocTemplate? CompletionDocTemplate { get; set; }
public bool IsActive { get; set; } = true;
public virtual ICollection<ServiceWorkOrderType> SupportedWorkOrderTypes { get; set; } = new List<ServiceWorkOrderType>();
}
// Supported work-order types (PM, Reactive, Emergency) stored as an
// explicitly queryable relation so work-order features can filter by type.
public class ServiceWorkOrderType : FullAuditEntity
{
public int ServiceId { get; set; }
public virtual Service? Service { get; set; }
public WorkOrderType WorkOrderType { get; set; }
}
}