[CLAUDE] Skill: S27 audit late drift fix include batch (mig 26→31, gotcha 44→49)
3 file skill modified bởi S27 audit late (drift trigger +8 gotcha vượt §9.4 threshold) — committed log `docs/changelog/skill-audit-2026-05-late.md` đã ghi chi tiết 5 patches, NHƯNG 3 file SKILL.md tự thân chưa được include trong commit batch S29 wrap `e199603` (em main quên git add `.claude/skills/`). Changes confirm S27 audit late patches: - .claude/skills/README.md: ef-core-migration cell `26 mig → 31 mig` + Session marker `S19 → S23 t1 (Mig 31 F2 per-Approver-slot)` + docs/gotchas count `44 → 49 bẫy` - .claude/skills/dependency-audit-erp/SKILL.md: gotcha count `41 → 49 bẫy` - .claude/skills/ef-core-migration/SKILL.md: description `26 mig → 31 mig` + heading `26 → 31 migration hiện có` + Tests note `77 → 111 test pass` + DbSet cho 59 bảng note `26 → 31 mig` Verify: - git diff 3 file content already match docs/changelog/skill-audit-2026-05-late.md spec → S27 patches confirmed apply - KHÔNG drift NEW post S29 — chỉ catch-up include batch missing CI skip per paths-ignore (.claude/skills/** match docs-only pattern). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: ef-core-migration
|
||||
description: Tạo/sửa/revert EF Core 10 migration cho SOLUTION_ERP. Dùng khi thêm entity mới, thay đổi schema, rollback migration, debug DesignTimeDbContextFactory fail. Đã có 26 migration sẵn (Init → AddPeLevelOpinionsForV2). Snapshot + Designer + Migration 3-file rule bắt buộc commit đủ.
|
||||
description: Tạo/sửa/revert EF Core 10 migration cho SOLUTION_ERP. Dùng khi thêm entity mới, thay đổi schema, rollback migration, debug DesignTimeDbContextFactory fail. Đã có 31 migration sẵn (Init → RefactorSkipToFinalToApproverLevel Mig 31 S23 t1 F2 per-Approver-slot swap). Snapshot + Designer + Migration 3-file rule bắt buộc commit đủ.
|
||||
when-to-use:
|
||||
- "thêm migration"
|
||||
- "EF Core migration"
|
||||
@ -16,7 +16,7 @@ when-to-use:
|
||||
|
||||
> **Context:** .NET 10 + EF Core 10 + SQL Server. DbContext: `ApplicationDbContext` ở `Infrastructure/Persistence/`. Startup: `SolutionErp.Api`.
|
||||
|
||||
## Migration history (26 migration hiện có)
|
||||
## Migration history (31 migration hiện có)
|
||||
|
||||
| # | Name | Tables added / changed |
|
||||
|---|---|---|
|
||||
@ -77,7 +77,7 @@ Architecture decision đáng ghi cho session sau:
|
||||
|
||||
**Phase 8 update (2026-04-29 Session 5):**
|
||||
- Migration 15 `AddPurchaseEvaluationDepartmentOpinions` — 1 bảng riêng (UNIQUE PEId+Kind), max 4 row mỗi phiếu cho 4 phòng ban (Phê duyệt/Ccm/MuaHang/SmPm). UPDATE in-place khi user đổi ý, audit qua Changelog.
|
||||
- Tests Phase 1-2-3mini live (Mig 21 drastic refactor drop legacy 19): `tests/SolutionErp.Domain.Tests/` (54 test policy state machine) + `tests/SolutionErp.Infrastructure.Tests/` (17 test code generator + 6 test PE WF versioning). **Total 77 test pass / ~3s**. Drop 19 legacy (PE 2-stage S9 + PE N-stage S12 + Contract N-stage S13 + PE Reject S14) — Mig 21 simplify model, write new tests cho flat workflow flow khi UAT bug.
|
||||
- Tests Phase 1-2-3mini live + cumulative S22-S25 regression tests: `tests/SolutionErp.Domain.Tests/` (58 test policy state machine) + `tests/SolutionErp.Infrastructure.Tests/` (53 test = 17 codegen + 7 PE 2-stage + 7 PE N-stage + 6 PE WF + 5 AuthorizePolicy + 4 TraLai + 2 Plan M edge case + 1 V2 actor scope + 4 Approver F2/lookup regression). **Total 111 test pass / ~5s**. S22-S23 +20 cumulative regression: ReturnMode + DraftGuard + Reflection AuthorizePolicy + V2 actor scope reject + per-NV lookup discrimination (Plan N+O). Mig 21 drop 19 legacy (PE 2-stage S9 + PE N-stage S12 + Contract N-stage S13 + PE Reject S14) — flat workflow stabilized post-S22 V2 ground truth.
|
||||
- CI optimize 3 fix (29/04):
|
||||
- Manual checkout bypass github.com (gotcha #39) — fix TCP timeout 21s
|
||||
- Path filter docs-only skip (gotcha #41) — commit MD-only KHÔNG trigger CI
|
||||
@ -255,7 +255,7 @@ sqlcmd -S .\SQLEXPRESS -d SolutionErp -U vrapp -P <pw> -i migrate.sql
|
||||
|
||||
## Code pointers
|
||||
|
||||
- `src/Backend/SolutionErp.Infrastructure/Persistence/ApplicationDbContext.cs` — DbSet cho 59 bảng (26 migration)
|
||||
- `src/Backend/SolutionErp.Infrastructure/Persistence/ApplicationDbContext.cs` — DbSet cho 59 bảng (31 migration)
|
||||
- `src/Backend/SolutionErp.Infrastructure/Persistence/DesignTimeDbContextFactory.cs` — EF tooling factory
|
||||
- `src/Backend/SolutionErp.Infrastructure/Persistence/DbInitializer.cs` — seed + warn + migrate runtime + backfill (idempotent reconcile pattern)
|
||||
- `src/Backend/SolutionErp.Infrastructure/Persistence/Configurations/` — IEntityTypeConfiguration<T> per entity
|
||||
|
||||
Reference in New Issue
Block a user