# HANDOFF — Brief 5 phút cho session tiếp theo **Last updated:** 2026-05-07 (Session 14 — **PE 3-button workflow Duyệt/Trả lại/Từ chối — Domain policy expand + Service tách reject 2 case + FE 3-button + 1 test mới = 96 pass. 1 commit `0d77698`. Task 2 sample seed defer (DesignTime vs Runtime DB gotcha + API exit sớm).**) ## TL;DR Session 14 (07/05 — PE 3-button approval workflow) User chỉ thị thay 2-button approval (Duyệt + Reject mơ hồ) bằng **3 hành động rõ ràng** cho approver: - **Duyệt** = forward phase tiếp theo (decision=Approve) - **Trả lại** = về DangSoanThao + Drafter sửa (decision=Reject + target=DangSoanThao). Smart reject pattern Mig 16 + clear N-stage rows + Drafter resume jump-back tới phase đã reject. - **Từ chối** = phase=TuChoi (decision=Reject + target=TuChoi). Phiếu khoá vĩnh viễn (17 handler Mig 16 lock edit). Drafter phải tạo phiếu mới. **1 commit (`0d77698`):** - **Domain `PurchaseEvaluationPolicy.cs`**: NccOnly + NccWithPlan thêm `(X → TuChoi)` transition cho mọi phase trung gian (ChoPurchasing/ChoDuAn/ChoCCM/ChoCEODuyetPA/ChoCEODuyetNCC) với roles của phase đó. FromDefinition expand: mỗi step (trừ DangSoanThao) thêm (step.Phase → TuChoi) với roles step. - **Service** `PurchaseEvaluationWorkflowService.TransitionAsync` — Reject branch tách 2 case: ``` if (decision == Reject) { if (target != TuChoi) { // Trả lại RejectedFromPhase = fromPhase target = DangSoanThao // force clear N-stage rows tại fromPhase } // else target=TuChoi: giữ nguyên, KHÔNG set RejectedFromPhase, KHÔNG clear } ``` - **FE PeWorkflowPanel (admin + user mirror)**: render 3 button rõ: - "✓ Duyệt →