# STATUS — Snapshot hiện tại > **Update rule:** trước khi bắt đầu 1 task → ghi row vào `🔥 In Progress`. Xong → chuyển sang `✅ Recently Done`. **Last updated:** 2026-04-21 12:00 ## 📍 Phase hiện tại: **Phase 2 Form Engine (MVP xong)** — sẵn sàng Phase 3 Workflow ## 🔥 In Progress _(không có — tạm nghỉ chờ user approve move on)_ ## ✅ Recently Done (newest on top) | Ngày | Ai | Task | Commit | |---|---|---|---| | 2026-04-21 | Claude | **Phase 2 Form Engine MVP** — BE: ContractTemplate/ContractClause entities + OpenXml + ClosedXML renderer (placeholder `{{field}}`) + FormsController + seed 8 template. FE: FormsPage list + render dialog. `/api/forms/templates/{id}/render` trả file .docx/.xlsx 482KB OK | (sắp commit) | | 2026-04-21 | Claude | **Docs:** `gotchas.md` (17 pitfalls) + update 2 skill (form-engine, permission-matrix) từ placeholder → full spec | (sắp commit) | | 2026-04-21 | Claude | **Phase 1 đợt 2** — BE CRUD Supplier/Project/Department + Permission Matrix + FE 4 page | `54d6c9b` | | 2026-04-21 | Claude | **Docs addition** — `database-guide.md` + `flows/` 6 doc | `49a5f57` | | 2026-04-21 | Claude | **Phase 1 foundation** — BE Clean Arch + Identity + JWT + FE 2 app + login E2E | `702411f` | | 2026-04-21 | Claude | **Phase 0** — scaffold + parse FORM/QUY_TRINH + docs + git init | `25dad7f` | Session logs: - [`changelog/sessions/2026-04-21-1045-phase0-scaffold.md`](changelog/sessions/2026-04-21-1045-phase0-scaffold.md) - [`changelog/sessions/2026-04-21-1100-phase1-foundation.md`](changelog/sessions/2026-04-21-1100-phase1-foundation.md) - [`changelog/sessions/2026-04-21-1130-phase1-cruds-permission.md`](changelog/sessions/2026-04-21-1130-phase1-cruds-permission.md) - [`changelog/sessions/2026-04-21-1200-phase2-form-engine.md`](changelog/sessions/2026-04-21-1200-phase2-form-engine.md) Gotchas library: [`gotchas.md`](gotchas.md) — 17 pitfalls đã gặp + cách xử lý. ## 🎯 Next up ### Phase 2 iteration 2 (optional — enhance) - [ ] Convert 3 file `.doc` (retry Word COM với timeout, hoặc LibreOffice headless) - [ ] Field spec JSON mỗi template + dynamic form builder FE - [ ] Support `{{#loop}}...{{/loop}}` cho table lặp - [ ] PDF convert via LibreOffice - [ ] Admin upload template UI (POST multipart) ### Phase 3 — Workflow (sắp tới, item lớn) Xem [`docs/flows/contract-approval-flow.md`](flows/contract-approval-flow.md) + [`docs/workflow-contract.md`](workflow-contract.md). Summary: - [ ] Entity: Contract + ContractApproval + ContractComment + ContractAttachment - [ ] `IContractWorkflowService` với state guard + role guard - [ ] `IContractCodeGenerator` RG-001 + transaction SERIALIZABLE - [ ] `SlaExpiryJob` BackgroundService - [ ] Email + in-app notification service - [ ] API `POST /api/contracts/{id}/transitions` - [ ] FE Inbox + Contract detail page + timeline UI ### Optional (không block Phase 3) - [ ] FE Users management + Roles CRUD (cho test permission với non-admin role) - [ ] fe-user sync menu động (đang hardcode) ## 📊 Thông số cumulative | | Phase 0 | +Phase 1f | +Phase 1.2 | +Docs | +Phase 2 MVP | |---|---:|---:|---:|---:|---:| | BE LOC | 0 | ~400 | ~1500 | — | ~1900 | | DB tables | 0 | 7 | 12 | — | 14 | | API endpoints | 0 | 4 | ~20 | — | ~23 | | Migrations | 0 | 1 | 3 | — | 4 | | FE pages | 0 | 2 | 6 | — | 7 | | Docs files | 10 | 13 | 14 | 21 | 24 | | Commits | 1 | 2 | 3 | — | 5 (sắp) | ## 🚨 Blockers / risks - ⏳ **Gitea remote URL** — user sẽ cấp sau - ⚠️ **3 file .doc** chưa convert (IsActive=false) — retry Word COM với timeout/`DisplayAlerts=0` hoặc LibreOffice - ⚠️ **fe-user** chưa đồng bộ menu động (chỉ fe-admin đã chuyển) — quick fix lúc Phase 3 ## Credentials + URLs ``` admin@solutionerp.local / Admin@123456 ``` - API: http://localhost:5443 — Swagger `/swagger` - Admin FE: http://localhost:8082 - User FE: http://localhost:8080