# v447 - Customer Portal Locked Test-Session Preparation

Reviewed v446 final warning/audit evidence closeout bundle and proceeded with customer portal locked test-session preparation before changing payment collection, customer portal URL return, webhook subscription mutation, trial-to-paid conversion, hard billing gates, broker distribution limits, owned portal rules, or internal load-board access.

## What changed

- Added a Super Admin customer portal preparation API:
  - `/api/admin/stripe-customer-portal/test-session-preparation`
- Extended the existing Workspace Billing customer portal route scaffold with locked test-session preparation details.
- Added a new **Customer portal preparation** panel inside `/admin/subscriptions`.
- Added workspace portal readiness rows showing:
  - workspace type and account class
  - subscription status
  - billing provider and mode
  - provider sync status
  - saved Stripe customer readiness
  - selected plan Stripe readiness
  - first-fix guidance
- Added Super Admin review recording for customer portal locked test-session preparation.
- Added recent customer portal review evidence using Super Admin audit records.
- Added a customer portal locked-state card to Workspace Admin `/billing`.
- Added a customer portal preparation CSV export:
  - `dispatchspot-customer-portal-locked-test-session-preparation.csv`
- Added `.env.example` visibility for:
  - `DISPATCH_SPOT_STRIPE_CUSTOMER_PORTAL_URL_RETURN_ENABLED="false"`
- Updated the billing activation master checklist so customer portal preparation accounts for the new locked preparation review evidence.
- Updated documentation source of truth for v447.

## Guardrails

This build is preparation-only. It does not create Stripe Billing Portal sessions, return customer portal URLs, collect payment, mutate subscription status, convert trials to paid subscriptions, enforce hard billing gates, change broker distribution limits, change owned portal rules, or open internal load-board access.

The Workspace Billing portal card only shows a guarded review state. The button records a locked review event and does not open Stripe.

## Validation notes

- Prisma schema changed: No.
- Local import preflight passed.
- Targeted TypeScript/TSX syntax checks passed for the changed service, API route, admin panel, Workspace Billing page, and billing activation checklist service.

## Next recommended check-in

```text
Current baseline on server is v447

review v447 customer portal locked test-session preparation, then decide whether to proceed with v448 controlled checkout and portal URL return review or first harden customer portal preparation evidence/export copy before changing payment collection, webhook subscription mutation, trial-to-paid conversion, hard billing gates, broker distribution limits, owned portal rules, or internal load-board access
```
