Skip to main content

AGENT_PEPM ↔ OWNER_ROLLUP Exclusivity Fix — Production Proof

Purpose: Validate that AGENT_PEPM save correctly closes active OWNER_ROLLUP policies. Commit SHA: [fill after deploy]
Cloud Run Revision: [fill after deploy]
Date: [fill]

Step A — Before Save

Run in BigQuery:
SELECT policy_type, is_active, effective_start_date, effective_end_date
FROM payroll_analytics.config_business_policy
WHERE tenant_id='creative_benefit_strategies'
  AND business_id='<business_id>'
  AND policy_type='OWNER_ROLLUP'
ORDER BY created_at DESC;
Expected: At least one row with effective_end_date IS NULL, is_active=TRUE. Actual:
[Paste query output]

Step B — Save AGENT_PEPM

  • Method: Ingestion wizard or onboarding page
  • Business ID: [fill]
  • Period: [fill]
Result: HTTP 200

Step C — After Save

Run the same query from Step A. Expected:
  • Previously open OWNER_ROLLUP row now has:
    • effective_end_date = effective_start_date - 1 day (e.g. 2025-11-30 for effective_start_date 2025-12-01)
    • is_active = FALSE
Actual:
[Paste query output]

Step D — Readiness

Call readiness for same batch/period:
GET /api/v1/intake/ingestion-wizard/readiness?batch_id=<batch_id>&period_label=<period_label>
Expected:
  • No "OWNER_ROLLUP policy requires confirmation" reason for the business
  • Business becomes Ready if PEPM coverage complete
Actual (snippet):
[Paste readiness response snippet]

Sign-off

  • Step A completed
  • Step B returned 200
  • Step C confirmed policy closed
  • Step D confirmed readiness updated