test(phase9): add commerce integration acceptance suite

19/19: pricing in the public serializer, checkout gated on agreements, server-authoritative
amount, webhook signature verification and idempotency, payment success/failure/abandonment,
last-seat checkout race, reservation reaper, manual refund with no cascade, minor guardian
routing, admin/RBAC payment-data restrictions, audit/metric hygiene, the status-lookup endpoint,
and confirmation that ROOT_ V1/free-offering/classroom flows are unaffected.
This commit is contained in:
2026-08-27 09:05:46 -05:00
parent f0dde9b84a
commit 8b3e56e402
2 changed files with 327 additions and 3 deletions
+15 -3
View File
@@ -118,12 +118,24 @@ further instructor accounts from the Instructors tab).
(sequential and concurrent idempotency), required-agreement conversion blocking with version
snapshotting, guardian notification recipient resolution, and confirmation that ROOT_ V1/self-
paced/classroom flows remain unaffected.
- `test/e2e-phase9.js` — offering pricing in the public serializer, checkout blocked until
agreements are accepted, the server-authoritative amount (never caller-supplied), webhook
signature verification and idempotency, payment success driving real conversion/activation, a
failed payment leaving the seat intact vs. an abandoned checkout releasing it, the reservation
reaper, a last-seat checkout race, manual refund with no cascade into registration/enrollment
status, minor payment confirmations routing to the guardian, the admin payment view (never card
data), instructor/public RBAC on payment data, audit/metric hygiene (no secrets, no
high-cardinality labels), the website status-lookup endpoint's minimal safe shape, and
confirmation that ROOT_ V1/free-offering/classroom flows remain unaffected.
`infra/scripts/drills/` also holds real-Lab dress rehearsals per phase (Phase 6D/6E foundations,
Phase 6F's multi-student pilot and full end-to-end V1 journey, Phase 7/8's Winter Break Camp
rehearsals) — see each script's own header and `docs/PHASE6F_ROOT_V1_PILOT_READINESS.md`/`docs/
PHASE8_ENROLLMENT_OPERATIONS.md` for what they prove beyond what the e2e suites
above already cover via direct API.
rehearsals, Phase 9's Winter Break COMMERCE rehearsal —
`test-phase9-winter-camp-commerce.js`, 13/13, real checkout/webhook against the deterministic
test payment provider, no live money) — see each script's own header and
`docs/PHASE6F_ROOT_V1_PILOT_READINESS.md`/`docs/PHASE8_ENROLLMENT_OPERATIONS.md`/`docs/
PHASE9_COMMERCE_AND_LAUNCH.md` for what they prove beyond what the e2e suites above already
cover via direct API.
All e2e suites need `OWNER_EMAIL` / `OWNER_PASSWORD` set to a real bootstrapped instructor
account (see "Running the full stack locally" above) — the old `ADMIN_PASSWORD` mechanism is