mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 09:33:13 +00:00
Adds an extra safety note and an ordered procedure list to completion document templates, name search, creator and last-updated audit fields, a tenant-scoped count of open work orders that depend on a template, and a delete that unlinks Services while they keep requiring a document. Writes are gated by the create/edit/delete completion template team permissions instead of the Admin role.
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using Data.SeaHavenIndustries.Enums;
|
|
|
|
namespace Data.SeaHavenIndustries
|
|
{
|
|
public class CompletionDocTemplate : FullAuditEntity
|
|
{
|
|
public const int ExtraSafetyNoteMaxLength = 2000;
|
|
|
|
public string Name { get; set; } = "";
|
|
public string ServiceKey { get; set; } = "";
|
|
public WorkOrderType? WorkOrderType { get; set; }
|
|
public string TemplateUrl { get; set; } = "";
|
|
public bool IsActive { get; set; } = true;
|
|
|
|
// At most one template-specific note, printed after the standard
|
|
// safety bullets every generated document carries.
|
|
public string? ExtraSafetyNote { get; set; }
|
|
|
|
public virtual ICollection<CompletionDocTemplateProcedure> Procedures { get; set; } = new List<CompletionDocTemplateProcedure>();
|
|
}
|
|
|
|
// Ordered procedure step of a completion document template. SortOrder is the
|
|
// position the author gave it; documents print procedures in that order.
|
|
public class CompletionDocTemplateProcedure
|
|
{
|
|
public const int NameMaxLength = 200;
|
|
|
|
public int Id { get; set; }
|
|
public int CompletionDocTemplateId { get; set; }
|
|
public virtual CompletionDocTemplate? CompletionDocTemplate { get; set; }
|
|
public int SortOrder { get; set; }
|
|
public string Name { get; set; } = "";
|
|
public string Description { get; set; } = "";
|
|
}
|
|
}
|