GymEquipmentReports table
The GymEquipmentReports table in the FitStack - V2 schema has 13 columns, keyed by Id, with 5 foreign keys to Gyms, GymEquipmentUnits, Equipment, Users and 1 more.
Members report a broken machine from the FitStack app; staff resolve it. Extends the live GymEquipmentReport (UserId, GymId, EquipmentId) with the Unit, text and a status.
Columns (13)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| GymId | uuid | not null, references Gyms.Id | |
| UnitId | uuid | references GymEquipmentUnits.Id | Null when the Member could not say which Unit. |
| EquipmentId | uuid | not null, references Equipment.Id | |
| UserId | text | not null, references Users.Id | The reporting Member's User. |
| Description | character varying(2000) | ||
| Status | text | not null | `EquipmentReportStatus`. |
| ResolvedByEmployeeId | uuid | references Employees.Id | |
| ResolvedAt | 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 (1)
(GymId, Status, CreatedAt)(IX_GymEquipmentReports_GymId_Status_CreatedAt)
Relationships
GymEquipmentReports.GymIdreferencesGyms.IdGymEquipmentReports.UnitIdreferencesGymEquipmentUnits.IdGymEquipmentReports.EquipmentIdreferencesEquipment.IdGymEquipmentReports.UserIdreferencesUsers.IdGymEquipmentReports.ResolvedByEmployeeIdreferencesEmployees.Id