CoachClientSubscriptions table
The CoachClientSubscriptions table in the FitStack - V2 schema has 17 columns, keyed by Id, with 2 foreign keys to CoachClients and CoachOfferings. 1 column in CoachClientInvoices references it.
A client live subscription to one offering. Payment state and access state are independent: a lapsed subscription does NOT auto-revoke a `CoachAccessGrant`. Ending the relationship does. Coupling them would mean a failed card silently destroys consent records, which is the wrong failure mode — pause the relationship instead.
Columns (17)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| CoachClientId | uuid | not null, references CoachClients.Id | RESTRICT. |
| OfferingId | uuid | not null, references CoachOfferings.Id | RESTRICT. |
| NameSnapshot | character varying(200) | not null | Offering name as sold. Snapshotted so renaming an offering does not rewrite history. |
| PriceCentsSnapshot | integer | not null | Price as sold. Same reason. |
| Currency | character varying(3) | not null | |
| Status | text | not null | `CoachSubscriptionStatus`. |
| StartDate | timestamp with time zone | not null | |
| CurrentPeriodEnd | timestamp with time zone | ||
| CancelAtPeriodEnd | boolean | not null | |
| CancelledAt | timestamp with time zone | ||
| StripeSubscriptionId | text | ||
| StripeCustomerId | text | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (2)
(CoachClientId, Status)(IX_CoachClientSubscriptions_CoachClientId_Status)(StripeSubscriptionId)(IX_CoachClientSubscriptions_StripeSubscriptionId)
Relationships
CoachClientSubscriptions.CoachClientIdreferencesCoachClients.IdCoachClientSubscriptions.OfferingIdreferencesCoachOfferings.IdCoachClientInvoices.SubscriptionIdreferencesCoachClientSubscriptions