@candesk/contracts 6.40.0 → 6.42.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.
Files changed (41) hide show
  1. package/dist/events/auth/email-changed.interface.d.ts +2 -0
  2. package/dist/events/auth/telegram-linked.interface.d.ts +2 -0
  3. package/dist/events/auth/telegram-unlinked.interface.d.ts +2 -0
  4. package/dist/events/auth/totp-disabled.interface.d.ts +2 -0
  5. package/dist/events/auth/totp-enabled.interface.d.ts +2 -0
  6. package/dist/events/kyc/verification-completed.interface.d.ts +2 -0
  7. package/dist/events/treatment/treatment-request-paid.interface.d.ts +2 -0
  8. package/dist/gen/account.js +1 -1
  9. package/dist/gen/audit.js +1 -1
  10. package/dist/gen/auth.js +1 -1
  11. package/dist/gen/google/protobuf/empty.js +1 -1
  12. package/dist/gen/kyc.js +1 -1
  13. package/dist/gen/media.js +1 -1
  14. package/dist/gen/notification.d.ts +55 -0
  15. package/dist/gen/notification.js +26 -0
  16. package/dist/gen/payment.d.ts +13 -0
  17. package/dist/gen/payment.js +1 -1
  18. package/dist/gen/staff.js +1 -1
  19. package/dist/gen/treatment.d.ts +14 -0
  20. package/dist/gen/treatment.js +1 -1
  21. package/dist/gen/user.js +1 -1
  22. package/dist/nest/account.js +1 -1
  23. package/dist/nest/audit.js +1 -1
  24. package/dist/nest/auth.js +1 -1
  25. package/dist/nest/google/protobuf/empty.js +1 -1
  26. package/dist/nest/kyc.js +1 -1
  27. package/dist/nest/media.js +1 -1
  28. package/dist/nest/notification.d.ts +64 -0
  29. package/dist/nest/notification.js +46 -0
  30. package/dist/nest/payment.d.ts +14 -0
  31. package/dist/nest/payment.js +2 -2
  32. package/dist/nest/staff.js +1 -1
  33. package/dist/nest/treatment.d.ts +15 -0
  34. package/dist/nest/treatment.js +2 -1
  35. package/dist/nest/user.js +1 -1
  36. package/dist/proto/paths.d.ts +1 -0
  37. package/dist/proto/paths.js +2 -1
  38. package/package.json +3 -2
  39. package/proto/notification.proto +56 -0
  40. package/proto/payment.proto +15 -0
  41. package/proto/treatment.proto +16 -0
@@ -1,3 +1,5 @@
1
1
  export interface EmailChangedEvent {
2
+ eventId: string;
3
+ accountId: string;
2
4
  previousEmail: string;
3
5
  }
@@ -1,3 +1,5 @@
1
1
  export interface TelegramLinkedEvent {
2
+ eventId: string;
3
+ accountId: string;
2
4
  email: string;
3
5
  }
@@ -1,4 +1,6 @@
1
1
  export interface TelegramUnlinkedEvent {
2
+ eventId: string;
3
+ accountId: string;
2
4
  email: string;
3
5
  telegramId: string;
4
6
  }
@@ -1,3 +1,5 @@
1
1
  export interface TotpDisabledEvent {
2
+ eventId: string;
3
+ accountId: string;
2
4
  email: string;
3
5
  }
@@ -1,3 +1,5 @@
1
1
  export interface TotpEnabledEvent {
2
+ eventId: string;
3
+ accountId: string;
2
4
  email: string;
3
5
  }
@@ -1,5 +1,7 @@
1
1
  export type VerificationResult = 'VERIFIED' | 'REJECTED' | 'MISMATCH' | 'DUPLICATE';
2
2
  export interface VerificationCompletedEvent {
3
+ eventId: string;
4
+ accountId: string;
3
5
  email: string;
4
6
  result: VerificationResult;
5
7
  }
@@ -1,4 +1,6 @@
1
1
  export interface TreatmentRequestPaidEvent {
2
+ eventId: string;
3
+ accountId: string;
2
4
  email: string;
3
5
  number: string;
4
6
  }
@@ -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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/audit.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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: audit.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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,55 @@
1
+ export declare const protobufPackage = "notification.v1";
2
+ export declare const protobufFileName = "notification.proto";
3
+ export declare enum NotificationType {
4
+ NOTIFICATION_TYPE_UNSPECIFIED = 0,
5
+ NOTIFICATION_TYPE_IDENTITY_VERIFIED = 1,
6
+ NOTIFICATION_TYPE_IDENTITY_REJECTED = 2,
7
+ NOTIFICATION_TYPE_IDENTITY_MISMATCH = 3,
8
+ NOTIFICATION_TYPE_IDENTITY_DUPLICATE = 4,
9
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID = 5,
10
+ NOTIFICATION_TYPE_EMAIL_CHANGED = 6,
11
+ NOTIFICATION_TYPE_TELEGRAM_LINKED = 7,
12
+ NOTIFICATION_TYPE_TELEGRAM_UNLINKED = 8,
13
+ NOTIFICATION_TYPE_TOTP_ENABLED = 9,
14
+ NOTIFICATION_TYPE_TOTP_DISABLED = 10,
15
+ UNRECOGNIZED = -1
16
+ }
17
+ export interface Notification {
18
+ id: string;
19
+ type: NotificationType;
20
+ params: {
21
+ [key: string]: string;
22
+ };
23
+ readAt?: string | undefined;
24
+ createdAt: string;
25
+ }
26
+ export interface Notification_ParamsEntry {
27
+ key: string;
28
+ value: string;
29
+ }
30
+ export interface ListNotificationsRequest {
31
+ userId: string;
32
+ cursor?: string | undefined;
33
+ limit: number;
34
+ }
35
+ export interface ListNotificationsResponse {
36
+ notifications: Notification[];
37
+ nextCursor?: string | undefined;
38
+ }
39
+ export interface MarkNotificationsReadRequest {
40
+ userId: string;
41
+ until: string;
42
+ }
43
+ export interface MarkNotificationsReadResponse {
44
+ }
45
+ export interface DeleteNotificationsRequest {
46
+ userId: string;
47
+ until: string;
48
+ }
49
+ export interface DeleteNotificationsResponse {
50
+ }
51
+ export interface NotificationService {
52
+ listNotifications(request: ListNotificationsRequest): Promise<ListNotificationsResponse>;
53
+ markNotificationsRead(request: MarkNotificationsReadRequest): Promise<MarkNotificationsReadResponse>;
54
+ deleteNotifications(request: DeleteNotificationsRequest): Promise<DeleteNotificationsResponse>;
55
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.18.3
5
+ // protoc v3.21.12
6
+ // source: notification.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.NotificationType = exports.protobufFileName = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "notification.v1";
11
+ exports.protobufFileName = "notification.proto";
12
+ var NotificationType;
13
+ (function (NotificationType) {
14
+ NotificationType[NotificationType["NOTIFICATION_TYPE_UNSPECIFIED"] = 0] = "NOTIFICATION_TYPE_UNSPECIFIED";
15
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_VERIFIED"] = 1] = "NOTIFICATION_TYPE_IDENTITY_VERIFIED";
16
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_REJECTED"] = 2] = "NOTIFICATION_TYPE_IDENTITY_REJECTED";
17
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_MISMATCH"] = 3] = "NOTIFICATION_TYPE_IDENTITY_MISMATCH";
18
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_DUPLICATE"] = 4] = "NOTIFICATION_TYPE_IDENTITY_DUPLICATE";
19
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID"] = 5] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID";
20
+ NotificationType[NotificationType["NOTIFICATION_TYPE_EMAIL_CHANGED"] = 6] = "NOTIFICATION_TYPE_EMAIL_CHANGED";
21
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TELEGRAM_LINKED"] = 7] = "NOTIFICATION_TYPE_TELEGRAM_LINKED";
22
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TELEGRAM_UNLINKED"] = 8] = "NOTIFICATION_TYPE_TELEGRAM_UNLINKED";
23
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TOTP_ENABLED"] = 9] = "NOTIFICATION_TYPE_TOTP_ENABLED";
24
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TOTP_DISABLED"] = 10] = "NOTIFICATION_TYPE_TOTP_DISABLED";
25
+ NotificationType[NotificationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(NotificationType || (exports.NotificationType = NotificationType = {}));
@@ -32,6 +32,12 @@ export interface Payment {
32
32
  status: PaymentStatus;
33
33
  checkoutUrl?: string | undefined;
34
34
  expiresAt?: string | undefined;
35
+ provider: PaymentProvider;
36
+ providerPaymentId: string;
37
+ amount: number;
38
+ currency: string;
39
+ createdAt: string;
40
+ paidAt?: string | undefined;
35
41
  }
36
42
  export interface CreatePaymentRequest {
37
43
  referenceId: string;
@@ -52,6 +58,12 @@ export interface GetPaymentRequest {
52
58
  export interface GetPaymentResponse {
53
59
  payment: Payment | undefined;
54
60
  }
61
+ export interface ListPaymentsRequest {
62
+ referenceId: string;
63
+ }
64
+ export interface ListPaymentsResponse {
65
+ payments: Payment[];
66
+ }
55
67
  export interface HandleWebhookRequest {
56
68
  provider: PaymentProvider;
57
69
  payload: string;
@@ -63,5 +75,6 @@ export interface HandleWebhookResponse {
63
75
  export interface PaymentService {
64
76
  createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse>;
65
77
  getPayment(request: GetPaymentRequest): Promise<GetPaymentResponse>;
78
+ listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse>;
66
79
  handleWebhook(request: HandleWebhookRequest): Promise<HandleWebhookResponse>;
67
80
  }
@@ -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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: payment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/staff.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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: staff.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -91,6 +91,8 @@ export interface TreatmentRequest {
91
91
  createdAt: string;
92
92
  medicationWish: string;
93
93
  paidAt?: string | undefined;
94
+ userId: string;
95
+ withdrawalWaiverAt?: string | undefined;
94
96
  }
95
97
  export interface GetQuestionnaireRequest {
96
98
  userId: string;
@@ -134,6 +136,17 @@ export interface ListTreatmentRequestsResponse {
134
136
  requests: TreatmentRequest[];
135
137
  nextCursor?: string | undefined;
136
138
  }
139
+ export interface ListAllTreatmentRequestsRequest {
140
+ number?: string | undefined;
141
+ status?: TreatmentRequestStatus | undefined;
142
+ type?: TreatmentType | undefined;
143
+ cursor?: string | undefined;
144
+ limit: number;
145
+ }
146
+ export interface ListAllTreatmentRequestsResponse {
147
+ requests: TreatmentRequest[];
148
+ nextCursor?: string | undefined;
149
+ }
137
150
  export interface UpdateTreatmentRequestRequest {
138
151
  userId: string;
139
152
  id: string;
@@ -163,6 +176,7 @@ export interface TreatmentService {
163
176
  createTreatmentRequest(request: CreateTreatmentRequestRequest): Promise<CreateTreatmentRequestResponse>;
164
177
  getTreatmentRequest(request: GetTreatmentRequestRequest): Promise<GetTreatmentRequestResponse>;
165
178
  listTreatmentRequests(request: ListTreatmentRequestsRequest): Promise<ListTreatmentRequestsResponse>;
179
+ listAllTreatmentRequests(request: ListAllTreatmentRequestsRequest): Promise<ListAllTreatmentRequestsResponse>;
166
180
  updateTreatmentRequest(request: UpdateTreatmentRequestRequest): Promise<UpdateTreatmentRequestResponse>;
167
181
  deleteTreatmentRequest(request: DeleteTreatmentRequestRequest): Promise<DeleteTreatmentRequestResponse>;
168
182
  startPayment(request: StartPaymentRequest): Promise<StartPaymentResponse>;
@@ -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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: account.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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: audit.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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,64 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "notification.v1";
3
+ export declare const protobufFileName = "notification.proto";
4
+ export declare enum NotificationType {
5
+ NOTIFICATION_TYPE_UNSPECIFIED = 0,
6
+ NOTIFICATION_TYPE_IDENTITY_VERIFIED = 1,
7
+ NOTIFICATION_TYPE_IDENTITY_REJECTED = 2,
8
+ NOTIFICATION_TYPE_IDENTITY_MISMATCH = 3,
9
+ NOTIFICATION_TYPE_IDENTITY_DUPLICATE = 4,
10
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID = 5,
11
+ NOTIFICATION_TYPE_EMAIL_CHANGED = 6,
12
+ NOTIFICATION_TYPE_TELEGRAM_LINKED = 7,
13
+ NOTIFICATION_TYPE_TELEGRAM_UNLINKED = 8,
14
+ NOTIFICATION_TYPE_TOTP_ENABLED = 9,
15
+ NOTIFICATION_TYPE_TOTP_DISABLED = 10,
16
+ UNRECOGNIZED = -1
17
+ }
18
+ export interface Notification {
19
+ id: string;
20
+ type: NotificationType;
21
+ params: {
22
+ [key: string]: string;
23
+ };
24
+ readAt?: string | undefined;
25
+ createdAt: string;
26
+ }
27
+ export interface Notification_ParamsEntry {
28
+ key: string;
29
+ value: string;
30
+ }
31
+ export interface ListNotificationsRequest {
32
+ userId: string;
33
+ cursor?: string | undefined;
34
+ limit: number;
35
+ }
36
+ export interface ListNotificationsResponse {
37
+ notifications: Notification[];
38
+ nextCursor?: string | undefined;
39
+ }
40
+ export interface MarkNotificationsReadRequest {
41
+ userId: string;
42
+ until: string;
43
+ }
44
+ export interface MarkNotificationsReadResponse {
45
+ }
46
+ export interface DeleteNotificationsRequest {
47
+ userId: string;
48
+ until: string;
49
+ }
50
+ export interface DeleteNotificationsResponse {
51
+ }
52
+ export declare const NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
53
+ export interface NotificationServiceClient {
54
+ listNotifications(request: ListNotificationsRequest): Observable<ListNotificationsResponse>;
55
+ markNotificationsRead(request: MarkNotificationsReadRequest): Observable<MarkNotificationsReadResponse>;
56
+ deleteNotifications(request: DeleteNotificationsRequest): Observable<DeleteNotificationsResponse>;
57
+ }
58
+ export interface NotificationServiceController {
59
+ listNotifications(request: ListNotificationsRequest): Promise<ListNotificationsResponse> | Observable<ListNotificationsResponse> | ListNotificationsResponse;
60
+ markNotificationsRead(request: MarkNotificationsReadRequest): Promise<MarkNotificationsReadResponse> | Observable<MarkNotificationsReadResponse> | MarkNotificationsReadResponse;
61
+ deleteNotifications(request: DeleteNotificationsRequest): Promise<DeleteNotificationsResponse> | Observable<DeleteNotificationsResponse> | DeleteNotificationsResponse;
62
+ }
63
+ export declare function NotificationServiceControllerMethods(): (constructor: Function) => void;
64
+ export declare const NOTIFICATION_SERVICE_NAME = "NotificationService";
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.18.3
5
+ // protoc v3.21.12
6
+ // source: notification.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.NOTIFICATION_SERVICE_NAME = exports.NOTIFICATION_V1_PACKAGE_NAME = exports.NotificationType = exports.protobufFileName = exports.protobufPackage = void 0;
9
+ exports.NotificationServiceControllerMethods = NotificationServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "notification.v1";
13
+ exports.protobufFileName = "notification.proto";
14
+ var NotificationType;
15
+ (function (NotificationType) {
16
+ NotificationType[NotificationType["NOTIFICATION_TYPE_UNSPECIFIED"] = 0] = "NOTIFICATION_TYPE_UNSPECIFIED";
17
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_VERIFIED"] = 1] = "NOTIFICATION_TYPE_IDENTITY_VERIFIED";
18
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_REJECTED"] = 2] = "NOTIFICATION_TYPE_IDENTITY_REJECTED";
19
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_MISMATCH"] = 3] = "NOTIFICATION_TYPE_IDENTITY_MISMATCH";
20
+ NotificationType[NotificationType["NOTIFICATION_TYPE_IDENTITY_DUPLICATE"] = 4] = "NOTIFICATION_TYPE_IDENTITY_DUPLICATE";
21
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID"] = 5] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID";
22
+ NotificationType[NotificationType["NOTIFICATION_TYPE_EMAIL_CHANGED"] = 6] = "NOTIFICATION_TYPE_EMAIL_CHANGED";
23
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TELEGRAM_LINKED"] = 7] = "NOTIFICATION_TYPE_TELEGRAM_LINKED";
24
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TELEGRAM_UNLINKED"] = 8] = "NOTIFICATION_TYPE_TELEGRAM_UNLINKED";
25
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TOTP_ENABLED"] = 9] = "NOTIFICATION_TYPE_TOTP_ENABLED";
26
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TOTP_DISABLED"] = 10] = "NOTIFICATION_TYPE_TOTP_DISABLED";
27
+ NotificationType[NotificationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
28
+ })(NotificationType || (exports.NotificationType = NotificationType = {}));
29
+ exports.NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
30
+ function NotificationServiceControllerMethods() {
31
+ return function (constructor) {
32
+ const grpcMethods = ["listNotifications", "markNotificationsRead", "deleteNotifications"];
33
+ for (const method of grpcMethods) {
34
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
35
+ (0, microservices_1.GrpcMethod)("NotificationService", method)(constructor.prototype[method], method, descriptor);
36
+ Object.defineProperty(constructor.prototype, method, descriptor);
37
+ }
38
+ const grpcStreamMethods = [];
39
+ for (const method of grpcStreamMethods) {
40
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
41
+ (0, microservices_1.GrpcStreamMethod)("NotificationService", method)(constructor.prototype[method], method, descriptor);
42
+ Object.defineProperty(constructor.prototype, method, descriptor);
43
+ }
44
+ };
45
+ }
46
+ exports.NOTIFICATION_SERVICE_NAME = "NotificationService";
@@ -33,6 +33,12 @@ export interface Payment {
33
33
  status: PaymentStatus;
34
34
  checkoutUrl?: string | undefined;
35
35
  expiresAt?: string | undefined;
36
+ provider: PaymentProvider;
37
+ providerPaymentId: string;
38
+ amount: number;
39
+ currency: string;
40
+ createdAt: string;
41
+ paidAt?: string | undefined;
36
42
  }
37
43
  export interface CreatePaymentRequest {
38
44
  referenceId: string;
@@ -53,6 +59,12 @@ export interface GetPaymentRequest {
53
59
  export interface GetPaymentResponse {
54
60
  payment: Payment | undefined;
55
61
  }
62
+ export interface ListPaymentsRequest {
63
+ referenceId: string;
64
+ }
65
+ export interface ListPaymentsResponse {
66
+ payments: Payment[];
67
+ }
56
68
  export interface HandleWebhookRequest {
57
69
  provider: PaymentProvider;
58
70
  payload: string;
@@ -65,11 +77,13 @@ export declare const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
65
77
  export interface PaymentServiceClient {
66
78
  createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
67
79
  getPayment(request: GetPaymentRequest): Observable<GetPaymentResponse>;
80
+ listPayments(request: ListPaymentsRequest): Observable<ListPaymentsResponse>;
68
81
  handleWebhook(request: HandleWebhookRequest): Observable<HandleWebhookResponse>;
69
82
  }
70
83
  export interface PaymentServiceController {
71
84
  createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
72
85
  getPayment(request: GetPaymentRequest): Promise<GetPaymentResponse> | Observable<GetPaymentResponse> | GetPaymentResponse;
86
+ listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse> | Observable<ListPaymentsResponse> | ListPaymentsResponse;
73
87
  handleWebhook(request: HandleWebhookRequest): Promise<HandleWebhookResponse> | Observable<HandleWebhookResponse> | HandleWebhookResponse;
74
88
  }
75
89
  export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
@@ -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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: payment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -31,7 +31,7 @@ var PaymentProvider;
31
31
  exports.PAYMENT_V1_PACKAGE_NAME = "payment.v1";
32
32
  function PaymentServiceControllerMethods() {
33
33
  return function (constructor) {
34
- const grpcMethods = ["createPayment", "getPayment", "handleWebhook"];
34
+ const grpcMethods = ["createPayment", "getPayment", "listPayments", "handleWebhook"];
35
35
  for (const method of grpcMethods) {
36
36
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
37
  (0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
@@ -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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: staff.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -92,6 +92,8 @@ export interface TreatmentRequest {
92
92
  createdAt: string;
93
93
  medicationWish: string;
94
94
  paidAt?: string | undefined;
95
+ userId: string;
96
+ withdrawalWaiverAt?: string | undefined;
95
97
  }
96
98
  export interface GetQuestionnaireRequest {
97
99
  userId: string;
@@ -135,6 +137,17 @@ export interface ListTreatmentRequestsResponse {
135
137
  requests: TreatmentRequest[];
136
138
  nextCursor?: string | undefined;
137
139
  }
140
+ export interface ListAllTreatmentRequestsRequest {
141
+ number?: string | undefined;
142
+ status?: TreatmentRequestStatus | undefined;
143
+ type?: TreatmentType | undefined;
144
+ cursor?: string | undefined;
145
+ limit: number;
146
+ }
147
+ export interface ListAllTreatmentRequestsResponse {
148
+ requests: TreatmentRequest[];
149
+ nextCursor?: string | undefined;
150
+ }
138
151
  export interface UpdateTreatmentRequestRequest {
139
152
  userId: string;
140
153
  id: string;
@@ -165,6 +178,7 @@ export interface TreatmentServiceClient {
165
178
  createTreatmentRequest(request: CreateTreatmentRequestRequest): Observable<CreateTreatmentRequestResponse>;
166
179
  getTreatmentRequest(request: GetTreatmentRequestRequest): Observable<GetTreatmentRequestResponse>;
167
180
  listTreatmentRequests(request: ListTreatmentRequestsRequest): Observable<ListTreatmentRequestsResponse>;
181
+ listAllTreatmentRequests(request: ListAllTreatmentRequestsRequest): Observable<ListAllTreatmentRequestsResponse>;
168
182
  updateTreatmentRequest(request: UpdateTreatmentRequestRequest): Observable<UpdateTreatmentRequestResponse>;
169
183
  deleteTreatmentRequest(request: DeleteTreatmentRequestRequest): Observable<DeleteTreatmentRequestResponse>;
170
184
  startPayment(request: StartPaymentRequest): Observable<StartPaymentResponse>;
@@ -176,6 +190,7 @@ export interface TreatmentServiceController {
176
190
  createTreatmentRequest(request: CreateTreatmentRequestRequest): Promise<CreateTreatmentRequestResponse> | Observable<CreateTreatmentRequestResponse> | CreateTreatmentRequestResponse;
177
191
  getTreatmentRequest(request: GetTreatmentRequestRequest): Promise<GetTreatmentRequestResponse> | Observable<GetTreatmentRequestResponse> | GetTreatmentRequestResponse;
178
192
  listTreatmentRequests(request: ListTreatmentRequestsRequest): Promise<ListTreatmentRequestsResponse> | Observable<ListTreatmentRequestsResponse> | ListTreatmentRequestsResponse;
193
+ listAllTreatmentRequests(request: ListAllTreatmentRequestsRequest): Promise<ListAllTreatmentRequestsResponse> | Observable<ListAllTreatmentRequestsResponse> | ListAllTreatmentRequestsResponse;
179
194
  updateTreatmentRequest(request: UpdateTreatmentRequestRequest): Promise<UpdateTreatmentRequestResponse> | Observable<UpdateTreatmentRequestResponse> | UpdateTreatmentRequestResponse;
180
195
  deleteTreatmentRequest(request: DeleteTreatmentRequestRequest): Promise<DeleteTreatmentRequestResponse> | Observable<DeleteTreatmentRequestResponse> | DeleteTreatmentRequestResponse;
181
196
  startPayment(request: StartPaymentRequest): Promise<StartPaymentResponse> | Observable<StartPaymentResponse> | StartPaymentResponse;
@@ -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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -73,6 +73,7 @@ function TreatmentServiceControllerMethods() {
73
73
  "createTreatmentRequest",
74
74
  "getTreatmentRequest",
75
75
  "listTreatmentRequests",
76
+ "listAllTreatmentRequests",
76
77
  "updateTreatmentRequest",
77
78
  "deleteTreatmentRequest",
78
79
  "startPayment",
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.18.1
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,4 +8,5 @@ export declare const PROTO_PATHS: {
8
8
  readonly TREATMENT: string;
9
9
  readonly PAYMENT: string;
10
10
  readonly AUDIT: string;
11
+ readonly NOTIFICATION: string;
11
12
  };
@@ -11,5 +11,6 @@ exports.PROTO_PATHS = {
11
11
  KYC: (0, path_1.join)(__dirname, '../../proto/kyc.proto'),
12
12
  TREATMENT: (0, path_1.join)(__dirname, '../../proto/treatment.proto'),
13
13
  PAYMENT: (0, path_1.join)(__dirname, '../../proto/payment.proto'),
14
- AUDIT: (0, path_1.join)(__dirname, '../../proto/audit.proto')
14
+ AUDIT: (0, path_1.join)(__dirname, '../../proto/audit.proto'),
15
+ NOTIFICATION: (0, path_1.join)(__dirname, '../../proto/notification.proto')
15
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.40.0",
3
+ "version": "6.42.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -39,7 +39,8 @@
39
39
  "generate": "yarn generate:types && yarn generate:nest",
40
40
  "generate:types": "node -e \"require('fs').mkdirSync('src/gen',{recursive:true})\" && protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen --ts_proto_opt=onlyTypes=true,package=omit,lowerCaseServiceMethods=true,forceLong=string",
41
41
  "generate:nest": "node -e \"require('fs').mkdirSync('src/nest',{recursive:true})\" && protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/nest --ts_proto_opt=nestJs=true,package=omit,forceLong=string",
42
- "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\""
42
+ "format": "prettier --write \"src/**/*.ts\"",
43
+ "format:check": "prettier --check \"src/**/*.ts\""
43
44
  },
44
45
  "devDependencies": {
45
46
  "@candesk/core": "^1.1.2",
@@ -0,0 +1,56 @@
1
+ syntax = "proto3";
2
+
3
+ package notification.v1;
4
+
5
+ service NotificationService {
6
+ rpc ListNotifications (ListNotificationsRequest) returns (ListNotificationsResponse);
7
+ rpc MarkNotificationsRead (MarkNotificationsReadRequest) returns (MarkNotificationsReadResponse);
8
+ rpc DeleteNotifications (DeleteNotificationsRequest) returns (DeleteNotificationsResponse);
9
+ }
10
+
11
+ enum NotificationType {
12
+ NOTIFICATION_TYPE_UNSPECIFIED = 0;
13
+ NOTIFICATION_TYPE_IDENTITY_VERIFIED = 1;
14
+ NOTIFICATION_TYPE_IDENTITY_REJECTED = 2;
15
+ NOTIFICATION_TYPE_IDENTITY_MISMATCH = 3;
16
+ NOTIFICATION_TYPE_IDENTITY_DUPLICATE = 4;
17
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_PAID = 5;
18
+ NOTIFICATION_TYPE_EMAIL_CHANGED = 6;
19
+ NOTIFICATION_TYPE_TELEGRAM_LINKED = 7;
20
+ NOTIFICATION_TYPE_TELEGRAM_UNLINKED = 8;
21
+ NOTIFICATION_TYPE_TOTP_ENABLED = 9;
22
+ NOTIFICATION_TYPE_TOTP_DISABLED = 10;
23
+ }
24
+
25
+ message Notification {
26
+ string id = 1;
27
+ NotificationType type = 2;
28
+ map<string, string> params = 3;
29
+ optional string read_at = 4;
30
+ string created_at = 5;
31
+ }
32
+
33
+ message ListNotificationsRequest {
34
+ string user_id = 1;
35
+ optional string cursor = 2;
36
+ int32 limit = 3;
37
+ }
38
+
39
+ message ListNotificationsResponse {
40
+ repeated Notification notifications = 1;
41
+ optional string next_cursor = 2;
42
+ }
43
+
44
+ message MarkNotificationsReadRequest {
45
+ string user_id = 1;
46
+ string until = 2;
47
+ }
48
+
49
+ message MarkNotificationsReadResponse {}
50
+
51
+ message DeleteNotificationsRequest {
52
+ string user_id = 1;
53
+ string until = 2;
54
+ }
55
+
56
+ message DeleteNotificationsResponse {}
@@ -5,6 +5,7 @@ package payment.v1;
5
5
  service PaymentService {
6
6
  rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
7
7
  rpc GetPayment (GetPaymentRequest) returns (GetPaymentResponse);
8
+ rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse);
8
9
  rpc HandleWebhook (HandleWebhookRequest) returns (HandleWebhookResponse);
9
10
  }
10
11
 
@@ -42,6 +43,12 @@ message Payment {
42
43
  PaymentStatus status = 2;
43
44
  optional string checkout_url = 3;
44
45
  optional string expires_at = 4;
46
+ PaymentProvider provider = 5;
47
+ string provider_payment_id = 6;
48
+ int32 amount = 7;
49
+ string currency = 8;
50
+ string created_at = 9;
51
+ optional string paid_at = 10;
45
52
  }
46
53
 
47
54
  message CreatePaymentRequest {
@@ -67,6 +74,14 @@ message GetPaymentResponse {
67
74
  Payment payment = 1;
68
75
  }
69
76
 
77
+ message ListPaymentsRequest {
78
+ string reference_id = 1;
79
+ }
80
+
81
+ message ListPaymentsResponse {
82
+ repeated Payment payments = 1;
83
+ }
84
+
70
85
  message HandleWebhookRequest {
71
86
  PaymentProvider provider = 1;
72
87
  string payload = 2;
@@ -9,6 +9,7 @@ service TreatmentService {
9
9
  rpc CreateTreatmentRequest (CreateTreatmentRequestRequest) returns (CreateTreatmentRequestResponse);
10
10
  rpc GetTreatmentRequest (GetTreatmentRequestRequest) returns (GetTreatmentRequestResponse);
11
11
  rpc ListTreatmentRequests (ListTreatmentRequestsRequest) returns (ListTreatmentRequestsResponse);
12
+ rpc ListAllTreatmentRequests (ListAllTreatmentRequestsRequest) returns (ListAllTreatmentRequestsResponse);
12
13
  rpc UpdateTreatmentRequest (UpdateTreatmentRequestRequest) returns (UpdateTreatmentRequestResponse);
13
14
  rpc DeleteTreatmentRequest (DeleteTreatmentRequestRequest) returns (DeleteTreatmentRequestResponse);
14
15
  rpc StartPayment (StartPaymentRequest) returns (StartPaymentResponse);
@@ -108,6 +109,8 @@ message TreatmentRequest {
108
109
  string created_at = 8;
109
110
  string medication_wish = 9;
110
111
  optional string paid_at = 10;
112
+ string user_id = 11;
113
+ optional string withdrawal_waiver_at = 12;
111
114
  }
112
115
 
113
116
  message GetQuestionnaireRequest {
@@ -165,6 +168,19 @@ message ListTreatmentRequestsResponse {
165
168
  optional string next_cursor = 5;
166
169
  }
167
170
 
171
+ message ListAllTreatmentRequestsRequest {
172
+ optional string number = 1;
173
+ optional TreatmentRequestStatus status = 2;
174
+ optional TreatmentType type = 3;
175
+ optional string cursor = 4;
176
+ int32 limit = 5;
177
+ }
178
+
179
+ message ListAllTreatmentRequestsResponse {
180
+ repeated TreatmentRequest requests = 1;
181
+ optional string next_cursor = 2;
182
+ }
183
+
168
184
  message UpdateTreatmentRequestRequest {
169
185
  string user_id = 1;
170
186
  string id = 2;