[CLAUDE] PurchaseEvaluation: demo seed 4 phieu + MaPhieu atomic sequence + Pe_* perm defaults
Polish session tiep cua PE module skeleton (commit 2c6f0ca..3990066):
3 task A (MISSING in MVP) khac STATUS.md In Progress:
1. Demo PE data seed (SeedDemoPurchaseEvaluationsAsync)
- 4 phieu varied A/B x phase: A-001 DangSoanThao (mo), A-002
ChoCEODuyetNCC (winner+9 quotes), A-003 DaDuyet (chua tao HD,
PaymentTerms JSON), B-001 ChoDuAn (5-step giua chung).
- Idempotent: skip-if-[DEMO]-exists.
- Approval history dung policy A (3-step) hoac B (5-step).
2. MaPhieu atomic sequence — Migration 13
- Format PE/{YYYY}/{TypeLetter}/{Seq:D3} (vd PE/2026/A/001).
- PurchaseEvaluationCodeSequence entity (Prefix PK).
- IPurchaseEvaluationCodeGenerator + impl SERIALIZABLE
transaction (mirror ContractCodeGenerator 1:1).
- Replace Random.Shared trong CreatePurchaseEvaluationCommandHandler.
- Migration AddPurchaseEvaluationCodeSequences (1 bang).
3. Pe_* permission defaults
- SeedPurchaseEvaluationPermissionDefaultsAsync — 7 role business x 9 menu key.
- Drafter/DeptManager/Procurement: R+C+U; CostControl/PM/Director/AuthorizedSigner: R+U.
- DeptManager them Delete (xoa nhap).
- Idempotent per-(roleId x menuKey).
Build: 0 error, 2 warning (pre-existing DocxRenderer).
Files: 4 new + 8 modified (1 migration + entity + generator + DI + 2 ctx + 2 features).
Resolves: STATUS.md In Progress §A — 3 item PE MISSING.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -336,19 +336,29 @@
|
||||
- [ ] **Auto-map PE Details → Contract Details khi gen HĐ** (optional — nâng cấp)
|
||||
- 7 mapping function per ContractType (khó vì schema khác biệt)
|
||||
- MVP: skip, user nhập manual
|
||||
- [ ] **Demo PE data seed** — `SeedDemoPurchaseEvaluationsAsync`
|
||||
- 1 NccOnly DaDuyet chưa tạo HĐ (showcase kế thừa button)
|
||||
- 1 NccWithPlan phase ChoCCM (showcase workflow middle)
|
||||
- 1 TuChoi (showcase reject path)
|
||||
- [ ] **MaPhieu format chính thức** — hiện `PE-YYYYMM-XXXX` random. User confirm format + atomic sequence:
|
||||
- Option A: `{ProjectCode}/PE/{yyyy}/{seq:D3}` — atomic via `PurchaseEvaluationCodeSequences` bảng mới
|
||||
- Option B: Tái dùng `ContractCodeSequences` với Prefix = `PE-{yyyy}-{ProjectCode}`
|
||||
- [x] ✅ **Demo PE data seed** — `SeedDemoPurchaseEvaluationsAsync` (2026-04-24)
|
||||
- A-001 DangSoanThao (Drafter mới mở, chưa có quotes)
|
||||
- A-002 ChoCEODuyetNCC (winner đề xuất + 9 quotes 3×3 grid)
|
||||
- A-003 DaDuyet (chưa tạo HĐ — showcase kế thừa button) + PaymentTerms JSON
|
||||
- B-001 ChoDuAn (5-step giữa chừng)
|
||||
- Idempotent: skip-if-`[DEMO]` exists
|
||||
- [x] ✅ **MaPhieu format chính thức + atomic sequence** (2026-04-24)
|
||||
- Format: `PE/{YYYY}/{TypeLetter}/{Seq:D3}` (TypeLetter = A | B)
|
||||
- `PurchaseEvaluationCodeSequences` bảng mới (Prefix PK, mirror ContractCodeSequences)
|
||||
- `IPurchaseEvaluationCodeGenerator` + impl SERIALIZABLE transaction
|
||||
- Migration 13 `AddPurchaseEvaluationCodeSequences` (1 bảng)
|
||||
- Wired vào CreatePurchaseEvaluationCommandHandler thay Random.Shared
|
||||
|
||||
### B. UX / Polish
|
||||
|
||||
- [ ] Matrix Quotes **bulk paste** từ Excel column giá → paste matrix row
|
||||
- [ ] **Export phiếu PDF/Excel** — tái dùng `IDocumentConverter` + template `PE-TrinhDuyet.docx` upload qua FormsPage
|
||||
- [ ] **Permission grant Pe_* cho non-admin role** — 1 click trong PermissionsPage matrix (Pe_* inherit từ `PurchaseEvaluations.Read` tương tự Contracts inheritance)
|
||||
- [x] ✅ **Permission grant Pe_* cho non-admin role** (2026-04-24)
|
||||
- `SeedPurchaseEvaluationPermissionDefaultsAsync` — 7 role × 9 menu key
|
||||
- Drafter/DeptManager/Procurement: R+C+U
|
||||
- CostControl/PM/Director/AuthorizedSigner: R+U
|
||||
- DeptManager thêm Delete (xóa nháp)
|
||||
- Idempotent per-(roleId × menuKey), admin tinh chỉnh tiếp qua /system/permissions
|
||||
- [ ] **fe-user Inbox** thêm section "Phiếu Duyệt NCC chờ tôi" (hoặc route `/pe-inbox`)
|
||||
- [ ] **Sidebar accordion fe-user** extend cover `Pe_<code>` (hiện chỉ track `Ct_<code>`)
|
||||
- [ ] **Dashboard** — thêm KPI "PE phiếu chờ tôi", "PE đã duyệt tháng này", "PE cần tạo HĐ"
|
||||
|
||||
Reference in New Issue
Block a user