[CLAUDE] Docs: chốt Session 18 wrap-up — PE V2 polish + Clone B + Mig 25 IsUserSelectable + 4 bug fix UAT
Session 18 (16:56 → 19:45, 7 commit `aaa1c6c` → `32a8d4d`): - B1 Pe Duyệt filter cứng "Đã gửi duyệt" - B2 HistoryTab filter Trả lại / Gửi lại - B3 Clone V2 cho B (DuyetNccPhuongAn) — audit reuse pattern - B4 Fix silent 403 ApprovalWorkflowsV2Controller - B5 Fix sidebar highlight queryMatches transient keys - B6 Mig 25 IsUserSelectable + Designer pin toggle + bỏ "(clone)" + Workspace filter - B7 Cleanup orphan zip files Updates: - STATUS — header 24→25 mig + 43→44 gotcha + 1 row Recently Done top + session log link - HANDOFF — TL;DR S18 đầy đủ + cảnh báo S19+ (giữ S17 narrative §6.5) - CLAUDE.md root — count 25 mig + Mig 25 description block - schema-diagram §14 — heading 22→25 + cột IsUserSelectable + filter logic section + Pending S19+ Mig 26/27 - gotchas — +#44 silent 403 + checklist debug 21 - migration-todos — Phase 9 S18 done section - session log mới đầy đủ E2E narrative Stats: 25 mig, 58 tables, ~141 endpoints, 81 test pass (no change), 44 gotcha, 14 memory entries, 6 skill, 7 commit S18. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -157,6 +157,38 @@ Session log: `2026-04-28-chot-session-4-budget.md`.
|
||||
|
||||
## 📝 Phase 9 — UAT + Ops + carry over (Session 6+ active)
|
||||
|
||||
### ✅ 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`.
|
||||
|
||||
- [x] **B1 (`aaa1c6c`) Pe Duyệt filter cứng "Đã gửi duyệt"** — bỏ dropdown trạng thái + filter cứng client-side `getPeDisplayStatus === DaGuiDuyet`. Hint amber "Lọc cố định". Workaround BE /inbox loose UAT trả phiếu Nháp (phân quyền strict V2 pending).
|
||||
|
||||
- [x] **B2 (`917446d`) HistoryTab filter Trả lại / Gửi duyệt lại** — FE filter (BE keep audit data đầy đủ): chỉ events Workflow Transition về TraLai (phaseAtChange=98) + từ TraLai (summary "TraLai →") + sửa nội dung khi phaseAtChange=TraLai.
|
||||
|
||||
- [x] **B3 (`937eb24`) Clone V2 cho B (DuyetNccPhuongAn)** — Audit reuse trước thay vì duplicate. Schema chung qua ApplicableType discriminator → chỉ 3 file ~60 LOC: MenuKeys.cs +const + All array, DbInitializer.SeedMenusAsync +leaf B (Order=2) + new SeedSampleApprovalWorkflowsV2Async (idempotent skip nếu admin đã tạo workflow B), fe-admin/menuKeys.ts +const. Memory `feedback_audit_reuse_before_clone.md` capture pattern.
|
||||
|
||||
- [x] **B4 (`f77ea38`) Fix silent 403 ApprovalWorkflowsV2** — Drafter `nv.test` Workspace dropdown empty silent. Root: class-level `[Authorize(Policy = "Workflows.Read")]` → non-admin 403, TanStack Query catch silent. Fix: class-level `[Authorize]` only, GET cho any authenticated; POST/DELETE giữ `Workflows.Create` admin-only. Gotcha #44.
|
||||
|
||||
- [x] **B5 (`a9c0857`) Fix sidebar highlight queryMatches transient keys** — Click row → URL có id transient → exact-set mismatch → menu unhighlight. Fix: `TRANSIENT_QUERY_KEYS = {id, q, editHeader, page, phase, awId}` strip trước compare. Mirror fe-admin + fe-user Layout.tsx.
|
||||
|
||||
- [x] **B6 (`2a53107`) Mig 25 + Designer pin toggle + bỏ "(clone)" + Workspace filter** — Migration 25 `AddIsUserSelectableToApprovalWorkflows`: ALTER `IsUserSelectable bit` + Sql backfill `WHERE IsActive=1 SET 1`. Domain +property. DTO +field. CreateAwDefinitionCommand set default true. New SetAwUserSelectableCommand + Handler. API PATCH `/api/approval-workflows-v2/{id}/user-selectable`. DbInitializer SeedSample +`IsUserSelectable=true`. FE Designer +badge "Cho user chọn" + button Ghim/Bỏ ghim + mutation toggleSelectable. Designer name auto-fill bỏ "(clone)" suffix. FE Workspace fetch filter `w.isUserSelectable === true` (cả fe-admin + fe-user).
|
||||
|
||||
- [x] **B7 (`32a8d4d`) Cleanup orphan zip** — `.claude.zip + docs.zip` lỡ tay vào commit B6 (`git add -A`). Untrack + add `*.zip` rule .gitignore.
|
||||
|
||||
**Stats final Session 18:** 25 mig (+1), 58 DB tables (no new — Mig 25 chỉ ALTER cột), ~141 endpoints (+1 PATCH), 33 FE pages, **81 test pass** (no change — feature mới UAT defer test §7), 44 gotcha (+1 #44 silent 403). Memory +1 entry.
|
||||
|
||||
**Defer Session 19+:**
|
||||
|
||||
- [ ] **Contract V2 wire (Mig 26)** — mirror PE pattern: thêm `Contract.ApprovalWorkflowId` + `CurrentApprovalLevelOrder` + `ContractWorkflowService.ApproveV2Async` + Workspace Select V2 trong ContractCreatePage. Pin V2 mặc định cho ContractType.
|
||||
- [ ] **Phân quyền strict V2** — hiện loose UAT (mọi authenticated thấy mọi phiếu V2). List = Drafter + approver any-Step + Admin. Cũng giải quyết bug "/inbox loose trả phiếu Nháp" — sau khi BE filter strict, B1 FE filter có thể relax.
|
||||
- [ ] **Drop legacy V1 (Mig 27 cleanup)** sau khi không còn phiếu pin `WorkflowDefinitionId` (V1): drop `WorkflowDefinitions` + `WorkflowSteps` + `WorkflowStepApprovers` + drop deprecated columns `RejectedAtStepIndex` / `RejectedFromPhase`. Drop `ApproveV1LegacyAsync` branch trong Service.
|
||||
- [ ] **Test V2 Service wire** (defer khi UAT confirm + có sample data thật) — Domain test ApproveV2Async + match logic + TraLai entry → Cấp 1 reset.
|
||||
- [ ] **Budget V2 wire** (defer xa hơn — sau Contract V2)
|
||||
- [ ] **Sample seed B** — sau UAT có thể remove (admin đã tạo workflow thật), hoặc giữ làm fallback. Idempotent skip không clobber.
|
||||
- [ ] **schema-diagram §17-21 Mig 18-21** vẫn chưa update (defer cron audit 2026-06-01)
|
||||
- [ ] **Skill `ef-core-migration` frontmatter** "21 migration" stale (thực 25). Defer cron audit 2026-06-01.
|
||||
- [ ] **Skill `dependency-audit-erp`** "26+/41 bẫy" stale (thực 44). Defer cron audit 2026-06-01.
|
||||
|
||||
### ✅ Session 17 done (2026-05-08) — PE Workflow V2 schema + Service wire end-to-end (Mig 22-24, 13 commit `c847dc0` → `de0f38d`)
|
||||
|
||||
User chốt sau Session 16 drastic refactor flat (Mig 21) vẫn chưa đúng intent. Yêu cầu schema riêng + Menu mới "Duyệt NCC (Mới)" — Quy trình > Bước (Phòng) > Cấp (NV cụ thể qua ApproverUserId). State machine 5 trạng thái với Trả lại = Phase RIÊNG (Option A user chốt diagram).
|
||||
|
||||
Reference in New Issue
Block a user