CoachClientInvoices table

The CoachClientInvoices table in the FitStack - V2 schema has 17 columns, keyed by Id, with 3 foreign keys to CoachClientSubscriptions, CoachClients and Media.

Payouts ride on the Stripe Connect account recorded in Users.StripeConnectedAccountId.

Columns (17)

Columns of the CoachClientInvoices table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
SubscriptionIduuidnot null, references CoachClientSubscriptions.Idv2 FIX: points at the COACH subscription. The Gym draft pointed this at GymClientSubscriptions.
CoachClientIduuidnot null, references CoachClients.Idv2 FIX: was GymClientId in the draft.
InvoiceNumbertextnot nullStripe invoice number.
Statustextnot null`CoachInvoiceStatus`.
IssuedOndatenot null
DueOndate
PaidAttimestamp with time zone
AmountCentsintegernot null
PlatformFeeCentsintegernot nullFitStack take, mirroring PlanPurchases (52).
Currencycharacter varying(3)not null
MediaIduuidreferences Media.IdRendered PDF. Nullable — the invoice exists before the document does.
StripeInvoiceIdtext
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (3)

  • (CoachClientId, IssuedOn) (IX_CoachClientInvoices_CoachClientId_IssuedOn)
  • (InvoiceNumber) unique (IX_CoachClientInvoices_InvoiceNumber)
  • (Status, DueOn) (IX_CoachClientInvoices_Status_DueOn)

Relationships