[CLAUDE] Docs: chốt Session 19 — PE Section 5 V2 dynamic + Mig 26
Chunk D Docs cho Session 19 (PE Section 5 dynamic theo ApprovalWorkflowLevel): - docs/STATUS.md — Recently Done row Session 19 chi tiết + header narrative 25→26 mig + 58→59 tables + 5 spec Q&A + 4 chunk per-commit - docs/HANDOFF.md — TL;DR Session 19 đầy đủ (polish 3 button + Chunk A/B/C summary + Stats Δ) + 7 cảnh báo Session 20+. Giữ TL;DR S18 nguyên văn theo §6.5 (KHÔNG cắt narrative) - docs/changelog/migration-todos.md — Phase 9 Session 19 done block với 5 commit + Stats final + Defer Session 20+ (8 task pending) - docs/changelog/sessions/2026-05-09-0400-pe-section-5-v2-dynamic-mig26.md — Session log mới, full Q&A + Chunks + Bug fix + Stats cumulative - CLAUDE.md (root) — count 25→26 mig + 58→59 tables + Mig 26 description KHÔNG đụng (per §6.5 không cố sửa khi không cần): - rules.md / architecture.md / PROJECT-MAP.md / workflow-contract.md / forms-spec.md / database-guide.md - Skills (6) — drift defer cron audit 2026-06-01 - schema-diagram.md §16 PE Level Opinions V2 — defer cùng §17-21 cron audit 2026-06-01 Path filter docs-only → CI sẽ skip deploy (gotcha #41).
This commit is contained in:
@ -157,6 +157,33 @@ Session log: `2026-04-28-chot-session-4-budget.md`.
|
||||
|
||||
## 📝 Phase 9 — UAT + Ops + carry over (Session 6+ active)
|
||||
|
||||
### ✅ Session 19 done (2026-05-09) — PE Section 5 V2 dynamic theo ApprovalWorkflowLevel + Mig 26 (4 commit `873e7a1` → Chunk D Docs)
|
||||
|
||||
User UAT live tiếp Session 18. 1 polish nhỏ + 1 feature lớn (Section 5 dynamic). Spec chốt 5 câu Q&A trước code (Q1=1B sync auto / Q2=2A+Admin / Q3=V2 hết / Q4=4C+placeholder / Q5=5A grid-cols-2).
|
||||
|
||||
- [x] **Polish 3 button (`873e7a1`) Hành động Workflow Panel** — rút gọn label "✓ Duyệt / ← Trả lại / ✗ Từ chối" (bỏ "→ Chờ X" / "(về Drafter sửa)" / "Hủy /") + 3 màu phân biệt (emerald/amber/red) + font-medium → font-bold. Phase đích vẫn hiện qua tooltip title hover. Mirror fe-admin + fe-user.
|
||||
|
||||
- [x] **Chunk A (`77a3058`) Domain + Mig 26 + EF** — Entity `PurchaseEvaluationLevelOpinion : AuditableEntity` (PEId+LevelId UNIQUE composite, Comment nvarchar(2000), SignedAt datetime2, SignedByUserId Guid, SignedByFullName nvarchar(200) denorm). EF FK Cascade Pe + Restrict Level. **Migration 26** `AddPeLevelOpinionsForV2` (1 CREATE TABLE + 2 FK + 2 index — UNIQUE composite + IX LevelId). 3-file rule. Apply LocalDB SolutionErp_Dev OK (Mig 25 + 26 catchup).
|
||||
|
||||
- [x] **Chunk B (`90baa8e`) Service V2 hook + DTO + GET include** — Service `ApproveV2Async` sau line log approval → UPSERT row LevelOpinion cho Cấp hiện tại (match level theo ApproverUserId == actorUserId, fallback first khi Admin override). Reject KHÔNG sync. Comment empty → "(duyệt — không ý kiến)" placeholder. Helper `ResolveActorFullNameAsync` denorm SignedByFullName. DTO `PurchaseEvaluationLevelOpinionDto` 15 fields. GET handler Include LevelOpinions + helper `BuildLevelOpinionsAsync` JOIN Steps/Levels + Departments + Users → denorm DTO list. Empty cho V1 / V2 chưa có cấp duyệt.
|
||||
|
||||
- [x] **Chunk C (`6e913b3`) FE Section 5 V2 dynamic mirror 2 app** — Type `PeLevelOpinion` + `PeDetailBundle.levelOpinions[]`. Section 5 conditional: `evaluation.approvalWorkflowId` set → `<LevelOpinionsSectionV2/>` (dynamic), else `<DepartmentOpinionsSection readOnly/>` (V1 legacy fallback Mig 15). `LevelOpinionsSectionV2`: forEach Step (header "Bước N — Phòng X" badge emerald + hint số người duyệt) → grid-cols-2 cho `step.levels.flatMap(level => level.approvers.map(approver => <LevelOpinionBox/>))`. `LevelOpinionBox` read-only: title "Cấp N — <ApproverFullName>" + badge amber "⚠ Admin <name> duyệt thay" khi override + badge emerald "✓ Đã duyệt" + empty "— chưa duyệt" + footer signedAt. Mirror fe-admin + fe-user (rule §3.9).
|
||||
|
||||
- [x] **Chunk D Docs (current)** — STATUS Recently Done top + header narrative · HANDOFF TL;DR Session 19 + 7 cảnh báo Session 20+ (giữ S18 nguyên văn theo §6.5) · CLAUDE.md (root) count 25→26 mig + 58→59 tables + Mig 26 description block · migration-todos Phase 9 Session 19 done section + Defer Session 20+ checklist · Session log mới `2026-05-09-0400-pe-section-5-v2-dynamic-mig26.md`. KHÔNG đụng rules/architecture/PROJECT-MAP/workflow-contract/forms-spec/database-guide/schema-diagram (defer cron audit 2026-06-01) — per §6.5 không cố sửa khi không cần.
|
||||
|
||||
**Stats final Session 19:** 26 mig (+1), 59 DB tables (+1), ~141 endpoints (no new — UPSERT auto qua Service hook không endpoint riêng vì Q1=1B), 33 FE pages, **81 test pass** (no change — feature mới UAT defer test §7), 44 gotcha (no new). Memory entries 14 (no new).
|
||||
|
||||
**Defer Session 20+:**
|
||||
|
||||
- [ ] **Test V2 Service wire mới** (Chunk B Service hook) — defer khi UAT user confirm + có sample data Production. Domain test ApproveV2 + UPSERT opinion match logic + Admin override match firstLevel + comment empty placeholder.
|
||||
- [ ] **Drop Mig 15 cho V2 phiếu (cleanup sau UAT confirm)** — sau khi không còn phiếu V2 dùng `PurchaseEvaluationDepartmentOpinions`. Mig 27 cleanup drop bảng + entity. Hoặc giữ cả 2 backward compat.
|
||||
- [ ] **Migrate phiếu V1 cũ sang V2 (data migration)** — admin tool chuyển ApprovalWorkflowId. Hiện chưa làm (Q3 user nói chuyển V2 hết = phiếu MỚI dùng V2, V1 cũ giữ legacy).
|
||||
- [ ] **Contract V2 wire (Mig 27/28)** — mirror PE pattern: Contract.ApprovalWorkflowId + ContractLevelOpinions Mig 28 + Service ApproveV2Async + ContractDetailContent Section 5 V2. Audit-reuse pattern.
|
||||
- [ ] **Phân quyền strict V2** — vẫn loose UAT. Sau confirm V2 flow → list/inbox/detail filter actor scope.
|
||||
- [ ] **schema-diagram §16 PE Level Opinions V2 + §17-21 Mig 18-21** — defer cron audit 2026-06-01.
|
||||
- [ ] **Skill `ef-core-migration` frontmatter** "21 migration" stale (thực 26). Defer cron audit 2026-06-01.
|
||||
- [ ] **Skill `dependency-audit-erp`** count stale. Defer cron audit 2026-06-01.
|
||||
|
||||
### ✅ Session 18 done (2026-05-08 19:45) — PE V2 polish + Clone B + Mig 25 IsUserSelectable + 4 bug fix UAT (7 commit `aaa1c6c` → `32a8d4d`)
|
||||
|
||||
User UAT live tiếp Session 17, chuỗi polish nhỏ + clone V2 cho type B. Áp memory `feedback_uat_skip_verify` (skip dotnet test mỗi chunk, push ngay) + lesson rename/remove → bắt buộc `npm run build`.
|
||||
|
||||
Reference in New Issue
Block a user