[CLAUDE] Docs+Memory: S32 Phase 10 backlog Plan G NamGroup port + 4 sub-agent startup entries

migration-todos.md: insert Phase 10 detail section (10 Plan G-* atomic per-module sprint
~3 thang T6-T8/2026 target, aggressive multi-agent parallel ROI ~70%). 4 quyet dinh anh
chot S32: FULL 11 module scope + single schema dbo mo rong Mig 34-42 + reuse Workflow
V2 extend ApplicableType +5 values + chunk per-module Plan rieng. Sequence Phase 9
stabilize first per anh main "tuan tu theo ke hoach tot nhat". G-P1 pure web GPS
check-in (no device). G-H2 seed reference NamGroup demo data.

4 MEMORY sub-agent: append S32 startup entry (Investigator + Implementer + Reviewer +
CICD Monitor) ghi nhan S31 RAG retrieval.py fix + S29 Plan CA+B deploy + Pending tasks
anh main co the SendMessage reuse. Implementer 36.2KB OVER 25KB threshold FLAG curate.

Refs: docs/CLAUDE.md Phase 6-9 done. docs/STATUS.md S31 wrap. gotcha #51 INFRASTRUCTURE
vs DEMO seed gate (Phase 10.3 enum extend caution). gotcha #52 qdrant.search removed
(RAG layer stable post-S31 fix).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-26 16:17:36 +07:00
parent f938bf57f5
commit b832f43d8e
5 changed files with 145 additions and 6 deletions

View File

@ -576,11 +576,144 @@ Quy tắc: `docs/rules.md §9`. Audit định kỳ mỗi đầu tháng — workf
Cron task `solution-erp-skill-audit-monthly` fire 9:00 AM ngày 1 mỗi tháng.
## 📦 Post-launch (Phase 10+ — future)
## 🚀 Phase 10 — Plan G: Port 11 module NamGroup → SOL (backlog defer sau Phase 9 stabilize)
- [ ] **Email outbox** (MailKit + SMTP) — blocked chờ SMTP config
> **Trigger:** S32 anh main yêu cầu plan kỹ 11 module NamGroup (NHÂN SỰ + VĂN PHÒNG SỐ + CÁ NHÂN — khung đỏ screenshot 2026-05-26). **4 quyết định chốt anh main:**
> 1. **Scope:** FULL 11 module (3 nhóm — không subset)
> 2. **DB:** Single schema `dbo` mở rộng Mig 34→43+ (no multi-schema, no separate DbContext)
> 3. **Reuse:** Workflow Engine V2 (Mig 22-26) extend `ApplicableType` enum +5 values cho Đề xuất/Đơn từ/OT/Đặt xe/Ticket CNTT
> 4. **Rollout:** Chunk per-module Plan riêng (10 Plan G-* atomic sprint ~3-5 ngày mỗi cái), aggressive multi-agent parallel ROI ~70%
>
> **Sequence chốt anh main S32:** Tuần tự theo kế hoạch tốt nhất — Phase 9 UAT stabilize trước → Phase 10.1 kick off. KHÔNG rush parallel với Phase 9.
> **Timeline target:** ~3 tháng (T6-T8/2026) realistic với multi-agent aggressive.
> **G-P1 Chấm công scope:** Pure web GPS check-in (KHÔNG máy vân tay/face recog hiện tại — anh chốt "tạm thời vậy trước").
> **G-H2 HrmConfig seed:** Reference NamGroup demo seed (LeaveTypes/Holidays/Shifts/OtPolicy) — Investigator audit NamGroup `DbInitializer` + `DataSeeder` lúc G-H2 kick off.
### 📐 Reference findings từ NamGroup audit S32
| NamGroup pattern | Decision SOL |
|---|---|
| `TblNhanVien*` 8+ bảng (QtCongTac/QtDaoTao/QuanHeThanNhan/KyNangViTinh/...) | Giữ structure deep — 1 main + N satellites (EmployeeProfile family) |
| `SoDoToChuc`/`SoDoKhoi`/`ChucDanh`/`ViTri` 4 bảng org chart | Tận dụng SOL `Department` + `User.Position` + `PositionLevel` — skip 3 bảng SoDo redundant |
| `Tbl*` Vietnamese table naming + Repository pattern .NET FW 4.0 | Reject — giữ SOL Clean Arch + Entity PascalCase English + IApplicationDbContext |
| WF approval ad-hoc per module | Reject — reuse `ApprovalWorkflow V2` extend enum +5 values |
| Announcement/InternalDocument/Menu flat tables | Adapt — reuse SOL `MenuItem` tree + `Notification` + Attachment infra |
### Phase 10.1 — Foundation HRM (UNBLOCK toàn bộ Phase 10 sau)
#### Plan G-H1 — Hồ sơ nhân sự ⭐ CRITICAL FIRST (depend by 8/11 module sau)
- [ ] 🟦 Investigator pre-flight audit NamGroup `TblNhanVien*` 8 bảng + map fields → SOL EmployeeProfile schema
- [ ] 👤 Chủ trì Solo design Mig 34 `AddEmployeeProfiles` schema (1 main + 5 satellite: WorkHistory/Education/FamilyRelation/Skill/Document)
- [ ] 🟨 Implementer Case 2 cookie-cutter BE entity scaffold 6 entity + EF Config + DbInitializer seed 30 demo profile mirror 30 users
- [ ] 🟨 Implementer Case 2 mirror PE handler BE CQRS Create/Update/GetDetail/List + 6 endpoint controller
- [ ] 🟨 Implementer Case 2 cookie-cutter mirror PE FE 2 app types/employee.ts + EmployeesPage 3-panel + EmployeeDetailTabs (6 section: Cơ bản/Công tác/Đào tạo/Thân nhân/Kỹ năng/Hồ sơ)
- [ ] 👤 Chủ trì Solo Permission menu `Hrm_HoSo*` (List/Create/Detail) + Permission Matrix seed
- [ ] 🟥 Reviewer pre-commit + 🟩 CICD Monitor post-deploy verify
#### Plan G-H2 — Cấu hình chung HRM
- [ ] 👤 Chủ trì Solo Mig 35 `AddHrmConfigs` — LeaveTypes + Holidays + ShiftPatterns + OtPolicy lookup tables
- [ ] 🟦 Investigator audit NamGroup demo seed (LeaveTypes/Holidays/Shifts/OtPolicy) — reference cho seed sample data
- [ ] 🟨 Implementer Case 2 mirror SOL Catalogs pattern (Plan CA Chunk B) BE CQRS CRUD 4 catalog
- [ ] 🟨 Implementer Case 2 mirror admin Catalogs FE Admin 4 catalog page (list/create/edit dialog inline)
- [ ] 👤 Chủ trì Solo Permission menu `Hrm_Config*` 4 leaf + admin role assign
### Phase 10.2 — Office Core standalone (KHÔNG cần workflow)
#### Plan G-O1 — Danh bạ nội bộ
- [ ] 👤 Chủ trì Solo BE 1 endpoint `GET /api/directory` — filter dept/position/search name+email+phone (reuse Users + EmployeeProfiles + Departments)
- [ ] 🟨 Implementer Case 2 cookie-cutter FE 2 app InternalDirectoryPage (card grid avatar + dept + extension + email + mobile click-to-call)
- [ ] 👤 Chủ trì Solo Permission `Off_DanhBa` 1 leaf
#### Plan G-O2 — Phòng họp (booking calendar standalone)
- [ ] 👤 Chủ trì Solo Mig 36 `AddMeetingRooms` — MeetingRooms + MeetingBookings (RoomId/UserId/StartAt/EndAt/Title/Attendees[]/Status enum)
- [ ] 🟨 Implementer Case 2 BE CQRS Room CRUD + Booking Create/Cancel + GetCalendar + check conflict (SERIALIZABLE transaction race-safe)
- [ ] 🟨 Implementer Case 2 FE 2 app — Admin Rooms CRUD + User BookingCalendar (FullCalendar lib new dep — check license + bundle size impact)
- [ ] 👤 Chủ trì Solo Notification push attendees when booking created (NotificationPushInterceptor reuse)
- [ ] 👤 Chủ trì Solo Permission `Off_PhongHop*` 3 leaf
### Phase 10.3 — Workflow Apps (extend ApprovalWorkflow V2 enum +5 values)
> ⚠️ PHẢI extend `ApprovalWorkflowApplicableType` enum first: `+ProposalGeneral=4, +LeaveRequest=5, +OtRequest=6, +VehicleBooking=7, +ItTicket=8` (Mig 37 cookie-cutter Mig 22 pattern). Gotcha #51 INFRASTRUCTURE vs DEMO seed gate caution — `SeedSampleWorkflow*` OUT of `DemoSeed:Disabled` flag.
#### Plan G-O3 — Đề xuất (Proposal)
- [ ] 👤 Chủ trì Solo Mig 38 schema + extend `ApplicableType` enum +ProposalGeneral=4
- [ ] 🟨 Implementer Case 2 mirror PE Mig 22-26 BE Proposal entity + ProposalAttachments + workflow pin `ApprovalWorkflowId`
- [ ] 👤 Chủ trì Solo BE ApproveV2Async branch + CodeGen `DX/YYYY/NNN` (cross-stack tight, mirror PE CodeGen)
- [ ] 🟨 Implementer Case 2 cookie-cutter mirror PE Plan B Chunk E1+D+E2+E3 FE 2 app ProposalsList + Create + Detail (Section 1-5)
- [ ] 🟥 Reviewer adversarial Smart Friend pre-commit — ApplicableType=Proposal validate cross-module security catch (gotcha #44 cumulative pattern)
- [ ] 🟩 CICD Monitor post-deploy verify Run + bundle hash rotate
#### Plan G-O4 — Đơn từ (LeaveRequest + OtRequest + TravelRequest)
- [ ] 👤 Chủ trì Solo Mig 39 schema 3 entity + extend enum +LeaveRequest=5 +OtRequest=6
- [ ] 🟨 Implementer Case 2 ×3 spawn parallel BE 3 entity scaffold + CQRS handler mirror PE cookie-cutter
- [ ] 👤 Chủ trì Solo BE LeaveBalance calculation (Hrm_Config LeaveTypes + EmployeeProfile.HireDate seniority) — business logic tight
- [ ] 🟨 Implementer Case 2 ×3 FE 2 app 3 page mirror cookie-cutter
- [ ] 🟥 Reviewer pre-commit + 🟩 CICD verify
#### Plan G-O5 — Đặt xe công (VehicleBooking)
- [ ] 👤 Chủ trì Solo Mig 40 schema Vehicles + Drivers + VehicleBookings + extend enum +VehicleBooking=7
- [ ] 🟨 Implementer Case 2 mirror G-O2 MeetingRoom + workflow mirror G-O3 BE CRUD + workflow + check conflict + driver assignment
- [ ] 🟨 Implementer Case 2 cookie-cutter FE 2 app
- [ ] 🟥 Reviewer + 🟩 CICD
#### Plan G-O6 — Ticket CNTT (IT Helpdesk)
- [ ] 👤 Chủ trì Solo Mig 41 schema ItTickets + ItTicketComments thread
- [ ] 👤 Chủ trì Solo BE CQRS + Auto-assign round-robin per category + SLA timer warning (business logic tight)
- [ ] 🟨 Implementer Case 2 FE 2 app TicketsList + Detail (thread comment + status board kanban-ish)
- [ ] 👤 Chủ trì Solo Notification SLA expire warning (reuse SlaTimer pattern Contract)
- [ ] 🟥 Reviewer + 🟩 CICD
### Phase 10.4 — Dashboards + Attendance
#### Plan G-H3 — Dashboard Nhân sự (depend H1 data)
- [ ] 👤 Chủ trì Solo BE `GET /api/hr/dashboard` aggregate KPI (TongNV + HDActive + HDExpiring + GenderRatio + Birthday7d + StatusBreakdown)
- [ ] 🟨 Implementer Case 2 cookie-cutter mirror MyDashboard role-aware FE 2 app HrmDashboardPage (4 KPI card + 2 donut chart + birthday timeline)
- [ ] 👤 Chủ trì Solo Permission `Hrm_Dashboard` 1 leaf HR role only
#### Plan G-P1 — Chấm công (Pure web GPS check-in — no device integration per anh chốt S32)
- [ ] 👤 Chủ trì Solo Mig 42 `AddAttendances` — AttendanceLogs (UserId/Date/CheckInAt/CheckOutAt/Source enum Web/Mobile/GPS lat-long/IpAddress/Note)
- [ ] 👤 Chủ trì Solo BE Web GPS check-in endpoint + monthly report calc (OT từ Hrm_Config OtPolicy) — business logic tight
- [ ] 🟨 Implementer Case 2 FE 2 app User MyAttendance (calendar tháng + click-in button GPS prompt) + Admin AttendanceReport (filter dept + export Excel)
- [ ] 🟥 Reviewer + 🟩 CICD
### Stats target Phase 10 end (estimate)
| Metric | Phase 9 | Phase 10 end | Δ |
|---|---|---|---|
| Migrations | 33 | ~42 | +9 (Mig 34-42 batch nhỏ) |
| Tables | 60 | ~85 | +25 |
| Endpoints | ~148 | ~250 | +100 |
| FE pages | 38 | ~60 | +22 |
| AppRoles | 14 | ~18 | +4 (HrAdmin/OfficeAdmin/Driver/ItStaff) |
| Permission menu | ~60 | ~110 | +50 (Hrm_/Off_/Per_) |
| Tests | 111 | ~200 | +90 (Phase 10 test-after UAT + critical algo test-before: workflow guard + CodeGen Proposal + LeaveBalance calc + Attendance OT) |
### Risk + Gotcha cần catch trước Phase 10 kick off
1. **Mig 37 enum extend `ApplicableType`** — gotcha #51 INFRASTRUCTURE vs DEMO seed gate caution
2. **Cross-stack tight cho LeaveBalance + Attendance OT + Ticket Auto-assign** — Implementer REFUSE, em main solo bắt buộc
3. **MeetingRoom + Vehicle conflict check** — race condition 2 user book cùng time slot — SERIALIZABLE transaction mirror Contract gen mã
4. **EmployeeProfile depend by 8/11 module sau** — KHÔNG được rush G-H1, Reviewer adversarial 100% pre-commit
5. **30 demo profile cần seed thật cho 30 user existing** — DbInitializer extend, KHÔNG demo seed gate (infrastructure)
6. **Permission leaf 50 NEW** — admin Designer phải seed cẩn thận tránh broken inheritance tree (gotcha #35)
7. **FullCalendar lib new dep** cho G-O2 + G-O5 + G-P1 — skill `dependency-audit-erp` chạy trước commit
## 📦 Post-launch (Phase 11+ — future, defer Phase 10 done)
- [ ] **Email outbox** (MailKit + SMTP) — blocked chờ SMTP config (Phase 9 hard blocker)
- [ ] 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ờ
- [ ] Mobile app (React Native?) cho BOD duyệt ngoài giờ — depend G-P1 mobile GPS check-in done
- [ ] 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
- [ ] G-P1+ — Chấm công device integration (vân tay/face recog/CSV import) khi anh có máy