Enrolments table
The Enrolments table in the FitStack - V2 schema has 17 columns, keyed by Id, with 3 foreign keys to Sessions, GymClients and Employees.
One Student's place in one Session. Replaces ClassAttendees (81). Glossary: Enrolment; avoid Booking.
Columns (17)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| SessionId | uuid | not null, references Sessions.Id | |
| MemberId | uuid | not null, references GymClients.Id | A Student is a Member with Enrolments; drop-ins are Members too (ADR 0007). |
| Status | text | not null | `EnrolmentStatus`. |
| WaitlistPosition | integer | Set while Waitlisted; the lowest is promoted first. | |
| PaymentKind | text | not null | `EnrolmentPaymentKind`. |
| PriceCentsSnapshot | integer | not null | |
| Currency | character varying(3) | ||
| StripePaymentIntentId | text | DropIn only. | |
| EnrolledAt | timestamp with time zone | not null | |
| EnrolledByEmployeeId | uuid | references Employees.Id | Set when staff enrolled the Member at the desk. |
| CancelledAt | timestamp with time zone | ||
| CheckedInAt | timestamp with time zone | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (3)
(SessionId, MemberId)unique (IX_Enrolments_SessionId_MemberId)(MemberId, EnrolledAt)(IX_Enrolments_MemberId_EnrolledAt)(SessionId, Status, WaitlistPosition)(IX_Enrolments_SessionId_Status_WaitlistPosition)
Relationships
Enrolments.SessionIdreferencesSessions.IdEnrolments.MemberIdreferencesGymClients.IdEnrolments.EnrolledByEmployeeIdreferencesEmployees.Id