[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:
@ -1,7 +1,7 @@
|
||||
# Migration To-dos — Atomic Roadmap
|
||||
|
||||
> Tick `[x]` khi xong. Phase 0-5 + Tier 3 + Phase 6 đã DONE — collapsed. Detail xem session
|
||||
> logs trong `docs/changelog/sessions/`. Active work: Phase 7 partial (Budget BE done, FE WIP) + Phase 8 (Budget refinement).
|
||||
> Tick `[x]` khi xong. Phase 0-8 đã DONE — collapsed. Detail xem session
|
||||
> logs trong `docs/changelog/sessions/`. Active work: Phase 9 (UAT + Ops + carry over PE PDF export + Tests Phase 3-5).
|
||||
|
||||
## ✅ Phase 0-5 + Tier 3 — Done (2026-04-21..22)
|
||||
|
||||
@ -102,34 +102,87 @@ Session log: `2026-04-28-chot-session-4-budget.md`.
|
||||
|
||||
### E. Pending migrations
|
||||
|
||||
- [ ] `AddPePaymentTermFields` (nếu chốt UX tách field)
|
||||
- [ ] `AddPeDepartmentOpinions` (nếu chọn Option A header columns)
|
||||
- [ ] `AddPePaymentTermFields` (nếu chốt UX tách field — JSON blob → 6 column)
|
||||
- [x] **`AddPurchaseEvaluationDepartmentOpinions`** ✅ migration 15 (S5)
|
||||
- [ ] `AddBudgetCodeSequences` (nếu chốt format MaNganSach atomic — hiện Random.Shared)
|
||||
- [ ] `AddBudgetVersionedWorkflow` (nếu user cần admin config UI thay vì hardcoded `BudgetPolicy.Default`)
|
||||
|
||||
## 📝 Phase 8 — Budget FE + integration (Session 5 active)
|
||||
## ✅ Phase 8 — Budget FE + PE/HD integration (Session 5 done)
|
||||
|
||||
### A. FE Budget pages — copy pattern PE
|
||||
### A. FE Budget pages — done ✅
|
||||
|
||||
- [ ] `fe-admin/src/types/budget.ts` (types + enum BudgetPhase + ApprovalDecision reuse)
|
||||
- [ ] `fe-admin/src/pages/budgets/BudgetsListPage.tsx` (3-panel `[320px_1fr_360px]`)
|
||||
- [ ] `fe-admin/src/pages/budgets/BudgetCreatePage.tsx` (form Header)
|
||||
- [ ] `fe-admin/src/components/budgets/BudgetDetailTabs.tsx` (Thông tin / Hạng mục)
|
||||
- [ ] `fe-admin/src/components/budgets/BudgetWorkflowPanel.tsx` (Panel 3 timeline + transition + comment)
|
||||
- [ ] Mirror tất cả sang `fe-user/`
|
||||
- [ ] App.tsx routes `/budgets`, `/budgets/new`, `/budgets/:id` cả 2 app
|
||||
- [ ] Menu resolver `Bg_*` (Bg_List → `/budgets`, Bg_Pending → `/budgets?phase=Pending`, Bg_Create → `/budgets/new`)
|
||||
- [x] `fe-admin/src/types/budget.ts` (BudgetPhase 5-state enum + DTO types)
|
||||
- [x] `fe-admin/src/pages/budgets/BudgetsListPage.tsx` (3-panel `[340px_1fr_360px]` + filter Phase/Năm + ?phase=Pending alias + readOnly mode + BudgetDetailPage fullpage mobile)
|
||||
- [x] `fe-admin/src/pages/budgets/BudgetCreatePage.tsx` (form Header — Tên/Năm/Dự án/Phòng ban/Mô tả)
|
||||
- [x] `fe-admin/src/components/budgets/BudgetDetailTabs.tsx` (Section Thông tin Header + Section Hạng mục table CRUD inline auto-compute ThanhTien=KL×ĐG)
|
||||
- [x] `fe-admin/src/components/budgets/BudgetWorkflowPanel.tsx` (Panel 3 timeline activePhases + nextPhases buttons + Dialog comment + Approvals/Changelog)
|
||||
- [x] Mirror tất cả sang `fe-user/`
|
||||
- [x] App.tsx routes `/budgets`, `/budgets/new`, `/budgets/:id` cả 2 app
|
||||
- [x] Menu resolver `Bg_*` (Bg_List → `/budgets`, Bg_Pending → `/budgets?phase=Pending`, Bg_Create → `/budgets/new`)
|
||||
|
||||
### B. PE/Contract → Budget integration
|
||||
### B. PE/Contract → Budget integration — done ✅
|
||||
|
||||
- [ ] **PE form** thêm field `Ngân sách` select Budget (filter Phase=DaDuyet, NamNganSach=current, ProjectId match)
|
||||
- [ ] **Contract form** tương tự — link sang Budget cho đối chiếu chi phí
|
||||
- [ ] PE Detail tab thêm cột "So với ngân sách" — compute từ BudgetDetail tương ứng (match GroupCode + ItemCode)
|
||||
- [x] **PE form** + Select "Ngân sách" filter Phase=DaDuyet, ProjectId match, BE validate
|
||||
- [x] **Contract form** (Header + Edit) tương tự, EditForm read-only link card khi !isDraft
|
||||
- [x] PE Detail Hạng mục thêm cột "NS link · Δ" — match per-row qua `groupCode|itemCode` + footer aggregate (xanh dưới / đỏ vượt / xám khớp)
|
||||
- [x] PE Detail UI restructure 4 section đánh số match form spec PHIẾU TRÌNH KÝ
|
||||
- [x] BE: BudgetSummaryDto shared + Create/Update PE+Contract commands + BudgetId? + GetQueries load Budget
|
||||
- [x] CreateContractFromEvaluation carry forward pe.BudgetId → contract.BudgetId
|
||||
|
||||
### C. Budget refinement (when needed)
|
||||
### C. PE Workflow Designer admin UI — done ✅
|
||||
|
||||
- [ ] Budget MaNganSach atomic sequence — chốt format chính thức rồi thêm `AddBudgetCodeSequences` migration + `IBudgetCodeGenerator` SERIALIZABLE pattern (mirror Contract/PE)
|
||||
- [ ] Budget versioned workflow — admin config UI nếu Solutions cần custom step approver beyond default 3-step
|
||||
- [x] BE `PeWorkflowAdminFeatures.cs` ~250 LOC mirror Contract pattern
|
||||
- [x] BE `PeWorkflowsController` 2 endpoint reuse policy `Workflows.*`
|
||||
- [x] FE `PeWorkflowsPage.tsx` ~500 LOC + designer dialog (clone/edit/+Role/+User)
|
||||
- [x] App.tsx route `/system/pe-workflows/:typeCode`
|
||||
|
||||
### D. Ý kiến 4 phòng ban — done ✅
|
||||
|
||||
- [x] Migration 15 `AddPurchaseEvaluationDepartmentOpinions` (UNIQUE PEId+Kind)
|
||||
- [x] Domain entity + enum `PeDepartmentKind` (PheDuyet/Ccm/MuaHang/SmPm)
|
||||
- [x] BE Upsert (sign=true → set SignedAt+UserId, sign=false giữ chữ ký cũ) + Delete + 2 endpoint
|
||||
- [x] FE Section "5. Ý kiến 4 phòng ban (sign-off)" 2x2 grid OpinionBox
|
||||
|
||||
### E. Tests Phase 1-2 + CI gate — done ✅
|
||||
|
||||
- [x] **Phase 1** — `tests/SolutionErp.Domain.Tests/` (xUnit + FluentAssertions 7.2): 54 test policy state machine (Contract WF + PE WF + Budget) + Registry + FromDefinition versioned + UserKindApprover
|
||||
- [x] **Phase 2** — `tests/SolutionErp.Infrastructure.Tests/` (EF SQLite + TestApplicationDbContext override `nvarchar(max) → TEXT`): 17 test code generator format + sequence + year boundary + persistence verify
|
||||
- [x] CI gate `.gitea/workflows/deploy.yml` — 2 step `dotnet test` trước build, fail → no deploy
|
||||
- [x] Total 71 test pass / ~2s
|
||||
- [x] Session log + commit + push
|
||||
|
||||
## 📝 Phase 9 — UAT + Ops + carry over (Session 6+ active)
|
||||
|
||||
### A. Hard blockers (chờ user / ops)
|
||||
|
||||
- [ ] UAT thật 1 tuần với 2-3 user (30 demo: 16 sample + 14 Solutions thật)
|
||||
- [ ] SMTP config → Email outbox (BLOCKED chờ user cấp host/user/pass)
|
||||
- [ ] Rotate credentials (admin + 30 demo + SA + vrapp + JWT secret + Gitea runner token)
|
||||
- [ ] Schedule SQL backup daily Task Scheduler
|
||||
|
||||
### B. PE feature gap còn lại
|
||||
|
||||
- [ ] Export phiếu PDF/Excel — `IDocumentConverter` + template `PE-TrinhDuyet.docx` (user pending — không quan trọng lắm)
|
||||
|
||||
### C. Optional polish (làm khi UAT phát sinh)
|
||||
|
||||
- [ ] Budget MaNganSach atomic sequence + migration `AddBudgetCodeSequences`
|
||||
- [ ] Budget versioned workflow + migration `AddBudgetVersionedWorkflow`
|
||||
- [ ] Payment terms PE tách field (JSON → 6 column)
|
||||
- [ ] Auto-map PE Details → Contract Details khi gen HĐ
|
||||
- [ ] Matrix Quotes bulk paste từ Excel
|
||||
- [ ] fe-user Inbox thêm section "Phiếu Duyệt NCC chờ tôi"
|
||||
|
||||
### 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
|
||||
|
||||
### E. Ops chưa xong
|
||||
|
||||
- [ ] Remove binding cũ `.huypham.vn` sau verify stable
|
||||
- [ ] win-acme scheduled task fix unhealthy (cert expire 2026-06-18)
|
||||
|
||||
## 🔁 Skill governance (recurring)
|
||||
|
||||
@ -142,7 +195,7 @@ Quy tắc: `docs/rules.md §9`. Audit định kỳ mỗi đầu tháng — workf
|
||||
|
||||
Cron task `solution-erp-skill-audit-monthly` fire 9:00 AM ngày 1 mỗi tháng.
|
||||
|
||||
## 📦 Post-launch (Phase 9+ — future)
|
||||
## 📦 Post-launch (Phase 10+ — future)
|
||||
|
||||
- [ ] **Email outbox** (MailKit + SMTP) — blocked chờ SMTP config
|
||||
- [ ] E-signature integration (VNPT CA hoặc FPT CA)
|
||||
|
||||
Reference in New Issue
Block a user