[CLAUDE] Contract: K4a+K4b SP-002 sidebar 8 nhom x 6 leaf + noi ?group= end-to-end (0-mig)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 6m23s

K4a (gate PASS-WITH-FLAGS 4, sub-reviewer-gate-k4a.md): 49 key Khkk_G{2-8} bo-sinh
by-construction 3-phia (All/seed/grant) MenuKeys.cs + DbInitializer 49 row + labelBackfill
G1 nhan A1 + site-2 Concat + va 7/10/11/13/15 (nhan N2 co "pha do"; comment 1893 -> mo-neo
grep). All 64->113, Policies 256->452 (test T2 khoa runtime). Test +7 KhkkGroupMenuSeedTests
(T7 revoker-khong-dung-Khkk: probe vi-phan 112->0, gotcha #84).

K4b (gate PASS-WITH-FLAGS 4M/5m 0-chan, sub-reviewer-gate-k4b.md): KhkkListPage x2 derive
phase+group tu searchParams (leaf->leaf khong F5, navKey reset) + queryKey {group,phase,
search,page,deletedView} + KhkkCreatePage preset ?group= + staticMap G1 6-leaf group=1 +
regex Khkk_G([1-8])_* fe-user (fe-admin GHI RANG BUOC isAdminHidden) + FLAG-1 lead-fix:
GET /deleted +group mirror List (Controller+Query+handler SAU-IDOR) + FE noi 2-nhanh.

2 wave 1 commit CO KHAI: Layout.tsx dinh ca 2 wave khong tach hunk phi-tuong-tac; moi dong
deu qua gate rieng. STATUS canonical 5-row dong bo (71/97/452/113/620->621) + bundle :479.
No K4c: MAJOR-A test /deleted+group filter + MAJOR-C WfView doc group. Suite 621/0
(45D+576I) + filter 41/41 + npm x2 + dotnet 0E.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-08-01 10:10:11 +07:00
parent bc1e7c937d
commit 88e7ecf263
14 changed files with 880 additions and 63 deletions

View File

@ -46,6 +46,43 @@ public static class MenuKeys
public const string KeHoachKyKet = "KeHoachKyKet";
public const string HopDongCung = "HopDongCung";
// ============================================================
// [K4a — S166] Sidebar KHKK 8 NHÓM DUYỆT × 6 leaf. Danh mục SOL-CCM-SP-002
// (Mig 70) chia 86 dòng thành 8 nhóm duyệt; mỗi nhóm 1 workflow `KHKK-N{n}`
// type-10 (K3) ⇒ sidebar cũng tách 8 nhóm.
// - NHÓM 1 GIỮ NGUYÊN 7 key CŨ KHÔNG-infix (`Khkk_G1` + `Khkk_WfView` …
// `Khkk_Deleted`, seed từ S159 — xem SeedMenuTreeAsync). Đổi tên key =
// mồ côi permission-row đã cấp (bài S155) ⇒ CẤM đổi.
// - NHÓM 2..8 dùng khuôn CÓ infix: `Khkk_G{n}` + `Khkk_G{n}_{action}`.
// 🔴 49 key (7 group + 42 leaf) VÀO `All` ⇒ sinh thêm 196 policy
// `Khkk_G*.{Read,Create,Update,Delete}` (registered-unused: endpoint KHKK
// vẫn CHỈ dùng `KeHoachKyKet.*` — gotcha #85, đừng OR key con vào gate)
// ⇒ 2 số canonical `docs/STATUS.md` đổi: Menu keys +49 · Policies +196
// (Policies = |All| × |Actions|, DERIVED — khai DELTA, không neo mốc tuyệt đối).
// 🔴 Vào `All` thì BẮT BUỘC có menu-row tương ứng trong `SeedMenuTreeAsync`
// (thiếu row = Permission FK nổ ngay lần boot đầu — invariant T6 K1).
// `KhkkGroupMenuKeys` dưới là NGUỒN CHUNG cho cả `All` LẪN vòng seed
// menu-row + vòng grant site-2 ⇒ 3 phía khớp by-construction, KHÔNG mirror tay.
// ⚠️ 2 KHUÔN menu-key cùng sống trong file này (đọc 1 khuôn đừng tưởng khuôn kia sai):
// (a) `Ct_*` / `Pe_*` leaf CỐ Ý NGOÀI `All` — sinh động qua factory, Admin
// grant qua seeder riêng (xem chú thích tại PurchaseEvaluationApproved).
// (b) catalog / `AwV2_*` / `Khkk_G*` TRONG `All` — Admin tự có row qua
// loop `MenuKeys.All` ở SeedAdminPermissionsAsync. K4a đi khuôn (b).
// ============================================================
public static readonly int[] KhkkGroupNumbers = [2, 3, 4, 5, 6, 7, 8];
public static readonly string[] KhkkLeafActions =
["WfView", "List", "Create", "Pending", "Approved", "Deleted"];
public static string KhkkGroup(int n) => $"Khkk_G{n}";
public static string KhkkLeaf(int n, string action) => $"Khkk_G{n}_{action}";
// 49 key theo thứ tự: group n → 6 leaf của n → group n+1 → …
// (khai báo TRƯỚC `All` vì static field initializer chạy theo thứ tự văn bản).
public static readonly string[] KhkkGroupMenuKeys = KhkkGroupNumbers
.SelectMany(n => new[] { KhkkGroup(n) }
.Concat(KhkkLeafActions.Select(a => KhkkLeaf(n, a))))
.ToArray();
public static string ContractTypeGroup(string typeCode) => $"Ct_{typeCode}";
public static string ContractTypeList(string typeCode) => $"Ct_{typeCode}_List";
public static string ContractTypeCreate(string typeCode) => $"Ct_{typeCode}_Create";
@ -200,6 +237,11 @@ public static class MenuKeys
OffDatXe, OffItTicket, OffChamCong, OffAttendanceReport, HrmDashboard, // Phase 10.3-10.4 — G-O5/G-O6/G-P1/G-H3 + P11-E report
Personal, // [S57] Cá nhân (Puro grouping — Chấm công re-parent)
KeHoachKyKet, // [W1 Mig 69 — S161] GĐ2 KHKK: const :41 vào All ⇒ sinh policy KeHoachKyKet.{Read,Create,Update,Delete}
// [K4a — S166] 49 key sidebar KHKK nhóm 2..8 (7 group + 42 leaf) — nguồn sinh
// `KhkkGroupMenuKeys` (dùng chung với seed menu-row + grant site-2). 7 key nhóm 1
// KHÔNG-infix (`Khkk_G1`/`Khkk_WfView`…) CỐ Ý ngoài `All` như từ S159 — giữ nguyên
// trạng thái cũ, quyền của chúng do site-2/site-3 phát.
.. KhkkGroupMenuKeys,
System, Users, Roles, Permissions, MenuVisibility, Workflows, PeWorkflows,
ApprovalWorkflowsV2, ApprovalWorkflowDuyetNccV2, ApprovalWorkflowDuyetNccPhuongAnV2, // Mig 22
// [K3 nhịp-1 — S164/S165] 8 leaf Designer cho 8 nhóm duyệt KHKK (+8 key ⇒ +32 policy).