Verification: Utility Extraction
Traceability matrix for Part 2 of Component Preparation. Requirements are defined in requirements.md.
Traceability Matrix
Section titled “Traceability Matrix”Group A — API Route Infrastructure
Section titled “Group A — API Route Infrastructure”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-A01 | api-route-utils.test.ts: UUID v4 format validation; uniqueness across calls | pending |
| REQ-UE-A02 | api-route-utils.test.ts: JSON content-type → parsed JSON; other → { raw } ; empty body | pending |
| REQ-UE-A03 | api-route-utils.test.ts: 2xx → 200; 4xx/5xx preserved; body contains ok, status, data | pending |
| REQ-UE-A04 | grep -rn 'generateGuid' src/app/api/ returns no matches; existing route tests pass | pending |
| REQ-UE-A05 | npx jest api-route-utils.test.ts exits 0 | pending |
Group B — Lookup Response Parsing
Section titled “Group B — Lookup Response Parsing”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-B01 | Test block for lookupField: plain array, named field, results fallback, empty data | pending |
| REQ-UE-B02 | Existing ardaClient.*.test.ts suites pass unchanged; grep -c 'lookupField' src/lib/ardaClient.ts confirms delegation | pending |
| REQ-UE-B03 | npx jest ardaClient exits 0 with new test cases passing | pending |
Group C — JWT / Token Consolidation
Section titled “Group C — JWT / Token Consolidation”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-C01 | grep -rn "atob(.*split.*\[1\])" src/ returns matches only in jwt.ts | pending |
| REQ-UE-C02 | grep -rn "split('\.').length !== 3" src/ returns matches only in jwt.ts | pending |
| REQ-UE-C03 | npx jest jwt.test exits 0; npx jest authThunks exits 0; npx jest tokenRefresh exits 0 | pending |
Group D — Safe Serialization
Section titled “Group D — Safe Serialization”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-D01 | storage.test.ts: valid JSON → parsed; malformed → fallback; empty → fallback | pending |
| REQ-UE-D02 | storage.test.ts: key exists → parsed; missing key → fallback; malformed value → fallback | pending |
| REQ-UE-D03 | storage.test.ts: stores serialized value; quota error → no throw | pending |
| REQ-UE-D04 | npx jest storage.test.ts exits 0 | pending |
Group E — Error Handling
Section titled “Group E — Error Handling”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-E01 | errors.test.ts: Error → .message; string → identity; number/object/null/undefined → String() | pending |
| REQ-UE-E02 | npx jest errors.test.ts exits 0 | pending |
Group F — Formatters
Section titled “Group F — Formatters”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-F01 | formatters.test.ts: ISO string → locale date; undefined → '-' | pending |
| REQ-UE-F02 | formatters.test.ts: ISO string → locale date+time; undefined → '-' | pending |
| REQ-UE-F03 | formatters.test.ts: Money → $X.XX CUR; undefined → '-'; null value → '-' | pending |
| REQ-UE-F04 | formatters.test.ts: Quantity → amount unit; undefined → default | pending |
| REQ-UE-F05 | npx jest formatters.test.ts exits 0 | pending |
Group G — Environment Constants
Section titled “Group G — Environment Constants”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-G01 | env-spa.test.ts: constants reflect env var values under different configurations | pending |
| REQ-UE-G02 | grep 'NEXT_PUBLIC_DEPLOY_ENV' src/lib/utils.ts returns no matches; grep 'IS_STAGE' src/lib/utils.ts returns matches | pending |
| REQ-UE-G03 | npx jest env-spa.test.ts exits 0 | pending |
Cross-Cutting
Section titled “Cross-Cutting”| Requirement | Test / Verification Method | Status |
|---|---|---|
| REQ-UE-X01 | npx tsc --noEmit exits 0 without changing consumer files beyond import paths | pending |
| REQ-UE-X02 | git diff --name-only shows no changes to existing *.test.ts(x) files (except Group B additions) | pending |
| REQ-UE-X03 | lint, typecheck, tests, build all exit 0 after each group | pending |
| REQ-UE-X04 | grep -A2 'Added|Changed' CHANGELOG.md shows utility extraction entries | pending |
Copyright: (c) Arda Systems 2025-2026, All rights reserved
Copyright: © Arda Systems 2025-2026, All rights reserved