wal: flush 20260712T1338

This commit is contained in:
pqhuy1987
2026-07-12 13:38:40 +07:00
parent 286450f67b
commit cf11faf1ec
7 changed files with 338 additions and 7 deletions

View File

@ -22,5 +22,31 @@
## deliverable
Design-doc: mapping ĐỦ 30 cột → 27 field + 3 approach tradeoff + reviewer verdict → **anh quyết approach + scope**. KHÔNG code lượt này.
## synthesis
_(pending — em-main ghi sau khi Workflow return)_
## synthesis (em-main single-writer — wf_e2f23a84-933, 4/4 clean, ~416K tok Opus)
> ⚠️ Sub-file naming: journal completion-order ≠ LANES order → `sub-invest-codebase-B-approach.md` HOLDS Lane C (dedup/edge) content · `sub-invest-codebase-C-edge.md` HOLDS Lane B (approach) content. Content correct, filenames swapped (harvest reads content).
**REVIEWER VERDICT: PASS_WITH_CONCERNS.** Design sound; every in-repo file:line verified KHỚP (0 fabrication); 27/27 field bijective, 0 silent loss. 1 MAJOR + 4 MINOR refine it before build.
### Load-bearing findings
1. **Schema 100% ready** — 30 Excel col → 27 field bijective (1 ignore STT, 27 direct col2-28, 2 audit-provenance col29-30 = owner-call). Mig 62's 18-field expansion purpose-built for this Excel. 0 invented field.
2. **🎁 Approach B ĐÃ SHIP** — spec "seed fills partial" is WRONG: `DbInitializer.cs:2775-2782` fills all 30 fields for the 4 NCC, prod-verified (Mig 62 `778fc98` Run #488). **This exact file's 4 NCC are already in prod.**
3. **ClosedXML 0.105 already in `SolutionErp.Infrastructure.csproj:8`** (0 new dep); read-idiom `XlsxRenderer.cs:18-25`; IFormFile plumbing in 3 controllers. NamGroup `HrEmployeeImportService` = complete upload→preview→confirm pattern to port (⚠️ MINOR: unverifiable from this env — repo ERP_MINI_FINAL absent).
4. **🔴 MAJOR (reviewer caught, all 3 lanes missed):** dedup Code = `Ordinal` (case-sensitive) vs DB unique-index default = case-INSENSITIVE collation → Approach A with case-variant Code → dict-miss → INSERT → hard unique-violation 500. **Precondition:** normalize Code (Trim+UPPER or OrdinalIgnoreCase) before dedup+store+preview.
5. **Must-knows:** import writes entity directly with fill-where-non-empty, NOT via `UpdateSupplierCommand` (blind absolute-set → NULL-clobber #73); read by absolute cell index NOT `CellsUsed()` (skips empties → drift); parser anchors r4 + fingerprint-guard; 2-pass all-or-nothing (~4-20 rows).
### 3 approach
| | Effort | Reusable | Verdict |
|---|---|---|---|
| **A upload endpoint** | MED (port NamGroup) | ✅ | best if NCC keep coming; needs MAJOR fix first |
| **B extend seed** | ~0 (ĐÃ SHIP file này) | ❌ | done for these 4 NCC; no update-sync |
| **C import-command** | MED | ~ | bỏ — cắt preview = cắt lá chắn cho Excel bẩn |
### 5 owner decisions
1. Col 29-30 (NGÀY/NGƯỜI CẬP NHẬT) → ignore / Note / +2 field Mig 63?
2. Code = col4 "TÊN VIẾT TẮT" confirmed (= mã HĐ key RG-001)?
3. Reusable tool needed? → A ; chỉ file này → B đã xong.
4. Re-import existing Code → fill-nulls (safe) vs overwrite-non-empty (updates, destructive)?
5. PHÂN LOẠI unknown value → reject-row vs default NhaCungCap?
**Harvest:** pending @closeout — em-main append 1 entry investigator-codebase + 1 reviewer, stamp `[engine: fable-clone-ensemble · Opus-S112]`.