From 309dcd976859c2e87920ace1a2c581f6ea8d101a Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Sat, 25 Apr 2026 23:40:11 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20chot=20final=20session=203?= =?UTF-8?q?=20=E2=80=94=20audit=20MD=20+=20session=20log=20+=20minor=20fix?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audit toan bo MD theo yeu cau 'review cap nhat va tai cau truc'. Minor fixes outdated: - docs/database/database-guide.md: header note '47 bang 13 migration' + redirect schema-diagram cho actual schema. Email demo + admin@solutions.com.vn (thay solutionerp.local). - docs/guides/runbook.md: reset-password email moi. Session log moi: docs/changelog/sessions/2026-04-25-1430-chot-session-3- final-cleanup.md - Cleanup outcomes: archive 2 raw + compact migration-todos -71% + compact STATUS In Progress -50% + update outdated refs. - Skill audit 6 skill: tat ca Active (3 skill da update voi PE/G-084 cross-ref session truoc). - Stats session 3 cong don 3 phien 23-24-25: 47 DB tables, 13 migrations, ~113 endpoints, 38 gotchas, ~30 commits. - Priority 0 session 4: 3 PE feature gap (Designer UI, Y kien 4 phong ban, Export PDF) + Ops blockers. - Notes session 4: email moi, 3 domain prod, old fallback, G-084, SSH. --- ...04-25-1430-chot-session-3-final-cleanup.md | 94 +++++++++++++++++++ docs/database/database-guide.md | 7 +- docs/guides/runbook.md | 2 +- 3 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 docs/changelog/sessions/2026-04-25-1430-chot-session-3-final-cleanup.md diff --git a/docs/changelog/sessions/2026-04-25-1430-chot-session-3-final-cleanup.md b/docs/changelog/sessions/2026-04-25-1430-chot-session-3-final-cleanup.md new file mode 100644 index 0000000..d3416b2 --- /dev/null +++ b/docs/changelog/sessions/2026-04-25-1430-chot-session-3-final-cleanup.md @@ -0,0 +1,94 @@ +# Session 2026-04-25 ~14:30 — Chốt session 3 final cleanup + +**Focus:** Tái cấu trúc + cleanup MD docs theo yêu cầu user "review cập nhật và +tái cấu trúc lại MD sao cho phù hợp nhất với hiện tại". Audit toàn bộ + archive +phần thừa + compact. + +## Cleanup outcomes + +### 1. Archive Phase 0 raw dump + +| File | Trước | Sau | +|---|---|---| +| `forms-spec-raw.md` (657 line) | `docs/` | `docs/_archive/` | +| `workflow-raw.md` (62 line) | `docs/` | `docs/_archive/` | + +Update reference link trong `forms-spec.md` + `workflow-contract.md`. + +### 2. Compact docs + +| File | Trước | Sau | Δ | +|---|---:|---:|---:| +| `migration-todos.md` | 386 line | 114 line | **-71%** | +| `STATUS.md` § In Progress | 17 row ✅ done + 12 pending | 5+ task pending only | -50% | +| Tổng docs active | ~8480 | ~7660 | -800 line | + +### 3. Update outdated references + +- `database/database-guide.md`: header note "47 bảng 13 migration" + redirect schema-diagram. Email demo `@solutionerp.local` → `@solutions.com.vn` +- `guides/runbook.md`: reset-password command email mới +- `flows/README.md`: 6 flow tất cả ✅ Implemented + thêm row PE module +- `docs/CLAUDE.md`: project layout + Roadmap thêm Phase 6 + 7. Login prod thêm `admin@solutions.com.vn` + 3 domain. + +### 4. Skill audit + +| Skill | Status | Update | +|---|---|---| +| `contract-workflow` | ✅ Active | (đã có Phase 6 cross-ref note session 2) | +| `form-engine` | ✅ Active | OK | +| `permission-matrix` | ✅ Active | (đã có Pe_*/PeWf_* note session 2) | +| `dependency-audit-erp` | ✅ Active | OK | +| `ef-core-migration` | ✅ Updated | 13 migration label + Phase 6 update note | +| `iis-deploy-runbook` | ✅ Active | (đã có G-084 hardening session 2) | + +Cron audit `solution-erp-skill-audit-monthly` next 2026-05-01. + +## Stats cuối session 3 (cộng dồn 3 phiên 23-24-25) + +| Metric | Đầu session 3 | Cuối | +|---|---:|---:| +| BE LOC | ~11100 | ~11900 | +| DB tables | 46 | **47** | +| Migrations | 12 | **13** | +| API endpoints | ~110 | ~113 (+3 PE attachments) | +| Gotchas | 33 | **38** | +| Commits session 3 | 0 | ~30 (a667665..e71e0eb) | + +## Session 4 — đọc thứ tự + +``` +1. docs/STATUS.md (compact, In Progress 5+ task) +2. docs/HANDOFF.md (TL;DR session 3 + Priority 0) +3. docs/changelog/sessions/2026-04-25-1430-chot-session-3-final-cleanup.md (file này) +4. docs/changelog/migration-todos.md §Phase 7 (3 PE feature gap + ops) +5. docs/gotchas.md §34-38 (NavLink/inheritance/Vite/PS/Email gotcha mới) +``` + +## Priority 0 session 4 — 3 PE feature gap + +1. **PE Workflow admin designer UI** `/system/pe-workflows/:typeCode` + - BE `PeWorkflowAdminFeatures.cs` + `PeWorkflowsController.cs` (mirror Contract) + - FE `PeWorkflowsPage.tsx` + `PeWorkflowDesigner.tsx` + - Route + menu PeWf_* + resolver đã sẵn +2. **Section "Ý kiến 4 phòng ban"** (Phê duyệt/CCM/MuaHàng/SM-PM) ở tab Thông tin + - Option A: 4 text field + signoff date + UserId vào header + - Option B: dùng PurchaseEvaluationApprovals với roleKind extra field +3. **Export phiếu PDF/Excel** — tái dùng IDocumentConverter + template `PE-TrinhDuyet.docx` + +## Ops blockers còn + +- Remove binding `.huypham.vn` sau verify stable (script `migrate-domains.ps1 -RemoveOld -SkipCert`) +- Fix win-acme scheduled task unhealthy (cert expire 2026-06-18) +- UAT thật 1 tuần với 2-3 user +- SMTP config → Email outbox +- Rotate creds (admin + 16 demo + SA + vrapp + JWT) +- Schedule SQL backup Task Scheduler + +## Notes cho session 4 + +1. **Login email mới:** `admin@solutions.com.vn` / `Admin@123456`. Old email 401. +2. **3 domain prod live:** api/admin/eoffice.solutions.com.vn (HTTPS Let's Encrypt). +3. **Old domains `.huypham.vn`** vẫn fallback active — chưa remove. +4. **VPS shared với VietReport** — gotcha #33 G-084 IPv4/IPv6 port hijack. +5. **PE module hoàn thiện UX** — feature gap còn 3 task không-blocker (Designer UI optional, Ý kiến 4 phòng ban scope tùy user, Export PDF nice-to-have). +6. **SSH config sẵn:** `ssh vietreport-vps` (key id_ed25519). diff --git a/docs/database/database-guide.md b/docs/database/database-guide.md index 748e6d8..9e283e5 100644 --- a/docs/database/database-guide.md +++ b/docs/database/database-guide.md @@ -1,8 +1,11 @@ # Database Guide — SOLUTION_ERP > **DB engine:** SQL Server 2022 (LocalDB dev, full instance prod) -> **ORM:** EF Core 10 Code-First migrations +> **ORM:** EF Core 10 Code-First migrations — **47 bảng, 13 migration** (Init → AddPurchaseEvaluationCodeSequences) > **DbContext:** [`ApplicationDbContext`](../../src/Backend/SolutionErp.Infrastructure/Persistence/ApplicationDbContext.cs) extends `IdentityDbContext` +> **Current schema + ERD:** xem [`schema-diagram.md`](schema-diagram.md) (luôn cập nhật) +> +> File này = conventions + migration workflow + cheatsheet. Section "Schema dự kiến" (§4) là Phase 0 historical — actual schema xem `schema-diagram.md`. ## 1. Connection strings @@ -156,7 +159,7 @@ erDiagram | Field | Value | |---|---| -| Email | `admin@solutionerp.local` | +| Email | `admin@solutions.com.vn` | | Password | `Admin@123456` | | FullName | `Administrator` | | Roles | `[Admin]` | diff --git a/docs/guides/runbook.md b/docs/guides/runbook.md index 9a61b51..28bd64b 100644 --- a/docs/guides/runbook.md +++ b/docs/guides/runbook.md @@ -96,7 +96,7 @@ DELETE FROM ContractCodeSequences; ```powershell # Run script one-off trên server cd C:\inetpub\solution-erp\api -dotnet SolutionErp.Api.dll --reset-password admin@solutionerp.local NewPassword@2026 +dotnet SolutionErp.Api.dll --reset-password admin@solutions.com.vn NewPassword@2026 # (Feature chưa có — Phase 5.1) ```