Employees table
The Employees table in the FitStack - V2 schema has 4 columns, keyed by Id, with 3 foreign keys to Trainers, Companies and Users. 7 columns in Enrolments, GymEquipmentMaintenance, GymEquipmentReports, GymStockMovements and 3 more reference it.
OPEN QUESTION carried over from the Gym board: how are staff roles split? The board proposed simple RBAC — Client Admin, Equipment Admin, Class Admin, Coach Admin, Global Admin. Note this cannot reuse the global `Roles`/`UserPermissions` tables (02): those are platform-wide, and "Equipment Admin at Gym A" is scoped to one gym. The same actor/subject/scope shape as the coaching consent model (62) applies — an `EmployeeRoles(EmployeeId, GymId, Role)` table is the smaller version of that idea. Unresolved; decide before building.
Columns (4)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null, references Trainers.EmployeeId | |
| CompanyId | uuid | not null, references Companies.Id | |
| UserId | text | not null, references Users.Id | |
| EmployeeId | text | The company internal staff number, not ours. |
Relationships
Employees.IdreferencesTrainers.EmployeeIdEmployees.CompanyIdreferencesCompanies.IdEmployees.UserIdreferencesUsers.IdEnrolments.EnrolledByEmployeeIdreferencesEmployeesGymEquipmentMaintenance.PerformedByEmployeeIdreferencesEmployeesGymEquipmentReports.ResolvedByEmployeeIdreferencesEmployeesGymStockMovements.EmployeeIdreferencesEmployeesOrders.EmployeeIdreferencesEmployeesSiteVersions.CreatedByEmployeeIdreferencesEmployeesGyms.ManagerIdreferencesEmployees