[CLAUDE] Docs: chốt session 2 — PE skeleton + G-084 + skill audit
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m55s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m55s
User feedback: "phần Duyệt NCC chưa xong đâu đấy nhé, còn chỉnh nhiều" → mark PE module skeleton (not feature-complete), liệt kê chi tiết chức năng/UX/edge-case còn missing cho session tiếp. Update 7 file: - STATUS.md — phase = "PE skeleton + refinement WIP", In Progress liệt kê 4 nhóm: A Chức năng MISSING (9 item), B UX/Polish (6 item), C Edge case (4 item), D Deploy/Ops (1 item). +G-084 row Recently Done. - HANDOFF.md — TL;DR "PE skeleton, còn chỉnh nhiều" + Priority 0 section cho session tiếp (9 task PE refinement) + cảnh báo runner + G-084. - migration-todos.md — Phase 7 checklist (A/B/C/D nhóm) trước Phase 8 post-launch. Pending migrations: PaymentTermFields + DepartmentOpinions + CodeSequences. - architecture.md — Section 9 PurchaseEvaluation module (ERD + workflow A/B + kế thừa HĐ flow). - CLAUDE.md (root) — 5 file đọc đầu (thêm HANDOFF), Modules table, 12 migration 46 bảng, +PurchaseEvaluation commit scope. - .claude/skills/ — 4 skill cross-ref Phase 6: * README: trạng thái updated với Phase 6 note * contract-workflow: note PE workflow tách table riêng * permission-matrix: +Pe_*/PeWf_* menu keys + TODO grant non-admin * ef-core-migration: 12 migration history + Phase 7 pending - docs/changelog/sessions/2026-04-23-2359-chot-session-pe-skeleton.md — session log full commits + MD files updated + session tiếp priorities + notes (PE là skeleton, runner check, G-084 rule, MaPhieu format).
This commit is contained in:
@ -310,7 +310,61 @@
|
||||
- [ ] **PE Attachments upload** (pattern reuse ContractAttachmentFeatures) — optional
|
||||
- [ ] **Auto-map PE Details → Contract Details per-type** khi gen HĐ — phức tạp vì 7 ContractType schema khác nhau, user điền lại manual — optional
|
||||
|
||||
## Post-launch (Phase 6+ — future)
|
||||
## Phase 7 — PE refinement (session tiếp)
|
||||
|
||||
**User feedback (2026-04-23 tối session 2):** "phần Duyệt NCC chưa xong đâu đấy nhé, còn chỉnh nhiều"
|
||||
|
||||
### A. Chức năng MISSING trong MVP
|
||||
|
||||
- [ ] **PE Workflow admin designer UI** `/system/pe-workflows/:typeCode`
|
||||
- BE `Application/PurchaseEvaluations/PeWorkflowAdminFeatures.cs` — mirror `WorkflowAdminFeatures.cs` (GetOverview + CreateNewVersion)
|
||||
- `Api/Controllers/PeWorkflowsController.cs` — GET overview + POST create-version (`[Authorize(Policy = "PeWorkflows.Create")]`)
|
||||
- FE `fe-admin/src/pages/system/PeWorkflowsPage.tsx` — URL-driven, landing + per-type
|
||||
- FE `fe-admin/src/components/workflow/PeWorkflowDesigner.tsx` — Steps + Approvers modal
|
||||
- Route `/system/pe-workflows/:typeCode` trong App.tsx (menu `PeWf_*` + resolver đã sẵn)
|
||||
- [ ] **PE Attachments upload** — pattern copy từ `ContractAttachmentFeatures.cs`
|
||||
- BE `Application/PurchaseEvaluations/PurchaseEvaluationAttachmentFeatures.cs` (Upload/Download/Delete)
|
||||
- 3 endpoint POST/GET/DELETE `/api/purchase-evaluations/{id}/attachments`
|
||||
- FE `components/pe/PeAttachmentsSection.tsx` — drag-drop với purpose selector
|
||||
- [ ] **Ý kiến 4 phòng ban** (Phê duyệt / P.CCM / P.MuaHàng / SM-PM từ Excel form)
|
||||
- Option A: Thêm 4 text field (NhậnXétPheDuyet/CCM/MuaHang/SmPm) + 4 date field + 4 UserId vào `PurchaseEvaluations` header
|
||||
- Option B: Dùng existing `PurchaseEvaluationApprovals` với roleKind extra field
|
||||
- UX: tab Thông tin hiển thị 4 box sign-off như Excel
|
||||
- [ ] **Payment terms tách field** từ JSON → 6 columns hoặc subtable
|
||||
- Migration `AddPurchaseEvaluationPaymentTerms` — cột/bảng: TamUng%, ThanhToanTam%, QuyetToan%, BaoHanh%, HanMucCongNo, DanhGia
|
||||
- FE form field-based (loại bỏ JSON textarea)
|
||||
- [ ] **Auto-map PE Details → Contract Details khi gen HĐ** (optional — nâng cấp)
|
||||
- 7 mapping function per ContractType (khó vì schema khác biệt)
|
||||
- MVP: skip, user nhập manual
|
||||
- [ ] **Demo PE data seed** — `SeedDemoPurchaseEvaluationsAsync`
|
||||
- 1 NccOnly DaDuyet chưa tạo HĐ (showcase kế thừa button)
|
||||
- 1 NccWithPlan phase ChoCCM (showcase workflow middle)
|
||||
- 1 TuChoi (showcase reject path)
|
||||
- [ ] **MaPhieu format chính thức** — hiện `PE-YYYYMM-XXXX` random. User confirm format + atomic sequence:
|
||||
- Option A: `{ProjectCode}/PE/{yyyy}/{seq:D3}` — atomic via `PurchaseEvaluationCodeSequences` bảng mới
|
||||
- Option B: Tái dùng `ContractCodeSequences` với Prefix = `PE-{yyyy}-{ProjectCode}`
|
||||
|
||||
### B. UX / Polish
|
||||
|
||||
- [ ] Matrix Quotes **bulk paste** từ Excel column giá → paste matrix row
|
||||
- [ ] **Export phiếu PDF/Excel** — tái dùng `IDocumentConverter` + template `PE-TrinhDuyet.docx` upload qua FormsPage
|
||||
- [ ] **Permission grant Pe_* cho non-admin role** — 1 click trong PermissionsPage matrix (Pe_* inherit từ `PurchaseEvaluations.Read` tương tự Contracts inheritance)
|
||||
- [ ] **fe-user Inbox** thêm section "Phiếu Duyệt NCC chờ tôi" (hoặc route `/pe-inbox`)
|
||||
- [ ] **Sidebar accordion fe-user** extend cover `Pe_<code>` (hiện chỉ track `Ct_<code>`)
|
||||
- [ ] **Dashboard** — thêm KPI "PE phiếu chờ tôi", "PE đã duyệt tháng này", "PE cần tạo HĐ"
|
||||
|
||||
### C. Edge case + E2E test
|
||||
|
||||
- [ ] Reject path E2E: DangSoanThao → ChoPurchasing → (CCM reject) → DangSoanThao
|
||||
- [ ] Admin tạo PE workflow v02 sau khi có phiếu pin v01 — invariant test
|
||||
- [ ] Xóa phiếu khi PE.ContractId set — warning dialog
|
||||
- [ ] 2 admin đồng thời tạo v02 cho cùng type — race condition (atomic dealsactivate old)
|
||||
|
||||
### D. Deploy
|
||||
|
||||
- [ ] Verify commit `3990066` apply prod (runner status + `/api/purchase-evaluations` → 401 expected)
|
||||
|
||||
## Post-launch (Phase 8+ — future)
|
||||
|
||||
- [ ] **Email outbox** (MailKit + SMTP) — blocked chờ SMTP config
|
||||
- [x] **Roles CRUD** — admin tạo custom role ngoài 12 hardcoded (commit 072ad6d)
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
# Session 2026-04-23 ~23:59 — Chốt session 2: PE skeleton + G-084 + docs
|
||||
|
||||
**Focus:** Chốt toàn bộ MD trước khi sang session mới. PE module còn
|
||||
CHỈNH NHIỀU (user nhấn mạnh), G-084 hardening apply preemptively.
|
||||
|
||||
## Commits session này (7 total)
|
||||
|
||||
| Commit | Nội dung |
|
||||
|---|---|
|
||||
| `2c6f0ca` | Domain+Infra — 10 bảng PE + migration 12 + seed menu/workflow |
|
||||
| `4678d19` | App+Api — PurchaseEvaluation CQRS (~900 LOC) + Controller 15 endpoint + WorkflowService |
|
||||
| `a737196` | FE 2 app — PE pages (List/Create/Detail tabs) + menu resolver Pe_*/PeWf_* |
|
||||
| `a385d70` | Kế thừa HĐ — CreateContractFromEvaluationCommand + FE dialog pick ContractType |
|
||||
| `aaf03be` | Docs Phase 6 — STATUS/HANDOFF/schema-diagram/migration-todos/session log |
|
||||
| `3990066` | G-084 hardening — localhost → 127.0.0.1 scripts + skill + gotcha #33 |
|
||||
| `(this)` | Chốt session — STATUS/HANDOFF/migration-todos/skills/CLAUDE/architecture |
|
||||
|
||||
Tất cả đã push lên Gitea `main`. Runner cần verify apply deploy.
|
||||
|
||||
## MD files updated
|
||||
|
||||
| File | Changes |
|
||||
|---|---|
|
||||
| `docs/STATUS.md` | Phase hiện tại + In Progress PE refinement (nhóm A/B/C/D), +G-084 row Recently Done |
|
||||
| `docs/HANDOFF.md` | TL;DR session 2 + Priority 0 PE refinement + cảnh báo session tiếp |
|
||||
| `docs/changelog/migration-todos.md` | Phase 7 PE refinement checklist (A/B/C/D) |
|
||||
| `docs/architecture.md` | Section 9 PurchaseEvaluation module (ERD + workflow + kế thừa HĐ) |
|
||||
| `docs/database/schema-diagram.md` | §11 PE module full (done session trước) |
|
||||
| `docs/gotchas.md` | #33 G-084 IPv4/IPv6 port hijack (done session trước) |
|
||||
| `CLAUDE.md` (root) | Scope commit `PurchaseEvaluation`, 5 file đọc đầu, 12 migration, 46 bảng, modules table |
|
||||
| `.claude/skills/README.md` | 3 skill cross-ref Phase 6 PE |
|
||||
| `.claude/skills/contract-workflow/SKILL.md` | Cross-ref PE workflow separate tables |
|
||||
| `.claude/skills/permission-matrix/SKILL.md` | +Pe_*/PeWf_* menu keys + TODO grant non-admin |
|
||||
| `.claude/skills/ef-core-migration/SKILL.md` | 12 migration history + Phase 7 pending |
|
||||
| `.claude/skills/iis-deploy-runbook/SKILL.md` | +Hardening section G-084 + localhost→127.0.0.1 (done session trước) |
|
||||
|
||||
## Session tiếp cần làm — đọc STATUS.md §🔥 In Progress
|
||||
|
||||
**User feedback khóa chốt:** "phần Duyệt NCC chưa xong đâu đấy nhé, còn chỉnh nhiều"
|
||||
|
||||
### Priority 0 (PE refinement)
|
||||
1. PE Workflow admin designer UI `/system/pe-workflows/:typeCode`
|
||||
2. PE Attachments upload (reuse ContractAttachment pattern)
|
||||
3. Ý kiến 4 phòng ban section (Phê duyệt/CCM/MuaHàng/SM-PM)
|
||||
4. Payment terms tách field từ JSON blob → 6 column
|
||||
5. Demo PE data seed
|
||||
6. Permission grant Pe_* cho non-admin role
|
||||
7. MaPhieu format chính thức (user confirm)
|
||||
8. Export PDF/Excel
|
||||
9. Auto-map PE Details → Contract Details (optional)
|
||||
|
||||
### Priority 1 (blockers user/ops)
|
||||
- UAT thật, SMTP, rotate creds, SQL backup schedule
|
||||
- Verify commit 3990066 đã apply prod (runner status)
|
||||
|
||||
### Audit cron
|
||||
- `solution-erp-skill-audit-monthly` fire 2026-05-01 9:00 AM
|
||||
- Log vào `docs/changelog/skill-audit-2026-05.md`
|
||||
|
||||
## Stats cuối session 2
|
||||
|
||||
| | Đầu session 2 | Cuối session 2 | Δ |
|
||||
|---|---:|---:|---:|
|
||||
| BE LOC | ~8800 | ~11100 | +2300 |
|
||||
| DB tables | 36 | 46 | +10 |
|
||||
| Migrations | 11 | 12 | +1 |
|
||||
| API endpoints | ~93 | ~110 | +17 |
|
||||
| FE pages | ~23 | ~26 | +3 × 2 app |
|
||||
| Gotchas | 32 | 33 | +1 (G-084) |
|
||||
| Commits | 52 | 59 | +7 |
|
||||
| Skills | 6 | 6 | 0 (audit + cross-ref) |
|
||||
|
||||
## Notes cho session 3
|
||||
|
||||
1. **PE là skeleton** — đừng treat as feature-complete. Ưu tiên Priority 0.
|
||||
2. **Runner VPS có thể stopped** sau khi restart — check trước khi debug "endpoint 404".
|
||||
3. **G-084 rule** áp dụng mọi service mới: `127.0.0.1` thay `localhost` trong reverse proxy / backend bind.
|
||||
4. **Workflow audit** cron đã set — không cần manual trigger trừ khi có skill mới thêm nhiều.
|
||||
5. **MaPhieu PE** hiện random — PHẢI confirm format với user trước khi seed demo data hoặc go-live thật.
|
||||
6. **Không fix localhost trong FE dev configs** (vite.config.ts, launchSettings.json, docs dev-only) — đó là dev context, risk zero. Chỉ fix prod deploy/proxy paths.
|
||||
Reference in New Issue
Block a user