[CLAUDE] PurchaseEvaluation: ROOT FIX — Sửa header KHÔNG xóa Quy trình duyệt (bug-class S42, anh Kiệt FDC)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m47s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m47s
Root-cause "chưa chọn quy trình duyệt" lặp lại (long.chau + nhiều account dù SQL-fix nhiều đợt):
form Sửa header (PeHeaderForm → PUT /purchase-evaluations/{id}) KHÔNG gửi approvalWorkflowId →
UpdatePurchaseEvaluationDraftCommandHandler absolute-set entity.ApprovalWorkflowId = null → XÓA
workflow của phiếu (tạo CÓ workflow → bấm Sửa = MẤT → kẹt submit). ApprovalWorkflowId bị SÓT khỏi
pattern null-safe (bug-class S42) mà BudgetPeriodAmount/ExpectedRemainingAmount/WorkItemId ngay
dưới đã áp dụng ("client không gửi → GIỮ giá trị cũ").
Fix: null-safe — chỉ set ApprovalWorkflowId khi client CÓ gửi (preserve nếu không gửi). Đổi quy
trình = FE phải gửi giá trị mới. + prod-data: gán QT-DN-V2-001 cho 5 phiếu bị clear (2 đợt 3+2).
BE 1 file (UpdateDraftHandler). Test 371 PASS (no break — submit-guard S83 giữ nguyên).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -279,7 +279,11 @@ public class UpdatePurchaseEvaluationDraftCommandHandler(
|
|||||||
entity.MoTa = request.MoTa;
|
entity.MoTa = request.MoTa;
|
||||||
entity.HoSoLink = request.HoSoLink; // [HoSoLink] absolute-set như MoTa/DiaDiem (Section 1 text field, null = clear)
|
entity.HoSoLink = request.HoSoLink; // [HoSoLink] absolute-set như MoTa/DiaDiem (Section 1 text field, null = clear)
|
||||||
entity.PaymentTerms = request.PaymentTerms;
|
entity.PaymentTerms = request.PaymentTerms;
|
||||||
entity.ApprovalWorkflowId = request.ApprovalWorkflowId; // Mig 23 — User đổi quy trình
|
// [S85 anh Kiet ROOT FIX bug-class S42] null-safe: form Sua KHONG gui approvalWorkflowId
|
||||||
|
// (tao co WF -> bam Sua = MAT WF -> ket submit "chua chon quy trinh" = root-cause whack-a-mole).
|
||||||
|
// Client khong gui field -> GIU WF cu (giong BudgetPeriodAmount duoi); doi WF thi FE phai gui gia tri.
|
||||||
|
if (request.ApprovalWorkflowId is not null)
|
||||||
|
entity.ApprovalWorkflowId = request.ApprovalWorkflowId; // Mig 23 — User đổi quy trình
|
||||||
// [S61] null-safe 2 field ngân sách mới (mirror WorkItemId bên dưới):
|
// [S61] null-safe 2 field ngân sách mới (mirror WorkItemId bên dưới):
|
||||||
// client không gửi → GIỮ giá trị cũ, KHÔNG null-hóa (bug-class S42).
|
// client không gửi → GIỮ giá trị cũ, KHÔNG null-hóa (bug-class S42).
|
||||||
if (request.BudgetPeriodAmount is not null)
|
if (request.BudgetPeriodAmount is not null)
|
||||||
|
|||||||
Reference in New Issue
Block a user