CoachAccessRequestScopes table
The CoachAccessRequestScopes table in the FitStack - V2 schema has 6 columns, keyed by Id, with 2 foreign keys to CoachAccessRequests and DataScopes.
Line items of the ask.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| AccessRequestId | uuid | not null, references CoachAccessRequests.Id | CASCADE. |
| DataScopeId | uuid | not null, references DataScopes.Id | RESTRICT — a scope in use cannot be deleted, only deprecated. |
| RequestedHistoryWindowDays | integer | How far back the coach is asking to see. Null = all history, subject to DataScopes.MaxHistoryWindowDays. | |
| Justification | character varying(1000) | Per-scope reason. Required by the app for Sensitive scopes. | |
| WasApproved | boolean | Filled at decision time. Null while pending. This is what makes PartiallyApproved auditable — you can see exactly which scopes were refused. |
Indexes (1)
(AccessRequestId, DataScopeId)unique (IX_CoachAccessRequestScopes_RequestId_ScopeId)
Relationships
CoachAccessRequestScopes.AccessRequestIdreferencesCoachAccessRequests.IdCoachAccessRequestScopes.DataScopeIdreferencesDataScopes.Id