Files
solution-erp/docs/changelog/migration-todos.md
pqhuy1987 e71e0eba65
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m53s
[CLAUDE] Docs: tai cau truc cleanup — archive raw, compact migration-todos, update CLAUDE+flows
User request: 'review cap nhat va tai cau truc lai MD sao cho phu hop
voi hien tai, cac phan thua va da dieu chinh co the bo ra luon hoac
cap nhat lai'.

Cleanup highlights:
1. Archive 2 file Phase 0 raw dump → docs/_archive/ (forms-spec-raw 657
   line + workflow-raw 62 line). Update link reference 2 file goc.
2. Compact migration-todos.md 386 → 114 line (-71%). Collapse Phase 0-5
   + Tier 3 + Sessions detailed thanh 1 bang summary. Detail xem session
   logs. Phase 6 iter 1+2 + Phase 7 active checklist.
3. Compact STATUS.md In Progress: bo ~17 row  done (giu chỉ 5+ task
   pending: 3 PE feature gap + 4 optional polish + 2 Ops). Recently Done
   table giu day du history.
4. Update flows/README — tat ca 6 flow  Implemented + them PE row
   reference architecture.md §9.
5. Update docs/CLAUDE.md — project layout co PurchaseEvaluations, _archive,
   skills 6 (3 dom + 3 ops). Roadmap them Phase 6  + Phase 7 WIP. Lien
   he them prod URL solutions.com.vn + SSH config + login admin.
6. Skill ef-core-migration: 13 migration label.

Net delta: -800 line docs (chu yeu archive + collapse migration-todos).
2026-04-25 14:17:53 +07:00

6.7 KiB
Raw Blame History

Migration To-dos — Atomic Roadmap

Tick [x] khi xong. Phase 0-5 + Tier 3 đã DONE — collapsed. Detail xem session logs trong docs/changelog/sessions/. Active work: Phase 6 (đã ) + Phase 7 (WIP).

Phase 0-5 + Tier 3 — Done (2026-04-21..22)

Phase Focus Trạng thái
0 Draft Scaffold .NET 10 + 2 Vite + parse FORM/QT + docs
1 Alpha Core Auth + 12 role + Permission Matrix + 3 master CRUD + Contract draft
2 Form Engine OpenXml + ClosedXML render + LibreOffice PDF + DynamicForm
3 Workflow State machine 9 phase + RG-001 code gen + SLA job + attachments + SignalR realtime
4 Reporting Dashboard KPI + Excel export + MyDashboard role-aware + brand identity #1F7DC1
5 Production CI/CD Gitea Actions + 3 IIS site + Let's Encrypt + Security headers + Users CRUD
Tier 3 Versioned workflow + 3-panel layout + 4-bảng overhaul + 4 master catalogs + 16 demo users + RolesPage CRUD + 7 demo HĐ varied

Detail chi tiết: docs/changelog/sessions/2026-04-21-*.md + 2026-04-22-0300-tier3-feature-complete.md + 2026-04-23-*.md.

Phase 6 — Module Duyệt NCC (tiền-HĐ) — Done

Iter 1 (2026-04-23)

  • Migration 12 AddPurchaseEvaluations — 10 bảng (Header/Suppliers/Details/Quotes/Approvals/Changelogs/Attachments/WorkflowDefinitions/Steps/StepApprovers)
  • Domain — 2 enum (Type A/B, Phase 7-state) + Policy record + Registry + FromDefinition builder
  • Seed — 13 menu Pe_/PeWf_ + 2 WorkflowDefinition v01 (QT-DN-A 3-step, QT-DN-B 5-step)
  • Application CQRS ~900 LOC — Create/Update/Transition/List/Inbox/Get/Delete + Supplier CRUD + Detail CRUD + Quote Upsert + SelectWinner + Changelog
  • PurchaseEvaluationWorkflowService — policy guard + approval + notification + changelog
  • PurchaseEvaluationsController — 17 endpoint REST
  • FE 2 app — Types + PurchaseEvaluationsListPage 3-panel + Create page + PeDetailTabs + PeWorkflowPanel + Menu resolver Pe_*
  • Kế thừa HĐ — CreateContractFromEvaluationCommand (guard DaDuyet + SelectedSupplier + !ContractId) → Contract draft. FE CreateContractDialog pick ContractType.
  • Migration 13 AddPurchaseEvaluationCodeSequences — atomic MaPhieu sequence PE/{YYYY}/{A|B}/{Seq:D3}
  • Demo PE seed — 4 phiếu varied phase (A-001/A-002/A-003/B-001) + Pe_* permission defaults 7 role × 9 menu key

Session log: 2026-04-23-2300-purchase-evaluations.md + 2026-04-24-1030-pe-polish-demo-maphieu-perms.md.

Iter 2 — UX polish (2026-04-24)

  • Rename menu "Phương Án" → "Giải pháp" + backfill DB (zero breaking change)
  • Menu tree inheritance extend Pe_/PeWf_ (GetMyMenuTreeQuery + 4 root)
  • Accordion mutex Pe_* groups + sidebar w-72 + label nowrap
  • NavLink active check query string (queryMatches helper) — fix 2 leaf cùng highlight
  • PE detail flat layout: Panel 2 = 4 section (Thông tin/NCC/Hạng mục/Bảng so sánh), Panel 3 += Approvals + Changelog
  • Upload file đính kèm per-NCC (SupplierAttachmentsCell) + Bảng so sánh tổng (GeneralAttachmentsSection, supplierRowId=null) + enum ComparisonTable=4
  • readOnly mode menu "Duyệt" (pendingMe=1) — hide Sửa/Xóa/Thêm/Edit/Upload/Delete, giữ download + transition + comment
  • Contract: move Lịch sử điều chỉnh Panel 2 → Panel 3 (Chi tiết HĐ full-width)
  • Demo email rebrand @solutionerp.local@solutions.com.vn + BackfillUserEmailDomainAsync (idempotent rename 4 field Email/NormalizedEmail/UserName/NormalizedUserName)

Session log: 2026-04-24-chot-session-3-pe-polish.md.

Domain rebrand .huypham.vn.solutions.com.vn (2026-04-24)

  • 18 file repo (FE env + scripts + CI/CD + docs + skill + code comments)
  • scripts/migrate-domains.ps1 (ASCII-only #30) — 3 IIS binding + 3 cert Let's Encrypt + auto HTTPS + redirect
  • CI/CD auto rebuild BE CORS + FE bundle VITE_API_BASE_URL
  • E2E verified 3 domain live + preflight OK

Sub: api.solutions.com.vn · admin.solutions.com.vn · eoffice.solutions.com.vn. Old .huypham.vn vẫn fallback (chưa remove).

📝 Phase 7 — PE feature gap + ops (Session 4)

A. PE feature gap (3 task MISSING)

  • PE Workflow admin designer UI /system/pe-workflows/:typeCode
    • BE Application/PurchaseEvaluations/PeWorkflowAdminFeatures.cs (mirror WorkflowAdminFeatures.cs)
    • Api/Controllers/PeWorkflowsController.cs
    • FE fe-admin/src/pages/system/PeWorkflowsPage.tsx + PeWorkflowDesigner.tsx
    • Route /system/pe-workflows/:typeCode (menu PeWf_* + resolver đã sẵn)
  • Ý kiến 4 phòng ban (Phê duyệt / P.CCM / P.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
    • UX: 4 box sign-off như Excel mẫu
  • Export phiếu PDF/Excel — tái dùng IDocumentConverter + template PE-TrinhDuyet.docx

B. Optional polish

  • Auto-map PE Details → Contract per-type Details khi gen HĐ (phức tạp vì 7 schema khác nhau)
  • Payment terms tách field từ JSON → 6 column (Tạm ứng/TT tạm/Quyết toán/Bảo hành/Hạn mức/Đánh giá)
  • Matrix Quotes bulk paste từ Excel
  • fe-user Inbox thêm section "Phiếu Duyệt NCC chờ tôi"

C. Ops

  • Remove binding cũ .huypham.vn sau verify stable: ssh vietreport-vps ; cd C:\solution-erp\scripts ; .\migrate-domains.ps1 -RemoveOld -SkipCert
  • win-acme scheduled task fix unhealthy (cert expire 2026-06-18)
  • UAT thật 1 tuần với 2-3 user
  • SMTP config → Email outbox
  • Rotate credentials (admin + 16 demo + SA + vrapp + JWT)
  • Schedule SQL backup Task Scheduler

Pending migrations

  • AddPePaymentTermFields (nếu chốt UX tách field)
  • AddPeDepartmentOpinions (nếu chọn Option A header columns)

🔁 Skill governance (recurring)

Quy tắc: docs/rules.md §9. Audit định kỳ mỗi đầu tháng — workflow §9.4.

  • Setup ban đầu — 6 skill (3 domain + 3 ops), rules §9 ← 661f859
  • Audit 2026-05-01 — log docs/changelog/skill-audit-2026-05.md
  • Audit 2026-06-01
  • Audit 2026-07-01

Cron task solution-erp-skill-audit-monthly fire 9:00 AM ngày 1 mỗi tháng.

📦 Post-launch (Phase 8+ — future)

  • Email outbox (MailKit + SMTP) — blocked chờ SMTP config
  • E-signature integration (VNPT CA hoặc FPT CA)
  • Tích hợp Bravo / SAP ERP import NCC
  • Mobile app (React Native?) cho BOD duyệt ngoài giờ
  • AI: gợi ý điền form dựa HĐ cũ, OCR scan HĐ đối tác
  • Multi-tenant nếu có công ty thứ 2