@milobedini/shared-types 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types.d.ts +35 -4
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -78,12 +78,13 @@ export type Program = ProgramBase & {
|
|
|
78
78
|
export type ProgramWithModules = ProgramBase & {
|
|
79
79
|
modules: Module[];
|
|
80
80
|
};
|
|
81
|
+
export type ProgramRef = string | Pick<Program, '_id' | 'title' | 'description'> | Program;
|
|
81
82
|
export type ModuleType = 'questionnaire' | 'psychoeducation' | 'exercise';
|
|
82
83
|
export type Module = {
|
|
83
84
|
_id: string;
|
|
84
85
|
title: string;
|
|
85
86
|
description: string;
|
|
86
|
-
program:
|
|
87
|
+
program: ProgramRef;
|
|
87
88
|
type: ModuleType;
|
|
88
89
|
disclaimer?: string;
|
|
89
90
|
imageUrl?: string;
|
|
@@ -122,6 +123,8 @@ export type AttemptStatus = 'started' | 'submitted' | 'abandoned';
|
|
|
122
123
|
export type AttemptAnswer = {
|
|
123
124
|
question: string;
|
|
124
125
|
chosenScore: number;
|
|
126
|
+
chosenIndex?: number;
|
|
127
|
+
chosenText?: string;
|
|
125
128
|
};
|
|
126
129
|
export type ModuleSnapshotQuestion = {
|
|
127
130
|
_id: string;
|
|
@@ -247,11 +250,15 @@ export type MyAttemptsResponse = {
|
|
|
247
250
|
export type TherapistUserPreview = Pick<AuthUser, '_id' | 'username' | 'email' | 'name'>;
|
|
248
251
|
export type TherapistModulePreview = Pick<Module, '_id' | 'title'>;
|
|
249
252
|
export type TherapistLatestRow = {
|
|
253
|
+
_id: string;
|
|
250
254
|
user: TherapistUserPreview;
|
|
251
255
|
module: TherapistModulePreview;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
iteration?: number;
|
|
257
|
+
completedAt?: string;
|
|
258
|
+
totalScore?: number;
|
|
259
|
+
scoreBandLabel?: string;
|
|
260
|
+
weekStart?: string;
|
|
261
|
+
band?: ScoreBandSummary;
|
|
255
262
|
};
|
|
256
263
|
export type TherapistLatestResponse = {
|
|
257
264
|
success: boolean;
|
|
@@ -377,3 +384,27 @@ export type AdminStats = {
|
|
|
377
384
|
unverifiedTherapists: AuthUser[];
|
|
378
385
|
completedAttempts: number;
|
|
379
386
|
};
|
|
387
|
+
export type AttemptDetailItem = {
|
|
388
|
+
order: number;
|
|
389
|
+
questionId: string;
|
|
390
|
+
questionText: string;
|
|
391
|
+
choices: Choice[];
|
|
392
|
+
chosenScore?: number | null;
|
|
393
|
+
chosenIndex?: number | null;
|
|
394
|
+
chosenText?: string | null;
|
|
395
|
+
};
|
|
396
|
+
export type AttemptDetail = {
|
|
397
|
+
items: AttemptDetailItem[];
|
|
398
|
+
answeredCount: number;
|
|
399
|
+
totalQuestions: number;
|
|
400
|
+
percentComplete: number;
|
|
401
|
+
};
|
|
402
|
+
export type AttemptDetailResponse = {
|
|
403
|
+
success: boolean;
|
|
404
|
+
attempt: ModuleAttempt & {
|
|
405
|
+
band?: ScoreBandSummary;
|
|
406
|
+
detail: AttemptDetail;
|
|
407
|
+
patient?: Pick<AuthUser, '_id' | 'name' | 'username' | 'email'>;
|
|
408
|
+
module?: Pick<Module, '_id' | 'title' | 'type'>;
|
|
409
|
+
};
|
|
410
|
+
};
|