Skip to content
Profiles & cities

organizer_subscriptions

--- Organizer subscriptions (RAZ-106) ---------------------------------------- An organizer profile can hold one active annual subscription plan. The Network plan (€199/year) covers unlimited events under a single annual price. Stripe runs the billing; this table mirrors the subscription state so entitlement checks stay inside the DB without a Stripe API call.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
dancer_iduuid no—
plantext
network
no—
statustext
activepast_duecanceledunpaid
no"active"
stripe_customer_idtext yes—
stripe_subscription_idtext yes—
unique
current_period_starttimestamp yes—
current_period_endtimestamp yes—
canceled_attimestamp yes—
created_attimestamp yesnow()

Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.

Keys, constraints & indexes

Unique

  • (stripe_subscription_id) organizer_subscriptions_stripe_subscription_id_unique

Indexes

  • (profile_id)
    org_sub_profile_idx
  • (dancer_id)
    org_sub_dancer_idx

Foreign keys

  • profile_id → profiles.id
    on delete cascade
  • dancer_id → dancers.id
    on delete no action

Used by

Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).

REST & webhooks

  • POST /api/stripe/webhook
  • ANY /mcp
  • ANY /mcp/public

Relations

Rendering diagram…

Diagram source
erDiagram
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  organizer_subscriptions {
    uuid id PK
    uuid profile_id FK
    uuid dancer_id FK
    text stripe_subscription_id UK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles ||--o{ organizer_subscriptions : "profile_id"
  dancers ||--o{ organizer_subscriptions : "dancer_id"

Defined at server/database/schema.ts:568 as organizerSubscriptions.