[CLAUDE] Docs: chốt session 5 — Budget FE + PE feature complete + Tests Phase 1-2 + CI gate
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Failing after 22s
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Failing after 22s
Session 5 (29/04) — 6 commit feature + 1 chốt MD này. ==== Stats sau session 5 ==== - 52 DB tables (+1 PEDeptOpinions) - 15 migrations (+`AddPurchaseEvaluationDepartmentOpinions`) - ~128 API endpoints (+4) - ~31 FE pages (+5 Budget + 1 PeWorkflowsPage) - 71 unit test pass (54 Domain + 17 Infra) — CI gate live, fail → no deploy - ~13050 BE LOC (+1300) - 30 demo user, 38 gotchas, 6 skill (no change) ==== MD touched ==== - STATUS.md: header Phase 8 + 6 row Recently Done session 5 + cumulative cột S5 + In Progress S6 (Hard blockers + Optional polish + Tests Phase 3-5 + Ops) - HANDOFF.md: TL;DR 6 milestone S5 + Cảnh báo S6 (CI test gate workflow mới) + Priority 0 S6 (UAT + Ops focus) + Phase status table cập nhật - migration-todos.md: Phase 8 done với A/B/C/D/E (FE Budget / PE-HD integration / PE WF Designer / Ý kiến 4 PB / Tests Phase 1-2) + Phase 9 active (UAT + Ops + carry over) - architecture.md: §11 Testing strategy mới (test pyramid bottom-heavy + stack + CI gate + phased priority + quy tắc bổ sung mỗi feature) - database/schema-diagram.md: Migration 15 row + total 52 tables + §13 PE Department Opinion (1 bảng UNIQUE PEId+Kind + Upsert behavior + SQL DDL) - ef-core-migration SKILL: migration 15 entry + 52 tables total + Phase 8 update note - CLAUDE.md (root): modules table + Tests row + scope `Tests` + Tests section mới + count update 15/52 - docs/CLAUDE.md: 7 module bullet + ERD 52 bảng + Roadmap Phase 8 done + Phase 9 active S6 - memory project_solution_erp.md: Phase 8 summary + Session 6 priority + workflow user mới (dotnet test → commit → push) - session log 2026-04-29-chot-session-5-budget-fe-pe-tests.md (NEW — 10+ section detail) ==== Verify ==== - dotnet test SolutionErp.slnx → 71 pass / 2s - git status clean sau commit này Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
105
docs/HANDOFF.md
105
docs/HANDOFF.md
@ -1,10 +1,20 @@
|
||||
# HANDOFF — Brief 5 phút cho session tiếp theo
|
||||
|
||||
**Last updated:** 2026-04-28 (Phase 7 — **Module Ngân sách (Budget) BE + 14 demo users Solutions thật**)
|
||||
**Last updated:** 2026-04-29 (Phase 8 — **Budget FE complete + PE/HD-Budget integration + PE Workflow Designer + Ý kiến 4 PB + Tests Phase 1-2 + CI gate**)
|
||||
|
||||
## TL;DR
|
||||
|
||||
**Session 4 (28/04)** thêm 2 milestone lớn:
|
||||
**Session 5 (29/04)** đóng gần hết feature gap + bật test gate:
|
||||
|
||||
### 🎯 Headline outcomes
|
||||
- ✅ **Budget feature-complete** — FE 3-panel pages cả 2 app, BE đã sẵn từ session 4
|
||||
- ✅ **PE/HD ↔ Budget integration** — form select Budget filter Phase=DaDuyet + Project, cột "So với ngân sách" ở PE matrix với delta indicator
|
||||
- ✅ **PE Detail UI restructure** match form chính thức PHIẾU TRÌNH KÝ (4 section đánh số)
|
||||
- ✅ **PE Workflow Designer admin UI** `/system/pe-workflows/:typeCode` versioned với clone/edit/+Role/+User
|
||||
- ✅ **Ý kiến 4 phòng ban** — migration 15 + section sign-off 2x2 grid (Phê duyệt/CCM/MuaHàng/SM-PM)
|
||||
- ✅ **Tests Phase 1-2** — 71 unit test pass + CI gate fail-fast (Domain policy + Infra code generator)
|
||||
|
||||
**Session 4 (28/04)** đã có:
|
||||
|
||||
### A. Module Ngân sách (Budget) BE — migration 14, +4 bảng, +11 endpoint
|
||||
|
||||
@ -24,25 +34,23 @@
|
||||
- Pwd `User@123456`. Reconcile pattern (gotcha #38 4-field rename).
|
||||
- Tổng 30 user (16 sample cũ giữ + 14 Solutions thật mới).
|
||||
|
||||
**Tổng:** 51 DB tables, ~124 endpoints, 14 migrations, 38 gotchas, 5+ commit
|
||||
session 4 push lên Gitea.
|
||||
**Tổng cumulative:** 52 DB tables, ~128 endpoints, 15 migrations, 38 gotchas,
|
||||
**71 unit test**, 6 commit session 5 push lên Gitea.
|
||||
|
||||
## ⚠️ CẢNH BÁO session tiếp (Session 5)
|
||||
## ⚠️ CẢNH BÁO session tiếp (Session 6)
|
||||
|
||||
1. **FE Budget pages CHƯA LÀM** — BE đã sẵn sàng nhưng chưa có page nào. Pattern: copy từ PE 3-panel List + Create + Detail tabs (Thông tin / Hạng mục) + WorkflowPanel timeline. Mirror sang fe-user. Thêm route `/budgets`, `/budgets/new`, `/budgets/:id`. Menu resolver `Bg_*` → URL.
|
||||
2. **PE/Contract → Budget integration CHƯA WIRE** — BE đã có `BudgetId?` nullable FK trên cả 2 entity, FE form chưa thêm field "Ngân sách" select. Cần filter Budget theo `Phase=DaDuyet && NamNganSach=current && ProjectId match`. Tab Hạng mục có thể bonus cột "So với ngân sách".
|
||||
1. **CI test gate active** — mỗi commit push trigger 2 step `dotnet test` (Domain + Infrastructure) TRƯỚC build/deploy. Test fail = NO deploy. Khi feature mới có bug logic → thêm regression test trước khi commit. Workflow: code → `dotnet test SolutionErp.slnx` local → commit → push.
|
||||
2. **Login email** `admin@solutionerp.local` / `Admin@123456` — domain default
|
||||
chưa đổi sang `@solutions.com.vn` (chỉ demo user rebrand qua BackfillDemoEmail).
|
||||
3. **Chưa xóa binding cũ `.huypham.vn`** — vẫn active fallback. Sau 1-2 ngày
|
||||
verify stable → `.\migrate-domains.ps1 -RemoveOld -SkipCert` trên VPS.
|
||||
4. **win-acme scheduled task "unhealthy"** — cert auto-renew có thể fail
|
||||
khi gần 2026-06-18. Fix: mở `wacs.exe` interactive → Manage Renewals →
|
||||
recreate task.
|
||||
5. **PE feature gap carry over** (xem STATUS §C):
|
||||
- PE Workflow admin designer UI `/system/pe-workflows/:typeCode`
|
||||
- Section "Ý kiến 4 phòng ban" (Phê duyệt/CCM/MuaHàng/SM-PM)
|
||||
- Export phiếu PDF/Excel
|
||||
6. **Login email** `admin@solutionerp.local` / `Admin@123456` — domain default
|
||||
chưa đổi sang `@solutions.com.vn` (chỉ demo user và rebrand cũ trong BackfillDemoEmail).
|
||||
7. **Chú ý G-084:** VPS shared với VietReport — mọi reverse proxy / backend
|
||||
5. **Export phiếu PDF/Excel PE** — pending vô thời hạn (user nói không quan trọng lắm). Khi cần: tái dùng `IDocumentConverter` + template `PE-TrinhDuyet.docx`.
|
||||
6. **Atomic sequence Budget chưa chốt** — `NS-YYYYMM-XXXX` Random.Shared. Khi format chốt → migration `AddBudgetCodeSequences` + `IBudgetCodeGenerator` SERIALIZABLE pattern (mirror Contract/PE).
|
||||
7. **Versioned workflow Budget chưa có** — hardcoded `BudgetPolicy.Default` 3-step. Khi user cần admin config UI → migration `AddBudgetVersionedWorkflow` + 3 bảng + pin per Budget.
|
||||
8. **Chú ý G-084:** VPS shared với VietReport — mọi reverse proxy / backend
|
||||
service mới phải dùng `127.0.0.1` + bind loopback IPv4 explicit.
|
||||
|
||||
## ⭐ Skills (.claude/skills/) — PHẢI dùng khi task khớp
|
||||
@ -84,10 +92,15 @@ session 4 push lên Gitea.
|
||||
| **Module Duyệt NCC (tiền-HĐ) E2E** — 10 bảng + 2 workflow + Kế thừa HĐ | ✅ Done |
|
||||
| **PE polish iter 2** — flat layout + per-NCC attachments + readOnly Duyệt + email rebrand | ✅ Done |
|
||||
| **Domain rebrand huypham.vn → solutions.com.vn** — 3 subdomain + cert + CORS + FE bundle | ✅ Done |
|
||||
| **Module Ngân sách BE** — 4 bảng + 11 endpoint + workflow simple + 30 user | ✅ Done (FE TODO) |
|
||||
| **PE Workflow designer UI + Ý kiến 4 phòng ban + Export PDF** | 📝 Pending session 5+ |
|
||||
| **FE Budget pages + PE/Contract → Budget integration** | 📝 Priority 0 session 5 |
|
||||
| 8+ Post-launch (E-signature, Bravo/SAP, Mobile, AI) | 📝 Future |
|
||||
| **Module Ngân sách BE + 30 user** — 4 bảng + 11 endpoint + workflow simple | ✅ Done (S4) |
|
||||
| **Module Ngân sách FE** — 3-panel pages + Detail tabs + Workflow Panel cả 2 app | ✅ Done (S5) |
|
||||
| **PE/Contract → Budget integration** — form Select + cột "So với ngân sách" PE matrix | ✅ Done (S5) |
|
||||
| **PE Workflow designer admin UI** `/system/pe-workflows/:typeCode` | ✅ Done (S5) |
|
||||
| **Ý kiến 4 phòng ban PE** — migration 15 + section sign-off 2x2 grid | ✅ Done (S5) |
|
||||
| **Tests Phase 1-2 + CI gate** — 71 test (Domain policy + Infra code generator) | ✅ Done (S5) |
|
||||
| **Export phiếu PDF/Excel PE** — `IDocumentConverter` + template | 📝 Pending (không quan trọng) |
|
||||
| **Tests Phase 3-5** — Application handlers + API smoke + FE Vitest | 📝 Pending (làm khi cần) |
|
||||
| 9+ Post-launch (E-signature, Bravo/SAP, Mobile, AI) | 📝 Future |
|
||||
|
||||
## Run nhanh
|
||||
|
||||
@ -128,41 +141,39 @@ Login: `admin@solutionerp.local` / `Admin@123456`
|
||||
|
||||
## Cần làm kế tiếp
|
||||
|
||||
### 🔥 Priority 0 — Budget FE + PE/HD integration (session 5)
|
||||
### 🔥 Priority 0 — Session 6 (Ops + UAT focus)
|
||||
|
||||
Xem **STATUS.md §🔥 In Progress** đầy đủ (nhóm A/B/C/D/E). Tóm tắt:
|
||||
Đa số feature gap đã đóng. Còn lại chủ yếu Ops/UAT + optional polish.
|
||||
|
||||
**A. Budget FE pages — copy pattern PE:**
|
||||
1. `fe-admin/src/types/budget.ts` (types + enums BudgetPhase + ApprovalDecision reuse)
|
||||
2. `fe-admin/src/pages/budgets/BudgetsListPage.tsx` (3-panel `lg:grid-cols-[320px_1fr_360px]` — Panel 1 list + Panel 2 detail tabs + Panel 3 workflow timeline)
|
||||
3. `fe-admin/src/pages/budgets/BudgetCreatePage.tsx` (form Header: tên/năm/dự án/phòng ban/người soạn)
|
||||
4. `fe-admin/src/components/budgets/BudgetDetailTabs.tsx` (Thông tin / Hạng mục — flat row giống PE Details)
|
||||
5. `fe-admin/src/components/budgets/BudgetWorkflowPanel.tsx` (Panel 3: timeline phase + ô comment + button Trình)
|
||||
6. Mirror tất cả sang `fe-user/`
|
||||
7. App.tsx routes `/budgets`, `/budgets/new`, `/budgets/:id` cả 2 app
|
||||
8. Menu resolver `Bg_*` ở Layout: `Bg_List` → `/budgets`, `Bg_Pending` → `/budgets?phase=Pending`, `Bg_Create` → `/budgets/new`
|
||||
**A. Hard blockers (chờ user / ops):**
|
||||
1. **UAT thật 1 tuần với 2-3 user** — Drafter (QS/NV.PB) + CCM + BOD ghi bug/friction
|
||||
2. **SMTP config** → bật Email outbox (BLOCKED chờ user cấp host/user/pass)
|
||||
3. **Rotate credentials** — admin + 30 demo + SA + vrapp + JWT secret
|
||||
4. **Schedule SQL backup daily** — `scripts/backup-sql.ps1` chưa schedule Task Scheduler
|
||||
|
||||
**B. PE/Contract → Budget integration:**
|
||||
1. **PE form** thêm field `Ngân sách` select Budget (filter `Phase=DaDuyet && NamNganSach=current && ProjectId=peProjectId`). Lưu `PE.BudgetId`.
|
||||
2. **Contract form** tương tự — link sang Budget cho đối chiếu chi phí.
|
||||
3. PE Detail tab có thể thêm cột "So với ngân sách" — compute từ `BudgetDetail` tương ứng (match GroupCode + ItemCode) nếu có Budget link.
|
||||
**B. PE feature gap còn lại:**
|
||||
- **Export phiếu PDF/Excel** PE — pending (user nói không quan trọng lắm). Khi cần: tái dùng `IDocumentConverter` + template `PE-TrinhDuyet.docx`.
|
||||
|
||||
**C. PE feature gap (carry over từ session 3):**
|
||||
1. **PE Workflow admin designer UI** `/system/pe-workflows/:typeCode` — mirror pattern `WorkflowsPage.tsx` + `WorkflowDesigner.tsx`. BE cần `PeWorkflowAdminFeatures.cs` + `PeWorkflowsController.cs`. Framework backend đã sẵn (3 bảng `PurchaseEvaluationWorkflow*` + `FromDefinition`), chỉ thiếu wire UI.
|
||||
2. **Ý kiến 4 phòng ban** (Phê duyệt / P.CCM / P.MuaHàng / SM-PM) — Excel form có, entity chưa map. Cần design: 4 text field + signoff date, hoặc dùng Approvals với role-kind.
|
||||
3. **Export phiếu PDF/Excel** — tái dùng `IDocumentConverter` + template `PE-TrinhDuyet.docx`.
|
||||
|
||||
**D. Optional polish:**
|
||||
- Budget MaNganSach atomic sequence (hiện Random.Shared, format chốt sau)
|
||||
- Budget versioned workflow (admin config qua UI — hiện hardcoded `BudgetPolicy.Default`)
|
||||
- Payment terms PE tách field
|
||||
- Auto-map PE Details → Contract Details khi gen HĐ
|
||||
**C. Optional polish (làm khi UAT phát sinh):**
|
||||
- Budget MaNganSach atomic sequence — chốt format → migration `AddBudgetCodeSequences` mirror Contract/PE
|
||||
- Budget versioned workflow — admin config UI thay hardcoded `BudgetPolicy.Default`
|
||||
- Payment terms PE tách field — JSON blob → 6 column riêng
|
||||
- Auto-map PE Details → Contract per-type Details khi gen HĐ
|
||||
- Matrix Quotes bulk paste từ Excel
|
||||
- fe-user Inbox thêm section "Phiếu Duyệt NCC chờ tôi"
|
||||
|
||||
**Đã xong trong session 4 (check STATUS Recently Done):**
|
||||
- ~~Module Ngân sách BE — 4 bảng + 11 endpoint + workflow simple~~ ✅
|
||||
- ~~14 demo user Solutions thật (PRO 5 + CCM 7 + ISO 1 + CEO 1)~~ ✅
|
||||
- ~~Docs cleanup + tái cấu trúc MD~~ ✅
|
||||
**D. Tests Phase 3-5 (làm khi gặp bug recurring để justify ROI):**
|
||||
- Phase 3 — Application handler tests (CQRS + EF InMemory) ~15 test
|
||||
- Phase 4 — API smoke tests (WebApplicationFactory) ~7 test
|
||||
- Phase 5 — FE Vitest cho lib utility (queryMatches, fmtMoney) ~10 test
|
||||
|
||||
**Đã xong session 5 (check STATUS Recently Done):**
|
||||
- ~~Module Ngân sách FE — 3-panel pages cả 2 app~~ ✅
|
||||
- ~~PE/Contract → Budget integration + cột "So với ngân sách"~~ ✅
|
||||
- ~~PE Detail UI restructure 4 section đánh số~~ ✅
|
||||
- ~~PE Workflow Designer admin UI~~ ✅
|
||||
- ~~Ý kiến 4 phòng ban (migration 15)~~ ✅
|
||||
- ~~Tests Phase 1-2 + CI gate (71 test)~~ ✅
|
||||
|
||||
### A. Hard blockers (chờ user / ops)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user