# v338 Database-Backed Subscription Plan Persistence and Workspace Subscription Assignment Foundation

## Purpose
v338 moves Dispatch Spot subscriptions from staged browser-side planning into the core SaaS data layer.

Every workspace should eventually have a subscription. Super Admin must be able to define plans, assign plans to workspaces, review included limits, review over-limit usage, and prepare every Workspace Admin feature to obey plan entitlements.

## What v338 Adds

### Prisma data model
New persisted models were added:

- `SubscriptionPlan`
- `WorkspaceSubscription`

New subscription enums were added:

- `SubscriptionPlanStatus`
- `WorkspaceSubscriptionStatus`

The `Organization` model now has a one-to-one `workspaceSubscription` relation.

### Saved subscription plans
Super Admin can now create, update, and delete saved plans through `/admin/subscriptions`.

Saved plan fields include:

- plan name
- plan status
- monthly price
- included users/seats
- included trucks
- included business phone numbers
- extra user/seat price
- extra phone number price
- included features for dispatch, documents, billing, notifications, business phone, route planning, load board, reports, and CORI

### Workspace subscription assignment
Super Admin can now assign a saved subscription plan to a workspace from `/admin/workspaces/subscriptions`.

Supported workspace subscription statuses:

- Trial
- Active
- Past due
- Paused
- Canceled

### Entitlement visibility
Super Admin can review:

- assigned saved plan
- included vs over-limit usage
- feature access included by plan
- first subscription fix

## What v338 Does Not Do Yet

v338 does not yet hard-enforce plan limits in Workspace Admin pages. The next subscription steps should connect the saved entitlement source to Workspace Admin page access, add-on handling, and billing/provider integration.

## Next Recommended Direction

The next subscription build should begin shared entitlement enforcement preparation across Workspace Admin without adding customer-facing clutter. Super Admin should remain the full control/review surface.

## Default Workspace Subscription
New workspaces created by Super Admin are automatically assigned to the lowest/default Starter-style plan in Trial status when a saved default plan is available. Existing workspaces can be assigned or corrected from `/admin/workspaces/subscriptions`.
