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)

Columns of the CoachClientSubscriptions table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
CoachClientIduuidnot null, references CoachClients.IdRESTRICT.
OfferingIduuidnot null, references CoachOfferings.IdRESTRICT.
NameSnapshotcharacter varying(200)not nullOffering name as sold. Snapshotted so renaming an offering does not rewrite history.
PriceCentsSnapshotintegernot nullPrice as sold. Same reason.
Currencycharacter varying(3)not null
Statustextnot null`CoachSubscriptionStatus`.
StartDatetimestamp with time zonenot null
CurrentPeriodEndtimestamp with time zone
CancelAtPeriodEndbooleannot null
CancelledAttimestamp with time zone
StripeSubscriptionIdtext
StripeCustomerIdtext
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (2)

  • (CoachClientId, Status) (IX_CoachClientSubscriptions_CoachClientId_Status)
  • (StripeSubscriptionId) (IX_CoachClientSubscriptions_StripeSubscriptionId)

Relationships