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)

Columns of the Employees table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null, references Trainers.EmployeeId
CompanyIduuidnot null, references Companies.Id
UserIdtextnot null, references Users.Id
EmployeeIdtextThe company internal staff number, not ours.

Relationships