User request: 'Chot lai toan bo MD de sang session moi'. Session 3 (2026-04-24) — ~15 commit feat/fix PE module + domain migration: - Domain 3 subdomain huypham.vn → solutions.com.vn E2E live - PE rename 'Phuong An' → 'Giai phap' + backfill DB - Menu tree inheritance extend Pe_*/PeWf_* - Accordion mutex Pe_* + sidebar w-72 + label nowrap - NavLink queryMatches (fix 2 leaf cung highlight) - PE detail flat layout: Panel 2 = 4 section, Panel 3 + approvals/history - Upload file dinh kem per-NCC (SupplierAttachmentsCell) + Bang so sanh tong - readOnly mode menu 'Duyet' (pendingMe=1) - HD move Lich su dieu chinh → Panel 3 - Demo email rebrand @solutionerp.local → @solutions.com.vn + BackfillUserEmailDomain Docs updated (6 file): - STATUS.md: +9 row Recently Done session 3. In Progress tick 10+ done. Phase hien tai = 'UX polish hoan thien, UAT-ready'. - HANDOFF.md: TL;DR session 3 summary. Priority 0 = 3 task MISSING cuoi (Designer UI, Y kien 4 phong ban, Export PDF). Login email moi. - gotchas.md: +5 entry (#34 NavLink query, #35 menu inheritance extend, #36 Vite env rebuild, #37 PS 5.1 ASCII, #38 Identity rename 4 field) + checklist debug +5 entry. - ef-core-migration SKILL: migration 13 AddPurchaseEvaluationCodeSequences + Phase 6 update section (ComparisonTable enum + BackfillUserEmail). - skills/README: ef-core-migration 13 migration label updated. - docs/changelog/sessions/2026-04-24-chot-session-3-pe-polish.md: session log 15 commit + bugs + stats + next priorities session 4. Memory project_solution_erp.md: Phase 6 iter 2 DONE. Domain rebrand DONE. Session 4 priority 3 PE gap remaining. Stats: 47 DB tables (+1 MaPhieu seq), ~113 endpoint (+3 PE attachments), 13 migrations, 38 gotchas, ~85 commits total.
7.2 KiB
Session 2026-04-24 — Chốt session 3: PE polish iter 2 + domain migration + UX refinement
Focus: Xử lý tất cả UX friction user báo trên module PE + rebrand domain @solutionerp.local → @solutions.com.vn + fix bugs phát hiện trong polish workflow. Session 3 kéo dài từ sáng → tối 2026-04-24.
Commits session này (20+ commit quan trọng)
| Commit | Category | Nội dung |
|---|---|---|
66c1a5c |
Domain rebrand | Rebrand 3 subdomain huypham.vn → solutions.com.vn (18 file) + migrate-domains.ps1 |
b93dacf |
Hotfix | migrate-domains.ps1 ASCII-only (gotcha #30 PS 5.1) |
3990066 |
G-084 | localhost → 127.0.0.1 scripts + skill hardening |
0048a2e |
Docs | STATUS + HANDOFF domain migration done |
c48ac21 |
PE polish iter 1 | Demo PE seed 4 phiếu + MaPhieu atomic + Pe_* perm defaults (Migration 13) |
de1ddc2 |
Docs | STATUS backfill commit hash |
7ee105d |
PE rename | Menu "Phương Án" → "Giải pháp" + backfill DB labels |
7783bd6 |
App bug fix | Menu tree inheritance Pe_* + PeWf_* (GetMyMenuTreeQuery extend) |
79398fb |
FE UX | Accordion mutex Pe_* + sidebar w-72 + label nowrap |
fc4b3d6 |
FE bug fix | NavLink active check query string (queryMatches helper) |
68938a5 |
FE UX | PE detail flat layout (Panel 2 = 3 section, Panel 3 + approvals/history) |
d109084 |
PE feature | Upload file đính kèm per-NCC + SupplierAttachmentsCell |
8cf1fe2 |
FE UX | HĐ move Lịch sử điều chỉnh → Panel 3 |
eda9e84 |
PE UX | readOnly mode menu "Duyệt" (pendingMe=1) |
a336997 |
PE feature + rebrand | Bảng so sánh section + demo email rename (+ BackfillUserEmailDomain) |
All pushed Gitea main. Manual deploy VPS qua SSH (build + copy + restart pool)
vì runner queue bận VietReport lúc đầu session.
MD files updated
| File | Change |
|---|---|
docs/STATUS.md |
Phase hiện tại = "UX polish hoàn thiện, UAT-ready". Recently Done +9 row session 3. In Progress cleanup (tick 10+ item done). |
docs/HANDOFF.md |
TL;DR session 3. Priority 0 = 3 task MISSING cuối (Designer UI / Ý kiến 4 phòng ban / Export PDF). Warning login email mới. |
docs/gotchas.md |
Thêm #34-38 (NavLink query / menu inheritance / Vite env / PS ASCII / Identity rename 4 field). Checklist debug +5 entry. |
.claude/skills/ef-core-migration/SKILL.md |
Migration 13 AddPurchaseEvaluationCodeSequences + Phase 6 update section. |
.claude/skills/README.md |
ef-core-migration 13 migration. |
docs/changelog/sessions/2026-04-24-chot-session-3-pe-polish.md |
Session log file này. |
Domain migration E2E (nửa đầu session)
Vấn đề: user trỏ 3 subdomain mới về VPS IP 103.124.94.38:
- api.huypham.vn → api.solutions.com.vn
- admin.huypham.vn → admin.solutions.com.vn
- user.huypham.vn → eoffice.solutions.com.vn
Em SSH vào VPS qua vietreport-vps shortcut (~/.ssh/id_ed25519 key) chạy
migrate-domains.ps1: 3 HTTP binding mới + 3 cert Let's Encrypt (HTTP-01 qua
SelfHosting plugin) + auto HTTPS binding + http→https redirect. CI/CD deploy
lại BE với CORS mới (admin/eoffice.solutions.com.vn) + FE bundle với
VITE_API_BASE_URL=https://api.solutions.com.vn.
URL cũ .huypham.vn giữ active fallback — remove sau 1-2 ngày verify.
UX polish iter 2 (nửa sau session)
User feedback liên tục qua screenshot + chat. Em fix từng vấn đề:
- "menu đổi Phương Án → Giải pháp" → backfill MenuItems + WorkflowDefinition Name
- "bấm cái trên cái dưới cũng nhảy" → accordion mutex Pe_*
- "QUY TRÌNH CHỌN THẦU PHỤ - NCC wrap" → sidebar w-72 + nowrap
- "2 cái cùng highlight" → NavLink queryMatches
- "cho 1 màn hình, duyệt + lịch sử sang panel 3" → PE flat layout
- "upload file cho từng NCC để đối chiếu" → SupplierAttachmentsCell
- "Lịch sử điều chỉnh sang dưới Lịch sử duyệt" → ContractDetailContent move
- "menu Duyệt chỉ để duyệt thôi, không action" → readOnly prop
- "Bảng so sánh file tổng" → GeneralAttachmentsSection
- "demo user theo email bên này" → rename @solutions.com.vn + backfill
Mỗi vấn đề: ~1-2 commit, manual deploy, verify external qua curl.
Bug gặp + fix
| Bug | Fix |
|---|---|
Admin có PurchaseEvaluations.Read mà Pe_* menu children không hiện |
GetMyMenuTreeQuery extend inherit switch cho 2 root mới (#35) |
| 2 NavLink cùng pathname highlight | Custom isActive + queryMatches helper (#34) |
| PS 5.1 fail parse migrate-domains.ps1 UTF-8 diacritics | ASCII-only rewrite (#30, #37) |
| Gitea runner queue bận → deploy commit PE chưa apply | Manual SSH build + deploy bypass CI |
Domain cũ .huypham.vn vẫn active → duplicate user data risk |
Backfill rename in-place thay vì create new user |
| Identity login 401 sau rename email chỉ Email field | Update 4 field Email/NormalizedEmail/UserName/NormalizedUserName (#38) |
Stats cuối session 3
| Đầu session 3 | Cuối session 3 | Δ | |
|---|---|---|---|
| BE LOC | ~11100 | ~11900 | +800 (attachments + backfill) |
| DB tables | 46 | 47 | +1 (PurchaseEvaluationCodeSequences) |
| Migrations | 12 | 13 | +1 |
| API endpoints | ~110 | ~113 | +3 (PE attachments) |
| FE components | many | + SupplierAttachmentsCell + GeneralAttachmentsSection | +2 |
| Gotchas | 33 | 38 | +5 |
| Commits | 59 | ~85 | +26 (session 3 heavy) |
| Skills | 6 | 6 | 0 (audit + refresh) |
Next session priority (Session 4)
Hard blockers vẫn còn (user/ops)
- UAT thật 1 tuần 2-3 user
- SMTP config → Email outbox
- Rotate credentials (admin + 16 demo + SA + vrapp + JWT)
- Schedule SQL backup Task Scheduler
- Remove binding cũ
.huypham.vnsau verify (-RemoveOld -SkipCert) - win-acme scheduled task fix unhealthy
PE feature gap (3 task MISSING)
- PE Workflow admin designer UI
/system/pe-workflows/:typeCode - Ý kiến 4 phòng ban section trong tab Thông tin
- Export phiếu PDF/Excel tái dùng IDocumentConverter
Optional polish
- Payment terms JSON → 6 field riêng
- Matrix Quotes bulk paste from Excel
- Auto-map PE Details → Contract 7 per-type Details
- fe-user Inbox thêm section "Phiếu Duyệt NCC chờ tôi"
- Section "Ý kiến các phòng ban" (Phê duyệt/CCM/MuaHàng/SM-PM)
Audit cron
solution-erp-skill-audit-monthly fire 2026-05-01 9:00 AM (5 ngày nữa).
Self-contained prompt, auto-log vào docs/changelog/skill-audit-2026-05.md.
Notes cho session 4
- Login email mới:
admin@solutions.com.vn/Admin@123456. Old email@solutionerp.localđã bị rename 401. - Demo users 16 người cũng đã rename sang
@solutions.com.vn— passwordUser@123456. - SSH vào VPS qua
ssh vietreport-vps— config ~/.ssh/config host name. Nếu fail2ban lock → wait 60s retry. - Build manual khi CI runner bận:
ssh vietreport-vps 'cd C:\solution-erp ; git pull ; dotnet publish ... ; Stop/Copy/Start pool'. - Gotcha #30 PS 5.1 — mọi .ps1 mới PHẢI ASCII-only. Grep check:
grep -P '[\x80-\xff]' scripts/*.ps1. - PE feature-complete requires 3 task MISSING ở STATUS §A. Designer UI là task lớn nhất (~3-5h work).