@candesk/contracts 6.9.0 → 6.11.0

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.
@@ -3,4 +3,5 @@ export declare const RMQ_QUEUES: {
3
3
  readonly USERS: 'users_queue';
4
4
  readonly MEDIA: 'media_queue';
5
5
  readonly KYC: 'kyc_queue';
6
+ readonly TREATMENT: 'treatment_queue';
6
7
  };
@@ -5,5 +5,6 @@ exports.RMQ_QUEUES = {
5
5
  NOTIFICATIONS: 'notifications_queue',
6
6
  USERS: 'users_queue',
7
7
  MEDIA: 'media_queue',
8
- KYC: 'kyc_queue'
8
+ KYC: 'kyc_queue',
9
+ TREATMENT: 'treatment_queue'
9
10
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/auth.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: google/protobuf/empty.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/kyc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: kyc.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/media.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,140 @@
1
+ export declare const protobufPackage = "treatment.v1";
2
+ export declare enum QuestionnaireStatus {
3
+ QUESTIONNAIRE_STATUS_UNSPECIFIED = 0,
4
+ QUESTIONNAIRE_STATUS_NONE = 1,
5
+ QUESTIONNAIRE_STATUS_DRAFT = 2,
6
+ QUESTIONNAIRE_STATUS_COMPLETED = 3,
7
+ UNRECOGNIZED = -1
8
+ }
9
+ export declare enum Symptom {
10
+ SYMPTOM_UNSPECIFIED = 0,
11
+ SYMPTOM_CHRONIC_PAIN = 1,
12
+ SYMPTOM_ADHD = 2,
13
+ SYMPTOM_DEPRESSION = 3,
14
+ SYMPTOM_SKIN_CONDITION = 4,
15
+ SYMPTOM_MIGRAINE = 5,
16
+ SYMPTOM_SLEEP_DISORDER = 6,
17
+ SYMPTOM_ANXIETY_PTSD = 7,
18
+ SYMPTOM_CANCER = 8,
19
+ SYMPTOM_OTHER = 9,
20
+ UNRECOGNIZED = -1
21
+ }
22
+ export declare enum SymptomDuration {
23
+ SYMPTOM_DURATION_UNSPECIFIED = 0,
24
+ SYMPTOM_DURATION_LESS_THAN_3_MONTHS = 1,
25
+ SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS = 2,
26
+ SYMPTOM_DURATION_MORE_THAN_6_MONTHS = 3,
27
+ UNRECOGNIZED = -1
28
+ }
29
+ export declare enum IntakeMethod {
30
+ INTAKE_METHOD_UNSPECIFIED = 0,
31
+ INTAKE_METHOD_ORAL = 1,
32
+ INTAKE_METHOD_INHALATION = 2,
33
+ UNRECOGNIZED = -1
34
+ }
35
+ export declare enum TreatmentType {
36
+ TREATMENT_TYPE_UNSPECIFIED = 0,
37
+ TREATMENT_TYPE_ONLINE = 1,
38
+ TREATMENT_TYPE_VIDEO = 2,
39
+ UNRECOGNIZED = -1
40
+ }
41
+ export declare enum TreatmentRequestStatus {
42
+ TREATMENT_REQUEST_STATUS_UNSPECIFIED = 0,
43
+ TREATMENT_REQUEST_STATUS_UNPAID = 1,
44
+ UNRECOGNIZED = -1
45
+ }
46
+ export interface QuestionnaireAnswers {
47
+ symptoms: Symptom[];
48
+ otherSymptoms?: string | undefined;
49
+ duration?: SymptomDuration | undefined;
50
+ severity?: number | undefined;
51
+ previouslyTreated?: boolean | undefined;
52
+ previousTreatments?: string | undefined;
53
+ complaintDescription?: string | undefined;
54
+ familyPsychiatricHistory?: boolean | undefined;
55
+ hypotension?: boolean | undefined;
56
+ noExclusionCriteria?: boolean | undefined;
57
+ legalCapacity?: boolean | undefined;
58
+ currentMedication?: string | undefined;
59
+ cannabisExperience?: boolean | undefined;
60
+ cannabisTolerance?: string | undefined;
61
+ expectedBenefit?: string | undefined;
62
+ primaryDoctor?: string | undefined;
63
+ doctorLetterConsent?: boolean | undefined;
64
+ confirmsTruthfulness?: boolean | undefined;
65
+ intakeMethods: IntakeMethod[];
66
+ medicationWish?: string | undefined;
67
+ }
68
+ export interface Questionnaire {
69
+ status: QuestionnaireStatus;
70
+ step: number;
71
+ answers: QuestionnaireAnswers | undefined;
72
+ completedAt?: string | undefined;
73
+ }
74
+ export interface TreatmentTypeOption {
75
+ type: TreatmentType;
76
+ amount: number;
77
+ currency: string;
78
+ available: boolean;
79
+ }
80
+ export interface TreatmentRequest {
81
+ id: string;
82
+ number: string;
83
+ type: TreatmentType;
84
+ status: TreatmentRequestStatus;
85
+ amount: number;
86
+ currency: string;
87
+ expiresAt?: string | undefined;
88
+ createdAt: string;
89
+ }
90
+ export interface GetQuestionnaireRequest {
91
+ userId: string;
92
+ }
93
+ export interface GetQuestionnaireResponse {
94
+ questionnaire: Questionnaire | undefined;
95
+ }
96
+ export interface SaveQuestionnaireRequest {
97
+ userId: string;
98
+ step: number;
99
+ answers: QuestionnaireAnswers | undefined;
100
+ }
101
+ export interface SaveQuestionnaireResponse {
102
+ questionnaire: Questionnaire | undefined;
103
+ }
104
+ export interface GetTreatmentTypesRequest {
105
+ }
106
+ export interface GetTreatmentTypesResponse {
107
+ types: TreatmentTypeOption[];
108
+ }
109
+ export interface CreateTreatmentRequestRequest {
110
+ userId: string;
111
+ type: TreatmentType;
112
+ }
113
+ export interface CreateTreatmentRequestResponse {
114
+ request: TreatmentRequest | undefined;
115
+ }
116
+ export interface GetTreatmentRequestRequest {
117
+ userId: string;
118
+ id: string;
119
+ }
120
+ export interface GetTreatmentRequestResponse {
121
+ request: TreatmentRequest | undefined;
122
+ }
123
+ export interface ListTreatmentRequestsRequest {
124
+ userId: string;
125
+ page: number;
126
+ }
127
+ export interface ListTreatmentRequestsResponse {
128
+ requests: TreatmentRequest[];
129
+ page: number;
130
+ pageSize: number;
131
+ total: number;
132
+ }
133
+ export interface TreatmentService {
134
+ getQuestionnaire(request: GetQuestionnaireRequest): Promise<GetQuestionnaireResponse>;
135
+ saveQuestionnaire(request: SaveQuestionnaireRequest): Promise<SaveQuestionnaireResponse>;
136
+ getTreatmentTypes(request: GetTreatmentTypesRequest): Promise<GetTreatmentTypesResponse>;
137
+ createTreatmentRequest(request: CreateTreatmentRequestRequest): Promise<CreateTreatmentRequestResponse>;
138
+ getTreatmentRequest(request: GetTreatmentRequestRequest): Promise<GetTreatmentRequestResponse>;
139
+ listTreatmentRequests(request: ListTreatmentRequestsRequest): Promise<ListTreatmentRequestsResponse>;
140
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.15.0
5
+ // protoc v3.21.12
6
+ // source: treatment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TreatmentRequestStatus = exports.TreatmentType = exports.IntakeMethod = exports.SymptomDuration = exports.Symptom = exports.QuestionnaireStatus = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "treatment.v1";
11
+ var QuestionnaireStatus;
12
+ (function (QuestionnaireStatus) {
13
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_UNSPECIFIED"] = 0] = "QUESTIONNAIRE_STATUS_UNSPECIFIED";
14
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_NONE"] = 1] = "QUESTIONNAIRE_STATUS_NONE";
15
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_DRAFT"] = 2] = "QUESTIONNAIRE_STATUS_DRAFT";
16
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_COMPLETED"] = 3] = "QUESTIONNAIRE_STATUS_COMPLETED";
17
+ QuestionnaireStatus[QuestionnaireStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
+ })(QuestionnaireStatus || (exports.QuestionnaireStatus = QuestionnaireStatus = {}));
19
+ var Symptom;
20
+ (function (Symptom) {
21
+ Symptom[Symptom["SYMPTOM_UNSPECIFIED"] = 0] = "SYMPTOM_UNSPECIFIED";
22
+ Symptom[Symptom["SYMPTOM_CHRONIC_PAIN"] = 1] = "SYMPTOM_CHRONIC_PAIN";
23
+ Symptom[Symptom["SYMPTOM_ADHD"] = 2] = "SYMPTOM_ADHD";
24
+ Symptom[Symptom["SYMPTOM_DEPRESSION"] = 3] = "SYMPTOM_DEPRESSION";
25
+ Symptom[Symptom["SYMPTOM_SKIN_CONDITION"] = 4] = "SYMPTOM_SKIN_CONDITION";
26
+ Symptom[Symptom["SYMPTOM_MIGRAINE"] = 5] = "SYMPTOM_MIGRAINE";
27
+ Symptom[Symptom["SYMPTOM_SLEEP_DISORDER"] = 6] = "SYMPTOM_SLEEP_DISORDER";
28
+ Symptom[Symptom["SYMPTOM_ANXIETY_PTSD"] = 7] = "SYMPTOM_ANXIETY_PTSD";
29
+ Symptom[Symptom["SYMPTOM_CANCER"] = 8] = "SYMPTOM_CANCER";
30
+ Symptom[Symptom["SYMPTOM_OTHER"] = 9] = "SYMPTOM_OTHER";
31
+ Symptom[Symptom["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
32
+ })(Symptom || (exports.Symptom = Symptom = {}));
33
+ var SymptomDuration;
34
+ (function (SymptomDuration) {
35
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_UNSPECIFIED"] = 0] = "SYMPTOM_DURATION_UNSPECIFIED";
36
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_LESS_THAN_3_MONTHS"] = 1] = "SYMPTOM_DURATION_LESS_THAN_3_MONTHS";
37
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS"] = 2] = "SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS";
38
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_MORE_THAN_6_MONTHS"] = 3] = "SYMPTOM_DURATION_MORE_THAN_6_MONTHS";
39
+ SymptomDuration[SymptomDuration["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
40
+ })(SymptomDuration || (exports.SymptomDuration = SymptomDuration = {}));
41
+ var IntakeMethod;
42
+ (function (IntakeMethod) {
43
+ IntakeMethod[IntakeMethod["INTAKE_METHOD_UNSPECIFIED"] = 0] = "INTAKE_METHOD_UNSPECIFIED";
44
+ IntakeMethod[IntakeMethod["INTAKE_METHOD_ORAL"] = 1] = "INTAKE_METHOD_ORAL";
45
+ IntakeMethod[IntakeMethod["INTAKE_METHOD_INHALATION"] = 2] = "INTAKE_METHOD_INHALATION";
46
+ IntakeMethod[IntakeMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
47
+ })(IntakeMethod || (exports.IntakeMethod = IntakeMethod = {}));
48
+ var TreatmentType;
49
+ (function (TreatmentType) {
50
+ TreatmentType[TreatmentType["TREATMENT_TYPE_UNSPECIFIED"] = 0] = "TREATMENT_TYPE_UNSPECIFIED";
51
+ TreatmentType[TreatmentType["TREATMENT_TYPE_ONLINE"] = 1] = "TREATMENT_TYPE_ONLINE";
52
+ TreatmentType[TreatmentType["TREATMENT_TYPE_VIDEO"] = 2] = "TREATMENT_TYPE_VIDEO";
53
+ TreatmentType[TreatmentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
54
+ })(TreatmentType || (exports.TreatmentType = TreatmentType = {}));
55
+ var TreatmentRequestStatus;
56
+ (function (TreatmentRequestStatus) {
57
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNSPECIFIED"] = 0] = "TREATMENT_REQUEST_STATUS_UNSPECIFIED";
58
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNPAID"] = 1] = "TREATMENT_REQUEST_STATUS_UNPAID";
59
+ TreatmentRequestStatus[TreatmentRequestStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
60
+ })(TreatmentRequestStatus || (exports.TreatmentRequestStatus = TreatmentRequestStatus = {}));
@@ -20,6 +20,9 @@ export interface UpdateUserRequest {
20
20
  id: string;
21
21
  address: Address | undefined;
22
22
  phone?: string | undefined;
23
+ firstName?: string | undefined;
24
+ lastName?: string | undefined;
25
+ birthDate?: string | undefined;
23
26
  }
24
27
  export interface UpdateUserResponse {
25
28
  user: User | undefined;
package/dist/gen/user.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/nest/auth.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: google/protobuf/empty.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/nest/kyc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: kyc.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,152 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "treatment.v1";
3
+ export declare enum QuestionnaireStatus {
4
+ QUESTIONNAIRE_STATUS_UNSPECIFIED = 0,
5
+ QUESTIONNAIRE_STATUS_NONE = 1,
6
+ QUESTIONNAIRE_STATUS_DRAFT = 2,
7
+ QUESTIONNAIRE_STATUS_COMPLETED = 3,
8
+ UNRECOGNIZED = -1
9
+ }
10
+ export declare enum Symptom {
11
+ SYMPTOM_UNSPECIFIED = 0,
12
+ SYMPTOM_CHRONIC_PAIN = 1,
13
+ SYMPTOM_ADHD = 2,
14
+ SYMPTOM_DEPRESSION = 3,
15
+ SYMPTOM_SKIN_CONDITION = 4,
16
+ SYMPTOM_MIGRAINE = 5,
17
+ SYMPTOM_SLEEP_DISORDER = 6,
18
+ SYMPTOM_ANXIETY_PTSD = 7,
19
+ SYMPTOM_CANCER = 8,
20
+ SYMPTOM_OTHER = 9,
21
+ UNRECOGNIZED = -1
22
+ }
23
+ export declare enum SymptomDuration {
24
+ SYMPTOM_DURATION_UNSPECIFIED = 0,
25
+ SYMPTOM_DURATION_LESS_THAN_3_MONTHS = 1,
26
+ SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS = 2,
27
+ SYMPTOM_DURATION_MORE_THAN_6_MONTHS = 3,
28
+ UNRECOGNIZED = -1
29
+ }
30
+ export declare enum IntakeMethod {
31
+ INTAKE_METHOD_UNSPECIFIED = 0,
32
+ INTAKE_METHOD_ORAL = 1,
33
+ INTAKE_METHOD_INHALATION = 2,
34
+ UNRECOGNIZED = -1
35
+ }
36
+ export declare enum TreatmentType {
37
+ TREATMENT_TYPE_UNSPECIFIED = 0,
38
+ TREATMENT_TYPE_ONLINE = 1,
39
+ TREATMENT_TYPE_VIDEO = 2,
40
+ UNRECOGNIZED = -1
41
+ }
42
+ export declare enum TreatmentRequestStatus {
43
+ TREATMENT_REQUEST_STATUS_UNSPECIFIED = 0,
44
+ TREATMENT_REQUEST_STATUS_UNPAID = 1,
45
+ UNRECOGNIZED = -1
46
+ }
47
+ export interface QuestionnaireAnswers {
48
+ symptoms: Symptom[];
49
+ otherSymptoms?: string | undefined;
50
+ duration?: SymptomDuration | undefined;
51
+ severity?: number | undefined;
52
+ previouslyTreated?: boolean | undefined;
53
+ previousTreatments?: string | undefined;
54
+ complaintDescription?: string | undefined;
55
+ familyPsychiatricHistory?: boolean | undefined;
56
+ hypotension?: boolean | undefined;
57
+ noExclusionCriteria?: boolean | undefined;
58
+ legalCapacity?: boolean | undefined;
59
+ currentMedication?: string | undefined;
60
+ cannabisExperience?: boolean | undefined;
61
+ cannabisTolerance?: string | undefined;
62
+ expectedBenefit?: string | undefined;
63
+ primaryDoctor?: string | undefined;
64
+ doctorLetterConsent?: boolean | undefined;
65
+ confirmsTruthfulness?: boolean | undefined;
66
+ intakeMethods: IntakeMethod[];
67
+ medicationWish?: string | undefined;
68
+ }
69
+ export interface Questionnaire {
70
+ status: QuestionnaireStatus;
71
+ step: number;
72
+ answers: QuestionnaireAnswers | undefined;
73
+ completedAt?: string | undefined;
74
+ }
75
+ export interface TreatmentTypeOption {
76
+ type: TreatmentType;
77
+ amount: number;
78
+ currency: string;
79
+ available: boolean;
80
+ }
81
+ export interface TreatmentRequest {
82
+ id: string;
83
+ number: string;
84
+ type: TreatmentType;
85
+ status: TreatmentRequestStatus;
86
+ amount: number;
87
+ currency: string;
88
+ expiresAt?: string | undefined;
89
+ createdAt: string;
90
+ }
91
+ export interface GetQuestionnaireRequest {
92
+ userId: string;
93
+ }
94
+ export interface GetQuestionnaireResponse {
95
+ questionnaire: Questionnaire | undefined;
96
+ }
97
+ export interface SaveQuestionnaireRequest {
98
+ userId: string;
99
+ step: number;
100
+ answers: QuestionnaireAnswers | undefined;
101
+ }
102
+ export interface SaveQuestionnaireResponse {
103
+ questionnaire: Questionnaire | undefined;
104
+ }
105
+ export interface GetTreatmentTypesRequest {
106
+ }
107
+ export interface GetTreatmentTypesResponse {
108
+ types: TreatmentTypeOption[];
109
+ }
110
+ export interface CreateTreatmentRequestRequest {
111
+ userId: string;
112
+ type: TreatmentType;
113
+ }
114
+ export interface CreateTreatmentRequestResponse {
115
+ request: TreatmentRequest | undefined;
116
+ }
117
+ export interface GetTreatmentRequestRequest {
118
+ userId: string;
119
+ id: string;
120
+ }
121
+ export interface GetTreatmentRequestResponse {
122
+ request: TreatmentRequest | undefined;
123
+ }
124
+ export interface ListTreatmentRequestsRequest {
125
+ userId: string;
126
+ page: number;
127
+ }
128
+ export interface ListTreatmentRequestsResponse {
129
+ requests: TreatmentRequest[];
130
+ page: number;
131
+ pageSize: number;
132
+ total: number;
133
+ }
134
+ export declare const TREATMENT_V1_PACKAGE_NAME = "treatment.v1";
135
+ export interface TreatmentServiceClient {
136
+ getQuestionnaire(request: GetQuestionnaireRequest): Observable<GetQuestionnaireResponse>;
137
+ saveQuestionnaire(request: SaveQuestionnaireRequest): Observable<SaveQuestionnaireResponse>;
138
+ getTreatmentTypes(request: GetTreatmentTypesRequest): Observable<GetTreatmentTypesResponse>;
139
+ createTreatmentRequest(request: CreateTreatmentRequestRequest): Observable<CreateTreatmentRequestResponse>;
140
+ getTreatmentRequest(request: GetTreatmentRequestRequest): Observable<GetTreatmentRequestResponse>;
141
+ listTreatmentRequests(request: ListTreatmentRequestsRequest): Observable<ListTreatmentRequestsResponse>;
142
+ }
143
+ export interface TreatmentServiceController {
144
+ getQuestionnaire(request: GetQuestionnaireRequest): Promise<GetQuestionnaireResponse> | Observable<GetQuestionnaireResponse> | GetQuestionnaireResponse;
145
+ saveQuestionnaire(request: SaveQuestionnaireRequest): Promise<SaveQuestionnaireResponse> | Observable<SaveQuestionnaireResponse> | SaveQuestionnaireResponse;
146
+ getTreatmentTypes(request: GetTreatmentTypesRequest): Promise<GetTreatmentTypesResponse> | Observable<GetTreatmentTypesResponse> | GetTreatmentTypesResponse;
147
+ createTreatmentRequest(request: CreateTreatmentRequestRequest): Promise<CreateTreatmentRequestResponse> | Observable<CreateTreatmentRequestResponse> | CreateTreatmentRequestResponse;
148
+ getTreatmentRequest(request: GetTreatmentRequestRequest): Promise<GetTreatmentRequestResponse> | Observable<GetTreatmentRequestResponse> | GetTreatmentRequestResponse;
149
+ listTreatmentRequests(request: ListTreatmentRequestsRequest): Promise<ListTreatmentRequestsResponse> | Observable<ListTreatmentRequestsResponse> | ListTreatmentRequestsResponse;
150
+ }
151
+ export declare function TreatmentServiceControllerMethods(): (constructor: Function) => void;
152
+ export declare const TREATMENT_SERVICE_NAME = "TreatmentService";
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.15.0
5
+ // protoc v3.21.12
6
+ // source: treatment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TREATMENT_SERVICE_NAME = exports.TREATMENT_V1_PACKAGE_NAME = exports.TreatmentRequestStatus = exports.TreatmentType = exports.IntakeMethod = exports.SymptomDuration = exports.Symptom = exports.QuestionnaireStatus = exports.protobufPackage = void 0;
9
+ exports.TreatmentServiceControllerMethods = TreatmentServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "treatment.v1";
13
+ var QuestionnaireStatus;
14
+ (function (QuestionnaireStatus) {
15
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_UNSPECIFIED"] = 0] = "QUESTIONNAIRE_STATUS_UNSPECIFIED";
16
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_NONE"] = 1] = "QUESTIONNAIRE_STATUS_NONE";
17
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_DRAFT"] = 2] = "QUESTIONNAIRE_STATUS_DRAFT";
18
+ QuestionnaireStatus[QuestionnaireStatus["QUESTIONNAIRE_STATUS_COMPLETED"] = 3] = "QUESTIONNAIRE_STATUS_COMPLETED";
19
+ QuestionnaireStatus[QuestionnaireStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
+ })(QuestionnaireStatus || (exports.QuestionnaireStatus = QuestionnaireStatus = {}));
21
+ var Symptom;
22
+ (function (Symptom) {
23
+ Symptom[Symptom["SYMPTOM_UNSPECIFIED"] = 0] = "SYMPTOM_UNSPECIFIED";
24
+ Symptom[Symptom["SYMPTOM_CHRONIC_PAIN"] = 1] = "SYMPTOM_CHRONIC_PAIN";
25
+ Symptom[Symptom["SYMPTOM_ADHD"] = 2] = "SYMPTOM_ADHD";
26
+ Symptom[Symptom["SYMPTOM_DEPRESSION"] = 3] = "SYMPTOM_DEPRESSION";
27
+ Symptom[Symptom["SYMPTOM_SKIN_CONDITION"] = 4] = "SYMPTOM_SKIN_CONDITION";
28
+ Symptom[Symptom["SYMPTOM_MIGRAINE"] = 5] = "SYMPTOM_MIGRAINE";
29
+ Symptom[Symptom["SYMPTOM_SLEEP_DISORDER"] = 6] = "SYMPTOM_SLEEP_DISORDER";
30
+ Symptom[Symptom["SYMPTOM_ANXIETY_PTSD"] = 7] = "SYMPTOM_ANXIETY_PTSD";
31
+ Symptom[Symptom["SYMPTOM_CANCER"] = 8] = "SYMPTOM_CANCER";
32
+ Symptom[Symptom["SYMPTOM_OTHER"] = 9] = "SYMPTOM_OTHER";
33
+ Symptom[Symptom["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
34
+ })(Symptom || (exports.Symptom = Symptom = {}));
35
+ var SymptomDuration;
36
+ (function (SymptomDuration) {
37
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_UNSPECIFIED"] = 0] = "SYMPTOM_DURATION_UNSPECIFIED";
38
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_LESS_THAN_3_MONTHS"] = 1] = "SYMPTOM_DURATION_LESS_THAN_3_MONTHS";
39
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS"] = 2] = "SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS";
40
+ SymptomDuration[SymptomDuration["SYMPTOM_DURATION_MORE_THAN_6_MONTHS"] = 3] = "SYMPTOM_DURATION_MORE_THAN_6_MONTHS";
41
+ SymptomDuration[SymptomDuration["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
42
+ })(SymptomDuration || (exports.SymptomDuration = SymptomDuration = {}));
43
+ var IntakeMethod;
44
+ (function (IntakeMethod) {
45
+ IntakeMethod[IntakeMethod["INTAKE_METHOD_UNSPECIFIED"] = 0] = "INTAKE_METHOD_UNSPECIFIED";
46
+ IntakeMethod[IntakeMethod["INTAKE_METHOD_ORAL"] = 1] = "INTAKE_METHOD_ORAL";
47
+ IntakeMethod[IntakeMethod["INTAKE_METHOD_INHALATION"] = 2] = "INTAKE_METHOD_INHALATION";
48
+ IntakeMethod[IntakeMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
49
+ })(IntakeMethod || (exports.IntakeMethod = IntakeMethod = {}));
50
+ var TreatmentType;
51
+ (function (TreatmentType) {
52
+ TreatmentType[TreatmentType["TREATMENT_TYPE_UNSPECIFIED"] = 0] = "TREATMENT_TYPE_UNSPECIFIED";
53
+ TreatmentType[TreatmentType["TREATMENT_TYPE_ONLINE"] = 1] = "TREATMENT_TYPE_ONLINE";
54
+ TreatmentType[TreatmentType["TREATMENT_TYPE_VIDEO"] = 2] = "TREATMENT_TYPE_VIDEO";
55
+ TreatmentType[TreatmentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
56
+ })(TreatmentType || (exports.TreatmentType = TreatmentType = {}));
57
+ var TreatmentRequestStatus;
58
+ (function (TreatmentRequestStatus) {
59
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNSPECIFIED"] = 0] = "TREATMENT_REQUEST_STATUS_UNSPECIFIED";
60
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNPAID"] = 1] = "TREATMENT_REQUEST_STATUS_UNPAID";
61
+ TreatmentRequestStatus[TreatmentRequestStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
62
+ })(TreatmentRequestStatus || (exports.TreatmentRequestStatus = TreatmentRequestStatus = {}));
63
+ exports.TREATMENT_V1_PACKAGE_NAME = "treatment.v1";
64
+ function TreatmentServiceControllerMethods() {
65
+ return function (constructor) {
66
+ const grpcMethods = [
67
+ "getQuestionnaire",
68
+ "saveQuestionnaire",
69
+ "getTreatmentTypes",
70
+ "createTreatmentRequest",
71
+ "getTreatmentRequest",
72
+ "listTreatmentRequests",
73
+ ];
74
+ for (const method of grpcMethods) {
75
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
76
+ (0, microservices_1.GrpcMethod)("TreatmentService", method)(constructor.prototype[method], method, descriptor);
77
+ Object.defineProperty(constructor.prototype, method, descriptor);
78
+ }
79
+ const grpcStreamMethods = [];
80
+ for (const method of grpcStreamMethods) {
81
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
82
+ (0, microservices_1.GrpcStreamMethod)("TreatmentService", method)(constructor.prototype[method], method, descriptor);
83
+ Object.defineProperty(constructor.prototype, method, descriptor);
84
+ }
85
+ };
86
+ }
87
+ exports.TREATMENT_SERVICE_NAME = "TreatmentService";
@@ -21,6 +21,9 @@ export interface UpdateUserRequest {
21
21
  id: string;
22
22
  address: Address | undefined;
23
23
  phone?: string | undefined;
24
+ firstName?: string | undefined;
25
+ lastName?: string | undefined;
26
+ birthDate?: string | undefined;
24
27
  }
25
28
  export interface UpdateUserResponse {
26
29
  user: User | undefined;
package/dist/nest/user.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.13.1
4
+ // protoc-gen-ts_proto v2.15.0
5
5
  // protoc v3.21.12
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,4 +4,5 @@ export declare const PROTO_PATHS: {
4
4
  readonly USER: string;
5
5
  readonly MEDIA: string;
6
6
  readonly KYC: string;
7
+ readonly TREATMENT: string;
7
8
  };
@@ -7,5 +7,6 @@ exports.PROTO_PATHS = {
7
7
  ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
8
8
  USER: (0, path_1.join)(__dirname, '../../proto/user.proto'),
9
9
  MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
- KYC: (0, path_1.join)(__dirname, '../../proto/kyc.proto')
10
+ KYC: (0, path_1.join)(__dirname, '../../proto/kyc.proto'),
11
+ TREATMENT: (0, path_1.join)(__dirname, '../../proto/treatment.proto')
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.9.0",
3
+ "version": "6.11.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -0,0 +1,158 @@
1
+ syntax = "proto3";
2
+
3
+ package treatment.v1;
4
+
5
+ service TreatmentService {
6
+ rpc GetQuestionnaire (GetQuestionnaireRequest) returns (GetQuestionnaireResponse);
7
+ rpc SaveQuestionnaire (SaveQuestionnaireRequest) returns (SaveQuestionnaireResponse);
8
+ rpc GetTreatmentTypes (GetTreatmentTypesRequest) returns (GetTreatmentTypesResponse);
9
+ rpc CreateTreatmentRequest (CreateTreatmentRequestRequest) returns (CreateTreatmentRequestResponse);
10
+ rpc GetTreatmentRequest (GetTreatmentRequestRequest) returns (GetTreatmentRequestResponse);
11
+ rpc ListTreatmentRequests (ListTreatmentRequestsRequest) returns (ListTreatmentRequestsResponse);
12
+ }
13
+
14
+ enum QuestionnaireStatus {
15
+ QUESTIONNAIRE_STATUS_UNSPECIFIED = 0;
16
+ QUESTIONNAIRE_STATUS_NONE = 1;
17
+ QUESTIONNAIRE_STATUS_DRAFT = 2;
18
+ QUESTIONNAIRE_STATUS_COMPLETED = 3;
19
+ }
20
+
21
+ enum Symptom {
22
+ SYMPTOM_UNSPECIFIED = 0;
23
+ SYMPTOM_CHRONIC_PAIN = 1;
24
+ SYMPTOM_ADHD = 2;
25
+ SYMPTOM_DEPRESSION = 3;
26
+ SYMPTOM_SKIN_CONDITION = 4;
27
+ SYMPTOM_MIGRAINE = 5;
28
+ SYMPTOM_SLEEP_DISORDER = 6;
29
+ SYMPTOM_ANXIETY_PTSD = 7;
30
+ SYMPTOM_CANCER = 8;
31
+ SYMPTOM_OTHER = 9;
32
+ }
33
+
34
+ enum SymptomDuration {
35
+ SYMPTOM_DURATION_UNSPECIFIED = 0;
36
+ SYMPTOM_DURATION_LESS_THAN_3_MONTHS = 1;
37
+ SYMPTOM_DURATION_BETWEEN_3_AND_6_MONTHS = 2;
38
+ SYMPTOM_DURATION_MORE_THAN_6_MONTHS = 3;
39
+ }
40
+
41
+ enum IntakeMethod {
42
+ INTAKE_METHOD_UNSPECIFIED = 0;
43
+ INTAKE_METHOD_ORAL = 1;
44
+ INTAKE_METHOD_INHALATION = 2;
45
+ }
46
+
47
+ enum TreatmentType {
48
+ TREATMENT_TYPE_UNSPECIFIED = 0;
49
+ TREATMENT_TYPE_ONLINE = 1;
50
+ TREATMENT_TYPE_VIDEO = 2;
51
+ }
52
+
53
+ enum TreatmentRequestStatus {
54
+ TREATMENT_REQUEST_STATUS_UNSPECIFIED = 0;
55
+ TREATMENT_REQUEST_STATUS_UNPAID = 1;
56
+ }
57
+
58
+ message QuestionnaireAnswers {
59
+ repeated Symptom symptoms = 1;
60
+ optional string other_symptoms = 2;
61
+ optional SymptomDuration duration = 3;
62
+ optional int32 severity = 4;
63
+ optional bool previously_treated = 5;
64
+ optional string previous_treatments = 6;
65
+ optional string complaint_description = 7;
66
+ optional bool family_psychiatric_history = 8;
67
+ optional bool hypotension = 9;
68
+ optional bool no_exclusion_criteria = 10;
69
+ optional bool legal_capacity = 11;
70
+ optional string current_medication = 12;
71
+ optional bool cannabis_experience = 13;
72
+ optional string cannabis_tolerance = 14;
73
+ optional string expected_benefit = 15;
74
+ optional string primary_doctor = 16;
75
+ optional bool doctor_letter_consent = 17;
76
+ optional bool confirms_truthfulness = 18;
77
+ repeated IntakeMethod intake_methods = 19;
78
+ optional string medication_wish = 20;
79
+ }
80
+
81
+ message Questionnaire {
82
+ QuestionnaireStatus status = 1;
83
+ int32 step = 2;
84
+ QuestionnaireAnswers answers = 3;
85
+ optional string completed_at = 4;
86
+ }
87
+
88
+ message TreatmentTypeOption {
89
+ TreatmentType type = 1;
90
+ int32 amount = 2;
91
+ string currency = 3;
92
+ bool available = 4;
93
+ }
94
+
95
+ message TreatmentRequest {
96
+ string id = 1;
97
+ string number = 2;
98
+ TreatmentType type = 3;
99
+ TreatmentRequestStatus status = 4;
100
+ int32 amount = 5;
101
+ string currency = 6;
102
+ optional string expires_at = 7;
103
+ string created_at = 8;
104
+ }
105
+
106
+ message GetQuestionnaireRequest {
107
+ string user_id = 1;
108
+ }
109
+
110
+ message GetQuestionnaireResponse {
111
+ Questionnaire questionnaire = 1;
112
+ }
113
+
114
+ message SaveQuestionnaireRequest {
115
+ string user_id = 1;
116
+ int32 step = 2;
117
+ QuestionnaireAnswers answers = 3;
118
+ }
119
+
120
+ message SaveQuestionnaireResponse {
121
+ Questionnaire questionnaire = 1;
122
+ }
123
+
124
+ message GetTreatmentTypesRequest {}
125
+
126
+ message GetTreatmentTypesResponse {
127
+ repeated TreatmentTypeOption types = 1;
128
+ }
129
+
130
+ message CreateTreatmentRequestRequest {
131
+ string user_id = 1;
132
+ TreatmentType type = 2;
133
+ }
134
+
135
+ message CreateTreatmentRequestResponse {
136
+ TreatmentRequest request = 1;
137
+ }
138
+
139
+ message GetTreatmentRequestRequest {
140
+ string user_id = 1;
141
+ string id = 2;
142
+ }
143
+
144
+ message GetTreatmentRequestResponse {
145
+ TreatmentRequest request = 1;
146
+ }
147
+
148
+ message ListTreatmentRequestsRequest {
149
+ string user_id = 1;
150
+ int32 page = 2;
151
+ }
152
+
153
+ message ListTreatmentRequestsResponse {
154
+ repeated TreatmentRequest requests = 1;
155
+ int32 page = 2;
156
+ int32 page_size = 3;
157
+ int32 total = 4;
158
+ }
package/proto/user.proto CHANGED
@@ -35,6 +35,9 @@ message UpdateUserRequest {
35
35
  string id = 1;
36
36
  Address address = 2;
37
37
  optional string phone = 3;
38
+ optional string first_name = 4;
39
+ optional string last_name = 5;
40
+ optional string birth_date = 6;
38
41
  }
39
42
 
40
43
  message UpdateUserResponse {