docs: update participant trialCount documentation; fix participants view & experiments router diagnostics; add StepPreview placeholder and block-converter smoke test

This commit is contained in:
2025-08-08 00:36:41 -04:00
parent 18f709f879
commit c071d33624
6 changed files with 811 additions and 77 deletions

View File

@@ -552,7 +552,7 @@ HRIStudio uses tRPC for type-safe API communication between client and server. A
## Participant Management Routes (`participants`)
### `participants.list`
- **Description**: List study participants
- **Description**: List participants in a study
- **Type**: Query
- **Input**:
```typescript
@@ -563,7 +563,7 @@ HRIStudio uses tRPC for type-safe API communication between client and server. A
search?: string
}
```
- **Output**: Paginated participant list
- **Output**: Paginated participant list. Each participant object in this response includes a computed `trialCount` field (number of linked trials) plus derived consent metadata; sensitive fields like `demographics` and `notes` are omitted in this list view.
- **Auth Required**: Yes (Study member)
### `participants.get`
@@ -586,7 +586,7 @@ HRIStudio uses tRPC for type-safe API communication between client and server. A
demographics?: Record<string, any>
}
```
- **Output**: Created participant object
- **Output**: Created participant object (does NOT include `notes` or `trialCount`; `trialCount` is computed and only appears in list output as an aggregate)
- **Auth Required**: Yes (Study researcher)
### `participants.update`

View File

@@ -202,6 +202,9 @@ CREATE TABLE actions (
```sql
-- Participants in studies
-- NOTE: The application exposes a computed `trialCount` field in API list responses.
-- This value is derived at query time by counting linked trials and is NOT persisted
-- as a physical column in this table to avoid redundancy and maintain consistency.
CREATE TABLE participants (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
study_id UUID NOT NULL REFERENCES studies(id) ON DELETE CASCADE,