1 Commits

Author SHA1 Message Date
8185070109 [CLAUDE] Scripts: seed 20 test user prod cho UAT (S22+2)
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
Bro request: tạo mỗi phòng 2-3 user + phân quyền để test scenarios.

Script `scripts/seed-test-users-prod.ps1` ASCII-only (gotcha #30 PS 5.1 diacritics)
gọi API admin token, idempotent (skip 409 conflict). Tạo 20 user mới:

| Phòng | Trước | Sau | Pattern |
|---|---:|---:|---|
| ACT | 0 | 3 | NV (Drafter+Accounting) / PP / TP (DeptManager, CanBypassReview=true) |
| BOD | 1 | 3 | +2 Director (no PositionLevel) |
| CCM | 7 | 7 | SKIP existing đủ |
| EQU | 0 | 3 | NV / PP / TP (DeptManager+Equipment) |
| FIN | 0 | 3 | NV / PP (AllowDrafterSkipToFinal=true) / TP |
| HRA | 0 | 3 | NV / PP / TP (CanBypassReview=true) |
| PM | 0 | 3 | NV (AllowDrafterSkipToFinal=true, ProjectManager) / PP / TP |
| PRO | 5 | 5 | SKIP existing đủ |
| QS | 0 | 3 | NV / PP / TP (Drafter-only, no role chuyên) |

Total active prod: 13 → 33 users.

UAT scenarios covered:
- N-stage workflow inner step (Mig 18): NV/PP/TP per phòng test sequential + bypass
- 2-stage dept approval (Mig 16): 2 user CanBypassReview=true (ACT.tp + HRA.tp)
- F2 per-Drafter skip (Mig 29): 2 user AllowDrafterSkipToFinal=true (FIN.pp + PM.nv)
- Plan E strict V2 scope: 33 user × 9 dept × various roles (test diverse approver match)

Password tất cả: TestUser@2026 (>=12 chars per Identity policy).

Discoveries:
- Identity password policy: >=12 chars (HANDOFF "User@123456" 11 chars FAIL 400)
- API auth response: field `accessToken` không phải `token`
- Rate limit awareness: Start-Sleep 500ms giữa requests

Verify: sqlcmd Prod 9 phòng × 2-7 user, 33 total active.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 22:05:46 +07:00