QA Hardening Patch Summary — Save Persistence Fix
Commit SHA:bc2058f6eac79abd4792b0b4a31dbd640a671adbDate: 2026-02-06
Branch:
main
✅ Changes Implemented
1. Org Header Propagation (QA Requirement #1)
File:dashboard/src/lib/apiClient.ts
- Added
orgIdoption parameter togetBusinessOnboardingList()method - Ensures
x-org-idheader is explicitly passed to backend - Matches pattern used by other API methods (e.g.,
setBusinessPolicy)
dashboard/src/components/intake/PreflightStep.tsx— BothgetBusinessOnboardingListcalls now passorgId: orgScope.orgIddashboard/src/pages/admin/onboarding/businesses.tsx—loadBusinessesnow passesorgId: orgScope.orgId
- Network requests will include
x-org-idheader whenorgScope.orgIdis set - Platform admins will have org context properly scoped
- Org-scoped users will have header set correctly (or omitted per backend policy)
2. Shared Period Label Helper (QA Requirement #2)
New File:dashboard/src/lib/periodUtils.ts
- Created
getCurrentMonthStart()utility function - Returns current month start in
YYYY-MM-01format (deterministic, local time) - Single source of truth to avoid timezone drift from inline date calculations
dashboard/src/pages/admin/onboarding/businesses.tsx— Replaced inlinenew Date().toISOString().slice(0, 7) + '-01'withgetCurrentMonthStart()dashboard/src/pages/admin/onboarding/businesses.tsx— Replaced inline fallback inloadBusinesseswith shared helper
dashboard/src/lib/__tests__/periodUtils.test.ts— 4 passing unit tests covering:- Current month format (
YYYY-MM-01) - Single-digit month padding
- Year boundary handling
- Local time usage (not UTC)
- Current month format (
3. Fallback Fetch Logic Verification (QA Requirement #3)
File:dashboard/src/components/intake/PreflightStep.tsx
Verified:
- Fallback fetch only runs when
updatedBusinessis not found after initial search - Limit is bounded to 250 (not unbounded)
- Both initial and fallback calls include
orgIdheader - Both calls include
period_labelparameter
4. Production Logs Verification (QA Requirement #4)
Verified:- All
console.logstatements are guarded withprocess.env.NODE_ENV !== 'production'checks console.errorstatements remain (appropriate for error logging)- No unguarded production logs introduced
dashboard/src/components/intake/PreflightStep.tsx— All logs guardeddashboard/src/components/admin/onboarding/BusinessDetailDrawer.tsx— All logs guardeddashboard/src/pages/admin/onboarding/businesses.tsx— All logs guarded
- ✅
npm run lintpassed (warnings only, no errors) - Warnings are pre-existing React Hook dependency warnings (not related to this patch)
- ✅
periodUtils.test.ts— 4 tests passing - ✅
convertToBusinessListItem.test.ts— 3 tests passing
📋 Manual Verification Required (Post-Deploy)
Network Proof
After deploying to production, verify in browser DevTools Network tab:- Open wizard preflight for a business
- Save AGENT_PEPM configuration (e.g., rate 12.00)
- Inspect Network tab for the
GET /api/v1/admin/onboarding/businessesrequest that fires after save
- Network request showing
x-org-idheader present - Query params showing
period_labelis included
UI Screenshot Proof
Before Save:- Open drawer for a business (e.g., “AIC Inc”)
- Note PEPM source is “NONE” or empty
- Set PEPM rate to 12.00
- Click Save
- Close drawer
- Reopen drawer for the same business
- Expected: PEPM source shows “OVERRIDE” (or “DEFAULT”) and rate shows 12.00
- Screenshot: Drawer showing persisted PEPM configuration
- Hard refresh the page (Ctrl+F5 / Cmd+Shift+R)
- Reopen drawer for the same business
- Expected: PEPM configuration still persists
- Screenshot: Drawer showing persisted configuration after refresh
🚀 Deployment Status
✅ Deployment Completed
Deployment Date: 2026-02-06 14:48:54 CSTCommit SHA:
bc2058f6eac79abd4792b0b4a31dbd640a671adbGit Push: ✅ Completed (
git push origin main)Vercel Auto-Deploy: ⏳ In Progress (typically completes in 2-5 minutes) Production URL:
https://payroll-pipeline-cbs.vercel.app
📋 Verification Steps
Automated Verification (Run after deployment completes)
- ✅ Frontend accessible
- ✅ Backend health check passed
- ✅ Business list endpoint accepts period_label parameter
- ⏳ Manual verification required (see below)
Manual Network Verification (Required)
- Open browser DevTools (F12) → Network tab
- Navigate to:
https://payroll-pipeline-cbs.vercel.app - Open wizard preflight and save a business configuration
- Inspect Network tab for
GET /api/v1/admin/onboarding/businessesrequest - Verify:
- ✅ Query param:
period_label=YYYY-MM-01is present - ✅ Header:
x-org-idis present (if org-scoped) or absent (if platform admin) - ✅ Status: 200 OK
- ✅ Query param:
Manual UI Verification (Required)
Test Flow:- Open business drawer in wizard (e.g., “AIC Inc”)
- Set PEPM rate to 12.00, click Save
- Close drawer, reopen same business
- ✅ Expected: PEPM shows 12.00 (persisted)
- Hard refresh page (Ctrl+F5 / Cmd+Shift+R)
- Reopen drawer for same business
- ✅ Expected: PEPM still shows 12.00 (persists after refresh)
- Before save (empty/NONE PEPM)
- After save + reopen (shows 12.00)
- After page refresh + reopen (still shows 12.00)
📝 Post-Verification Update
After completing manual verification, update this document with:- ✅ Vercel deployment timestamp (from Vercel dashboard)
- ✅ Network proof screenshot/paste
- ✅ UI screenshots (before/after save, after refresh)
- ✅ Final status: VERIFIED — CLOSED
📝 Files Changed
✅ Acceptance Criteria Status
Code-Level (Completed)
- ✅ Org header (
x-org-id) explicitly passed in allgetBusinessOnboardingListcalls - ✅ Shared period label helper created and used (no inline fallbacks)
- ✅ Fallback fetch logic verified (bounded, conditional)
- ✅ All tests passing (
periodUtils.test.ts: 4 tests,convertToBusinessListItem.test.ts: 3 tests) - ✅ Lint passing (no errors, warnings are pre-existing)
- ✅ No production logs introduced (all
console.logguarded)
Deployment (In Progress)
- ✅ Code committed and pushed to
main - ⏳ Vercel deployment (auto-triggered, typically 2-5 minutes)
- ⏳ Network proof (pending manual verification)
- ⏳ UI screenshots (pending manual verification)
Final Status
- Deployment: ✅ Pushed to
main(bc2058f) - Verification: ⏳ Pending manual QA sign-off
- Status: DEPLOYED — AWAITING QA VERIFICATION
🔗 Related Issues
- Fixes: UI Save Succeeds (200) but State Does Not Persist
- Related: Phase 8I — Execution Checklist (QA-Driven)
- Related: Resolver 500 Error Fix (deployed SHA:
bd958de)