@milobedini/shared-types 1.0.54 → 1.0.56

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.
Files changed (2) hide show
  1. package/dist/types.d.ts +28 -1
  2. 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 = Pick<Program, '_id' | 'title' | 'description'>;
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: 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;
@@ -381,3 +384,27 @@ export type AdminStats = {
381
384
  unverifiedTherapists: AuthUser[];
382
385
  completedAttempts: number;
383
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milobedini/shared-types",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [