diff --git a/src/Backend/SolutionErp.Domain/Contracts/Contract.cs b/src/Backend/SolutionErp.Domain/Contracts/Contract.cs index b9bcfa8..78ad736 100644 --- a/src/Backend/SolutionErp.Domain/Contracts/Contract.cs +++ b/src/Backend/SolutionErp.Domain/Contracts/Contract.cs @@ -20,6 +20,7 @@ public class Contract : AuditableEntity public string? NoiDung { get; set; } public bool BypassProcurementAndCCM { get; set; } // HĐ Chủ đầu tư → skip CCM public Guid? WorkflowDefinitionId { get; set; } // Pinned at creation — HĐ cũ chạy version cũ ngay cả khi admin active version mới + public Guid? ApprovalWorkflowId { get; set; } // [Plan B S29 2026-05-22 Mig 32] Pin schema mới ApprovalWorkflowsV2 — mirror PE Mig 23. V1+V2 coexist: 7 V1 contract giữ WorkflowDefinitionId; V2 mới pin ApprovalWorkflowId. Service ApproveV2Async branch theo field này. public DateTime? SlaDeadline { get; set; } // Hết hạn phase hiện tại public string? DraftData { get; set; } // JSON field values (render template) public bool SlaWarningSent { get; set; } // Flag để không gửi warning 2 lần @@ -39,6 +40,11 @@ public class Contract : AuditableEntity public int? CurrentWorkflowStepIndex { get; set; } public int? RejectedAtStepIndex { get; set; } + // [Plan B S29 2026-05-22 Mig 32] V2 workflow tracking — mirror PE Mig 24. + // CurrentApprovalLevelOrder: Cấp đang chờ duyệt (1/2/3) trong Step hiện tại + // khi pin ApprovalWorkflowId. Null khi V1 legacy hoặc V2 terminal (DaPhatHanh). + public int? CurrentApprovalLevelOrder { get; set; } + public List Approvals { get; set; } = new(); public List Comments { get; set; } = new(); public List Attachments { get; set; } = new();