GymClientInvoices table
The GymClientInvoices table in the FitStack - V2 schema has 8 columns, keyed by Id, with 3 foreign keys to GymClients, GymClientSubscriptions and Media.
Gym membership invoices. Distinct from `CoachClientInvoices` (64), which the Gym board accidentally wired to THIS table's parents.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| GymClientId | uuid | not null, references GymClients.Id | |
| SubscriptionId | uuid | not null, references GymClientSubscriptions.Id | |
| InvoiceNumber | text | not null | Stripe invoice number. |
| Status | integer | `GymInvoiceStatus`. The Gym board declared the enum but never used it on a column. | |
| Date | date | ||
| Amount | numeric(10,2) | ||
| MediaId | uuid | not null, references Media.Id | Rendered PDF. Should be nullable — the invoice exists before the document is generated. |
Relationships
GymClientInvoices.GymClientIdreferencesGymClients.IdGymClientInvoices.SubscriptionIdreferencesGymClientSubscriptions.IdGymClientInvoices.MediaIdreferencesMedia.Id