@candesk/contracts 6.11.0 → 6.13.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.
@@ -1,3 +1,4 @@
1
1
  export * from './auth';
2
2
  export * from './kyc';
3
+ export * from './payment';
3
4
  export * from './queues';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth"), exports);
18
18
  __exportStar(require("./kyc"), exports);
19
+ __exportStar(require("./payment"), exports);
19
20
  __exportStar(require("./queues"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './payment.events';
2
+ export * from './payment-failed.interface';
3
+ export * from './payment-paid.interface';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./payment.events"), exports);
18
+ __exportStar(require("./payment-failed.interface"), exports);
19
+ __exportStar(require("./payment-paid.interface"), exports);
@@ -0,0 +1,6 @@
1
+ export type PaymentFailureReason = 'CANCELED' | 'EXPIRED' | 'FAILED';
2
+ export interface PaymentFailedEvent {
3
+ paymentId: string;
4
+ referenceId: string;
5
+ reason: PaymentFailureReason;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface PaymentPaidEvent {
2
+ paymentId: string;
3
+ referenceId: string;
4
+ paidAt: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export declare const PAYMENT_EVENTS: {
2
+ readonly PAYMENT_PAID: 'payment.paid';
3
+ readonly PAYMENT_FAILED: 'payment.failed';
4
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAYMENT_EVENTS = void 0;
4
+ exports.PAYMENT_EVENTS = {
5
+ PAYMENT_PAID: 'payment.paid',
6
+ PAYMENT_FAILED: 'payment.failed'
7
+ };
@@ -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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,66 @@
1
+ export declare const protobufPackage = "payment.v1";
2
+ export declare enum PaymentStatus {
3
+ PAYMENT_STATUS_UNSPECIFIED = 0,
4
+ PAYMENT_STATUS_OPEN = 1,
5
+ PAYMENT_STATUS_PENDING = 2,
6
+ PAYMENT_STATUS_PAID = 3,
7
+ PAYMENT_STATUS_CANCELED = 4,
8
+ PAYMENT_STATUS_EXPIRED = 5,
9
+ PAYMENT_STATUS_FAILED = 6,
10
+ UNRECOGNIZED = -1
11
+ }
12
+ export declare enum PaymentProvider {
13
+ PAYMENT_PROVIDER_UNSPECIFIED = 0,
14
+ PAYMENT_PROVIDER_MOLLIE = 1,
15
+ UNRECOGNIZED = -1
16
+ }
17
+ export interface PaymentAddress {
18
+ streetAndNumber: string;
19
+ postalCode: string;
20
+ city: string;
21
+ country: string;
22
+ }
23
+ export interface PaymentCustomer {
24
+ email?: string | undefined;
25
+ givenName: string;
26
+ familyName: string;
27
+ address?: PaymentAddress | undefined;
28
+ }
29
+ export interface Payment {
30
+ id: string;
31
+ status: PaymentStatus;
32
+ checkoutUrl?: string | undefined;
33
+ expiresAt?: string | undefined;
34
+ }
35
+ export interface CreatePaymentRequest {
36
+ referenceId: string;
37
+ userId: string;
38
+ amount: number;
39
+ currency: string;
40
+ description: string;
41
+ customer: PaymentCustomer | undefined;
42
+ language: string;
43
+ redirectUrl: string;
44
+ }
45
+ export interface CreatePaymentResponse {
46
+ payment: Payment | undefined;
47
+ }
48
+ export interface GetPaymentRequest {
49
+ id: string;
50
+ }
51
+ export interface GetPaymentResponse {
52
+ payment: Payment | undefined;
53
+ }
54
+ export interface HandleWebhookRequest {
55
+ provider: PaymentProvider;
56
+ payload: string;
57
+ signature?: string | undefined;
58
+ }
59
+ export interface HandleWebhookResponse {
60
+ ok: boolean;
61
+ }
62
+ export interface PaymentService {
63
+ createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse>;
64
+ getPayment(request: GetPaymentRequest): Promise<GetPaymentResponse>;
65
+ handleWebhook(request: HandleWebhookRequest): Promise<HandleWebhookResponse>;
66
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.15.3
5
+ // protoc v3.21.12
6
+ // source: payment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PaymentProvider = exports.PaymentStatus = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "payment.v1";
11
+ var PaymentStatus;
12
+ (function (PaymentStatus) {
13
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_UNSPECIFIED"] = 0] = "PAYMENT_STATUS_UNSPECIFIED";
14
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_OPEN"] = 1] = "PAYMENT_STATUS_OPEN";
15
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_PENDING"] = 2] = "PAYMENT_STATUS_PENDING";
16
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_PAID"] = 3] = "PAYMENT_STATUS_PAID";
17
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_CANCELED"] = 4] = "PAYMENT_STATUS_CANCELED";
18
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_EXPIRED"] = 5] = "PAYMENT_STATUS_EXPIRED";
19
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_FAILED"] = 6] = "PAYMENT_STATUS_FAILED";
20
+ PaymentStatus[PaymentStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
21
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
22
+ var PaymentProvider;
23
+ (function (PaymentProvider) {
24
+ PaymentProvider[PaymentProvider["PAYMENT_PROVIDER_UNSPECIFIED"] = 0] = "PAYMENT_PROVIDER_UNSPECIFIED";
25
+ PaymentProvider[PaymentProvider["PAYMENT_PROVIDER_MOLLIE"] = 1] = "PAYMENT_PROVIDER_MOLLIE";
26
+ PaymentProvider[PaymentProvider["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(PaymentProvider || (exports.PaymentProvider = PaymentProvider = {}));
@@ -41,6 +41,8 @@ export declare enum TreatmentType {
41
41
  export declare enum TreatmentRequestStatus {
42
42
  TREATMENT_REQUEST_STATUS_UNSPECIFIED = 0,
43
43
  TREATMENT_REQUEST_STATUS_UNPAID = 1,
44
+ TREATMENT_REQUEST_STATUS_PAYMENT_PENDING = 2,
45
+ TREATMENT_REQUEST_STATUS_PAID = 3,
44
46
  UNRECOGNIZED = -1
45
47
  }
46
48
  export interface QuestionnaireAnswers {
@@ -86,6 +88,8 @@ export interface TreatmentRequest {
86
88
  currency: string;
87
89
  expiresAt?: string | undefined;
88
90
  createdAt: string;
91
+ medicationWish: string;
92
+ paidAt?: string | undefined;
89
93
  }
90
94
  export interface GetQuestionnaireRequest {
91
95
  userId: string;
@@ -130,6 +134,28 @@ export interface ListTreatmentRequestsResponse {
130
134
  pageSize: number;
131
135
  total: number;
132
136
  }
137
+ export interface UpdateTreatmentRequestRequest {
138
+ userId: string;
139
+ id: string;
140
+ medicationWish: string;
141
+ }
142
+ export interface UpdateTreatmentRequestResponse {
143
+ request: TreatmentRequest | undefined;
144
+ }
145
+ export interface DeleteTreatmentRequestRequest {
146
+ userId: string;
147
+ id: string;
148
+ }
149
+ export interface DeleteTreatmentRequestResponse {
150
+ }
151
+ export interface StartPaymentRequest {
152
+ userId: string;
153
+ id: string;
154
+ language: string;
155
+ }
156
+ export interface StartPaymentResponse {
157
+ checkoutUrl: string;
158
+ }
133
159
  export interface TreatmentService {
134
160
  getQuestionnaire(request: GetQuestionnaireRequest): Promise<GetQuestionnaireResponse>;
135
161
  saveQuestionnaire(request: SaveQuestionnaireRequest): Promise<SaveQuestionnaireResponse>;
@@ -137,4 +163,7 @@ export interface TreatmentService {
137
163
  createTreatmentRequest(request: CreateTreatmentRequestRequest): Promise<CreateTreatmentRequestResponse>;
138
164
  getTreatmentRequest(request: GetTreatmentRequestRequest): Promise<GetTreatmentRequestResponse>;
139
165
  listTreatmentRequests(request: ListTreatmentRequestsRequest): Promise<ListTreatmentRequestsResponse>;
166
+ updateTreatmentRequest(request: UpdateTreatmentRequestRequest): Promise<UpdateTreatmentRequestResponse>;
167
+ deleteTreatmentRequest(request: DeleteTreatmentRequestRequest): Promise<DeleteTreatmentRequestResponse>;
168
+ startPayment(request: StartPaymentRequest): Promise<StartPaymentResponse>;
140
169
  }
@@ -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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -56,5 +56,7 @@ var TreatmentRequestStatus;
56
56
  (function (TreatmentRequestStatus) {
57
57
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNSPECIFIED"] = 0] = "TREATMENT_REQUEST_STATUS_UNSPECIFIED";
58
58
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNPAID"] = 1] = "TREATMENT_REQUEST_STATUS_UNPAID";
59
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_PAYMENT_PENDING"] = 2] = "TREATMENT_REQUEST_STATUS_PAYMENT_PENDING";
60
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_PAID"] = 3] = "TREATMENT_REQUEST_STATUS_PAID";
59
61
  TreatmentRequestStatus[TreatmentRequestStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
60
62
  })(TreatmentRequestStatus || (exports.TreatmentRequestStatus = TreatmentRequestStatus = {}));
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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,75 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "payment.v1";
3
+ export declare enum PaymentStatus {
4
+ PAYMENT_STATUS_UNSPECIFIED = 0,
5
+ PAYMENT_STATUS_OPEN = 1,
6
+ PAYMENT_STATUS_PENDING = 2,
7
+ PAYMENT_STATUS_PAID = 3,
8
+ PAYMENT_STATUS_CANCELED = 4,
9
+ PAYMENT_STATUS_EXPIRED = 5,
10
+ PAYMENT_STATUS_FAILED = 6,
11
+ UNRECOGNIZED = -1
12
+ }
13
+ export declare enum PaymentProvider {
14
+ PAYMENT_PROVIDER_UNSPECIFIED = 0,
15
+ PAYMENT_PROVIDER_MOLLIE = 1,
16
+ UNRECOGNIZED = -1
17
+ }
18
+ export interface PaymentAddress {
19
+ streetAndNumber: string;
20
+ postalCode: string;
21
+ city: string;
22
+ country: string;
23
+ }
24
+ export interface PaymentCustomer {
25
+ email?: string | undefined;
26
+ givenName: string;
27
+ familyName: string;
28
+ address?: PaymentAddress | undefined;
29
+ }
30
+ export interface Payment {
31
+ id: string;
32
+ status: PaymentStatus;
33
+ checkoutUrl?: string | undefined;
34
+ expiresAt?: string | undefined;
35
+ }
36
+ export interface CreatePaymentRequest {
37
+ referenceId: string;
38
+ userId: string;
39
+ amount: number;
40
+ currency: string;
41
+ description: string;
42
+ customer: PaymentCustomer | undefined;
43
+ language: string;
44
+ redirectUrl: string;
45
+ }
46
+ export interface CreatePaymentResponse {
47
+ payment: Payment | undefined;
48
+ }
49
+ export interface GetPaymentRequest {
50
+ id: string;
51
+ }
52
+ export interface GetPaymentResponse {
53
+ payment: Payment | undefined;
54
+ }
55
+ export interface HandleWebhookRequest {
56
+ provider: PaymentProvider;
57
+ payload: string;
58
+ signature?: string | undefined;
59
+ }
60
+ export interface HandleWebhookResponse {
61
+ ok: boolean;
62
+ }
63
+ export declare const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
64
+ export interface PaymentServiceClient {
65
+ createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
66
+ getPayment(request: GetPaymentRequest): Observable<GetPaymentResponse>;
67
+ handleWebhook(request: HandleWebhookRequest): Observable<HandleWebhookResponse>;
68
+ }
69
+ export interface PaymentServiceController {
70
+ createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
71
+ getPayment(request: GetPaymentRequest): Promise<GetPaymentResponse> | Observable<GetPaymentResponse> | GetPaymentResponse;
72
+ handleWebhook(request: HandleWebhookRequest): Promise<HandleWebhookResponse> | Observable<HandleWebhookResponse> | HandleWebhookResponse;
73
+ }
74
+ export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
75
+ export declare const PAYMENT_SERVICE_NAME = "PaymentService";
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.15.3
5
+ // protoc v3.21.12
6
+ // source: payment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PAYMENT_SERVICE_NAME = exports.PAYMENT_V1_PACKAGE_NAME = exports.PaymentProvider = exports.PaymentStatus = exports.protobufPackage = void 0;
9
+ exports.PaymentServiceControllerMethods = PaymentServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "payment.v1";
13
+ var PaymentStatus;
14
+ (function (PaymentStatus) {
15
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_UNSPECIFIED"] = 0] = "PAYMENT_STATUS_UNSPECIFIED";
16
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_OPEN"] = 1] = "PAYMENT_STATUS_OPEN";
17
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_PENDING"] = 2] = "PAYMENT_STATUS_PENDING";
18
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_PAID"] = 3] = "PAYMENT_STATUS_PAID";
19
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_CANCELED"] = 4] = "PAYMENT_STATUS_CANCELED";
20
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_EXPIRED"] = 5] = "PAYMENT_STATUS_EXPIRED";
21
+ PaymentStatus[PaymentStatus["PAYMENT_STATUS_FAILED"] = 6] = "PAYMENT_STATUS_FAILED";
22
+ PaymentStatus[PaymentStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
23
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
24
+ var PaymentProvider;
25
+ (function (PaymentProvider) {
26
+ PaymentProvider[PaymentProvider["PAYMENT_PROVIDER_UNSPECIFIED"] = 0] = "PAYMENT_PROVIDER_UNSPECIFIED";
27
+ PaymentProvider[PaymentProvider["PAYMENT_PROVIDER_MOLLIE"] = 1] = "PAYMENT_PROVIDER_MOLLIE";
28
+ PaymentProvider[PaymentProvider["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
+ })(PaymentProvider || (exports.PaymentProvider = PaymentProvider = {}));
30
+ exports.PAYMENT_V1_PACKAGE_NAME = "payment.v1";
31
+ function PaymentServiceControllerMethods() {
32
+ return function (constructor) {
33
+ const grpcMethods = ["createPayment", "getPayment", "handleWebhook"];
34
+ for (const method of grpcMethods) {
35
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
36
+ (0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
37
+ Object.defineProperty(constructor.prototype, method, descriptor);
38
+ }
39
+ const grpcStreamMethods = [];
40
+ for (const method of grpcStreamMethods) {
41
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
42
+ (0, microservices_1.GrpcStreamMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
43
+ Object.defineProperty(constructor.prototype, method, descriptor);
44
+ }
45
+ };
46
+ }
47
+ exports.PAYMENT_SERVICE_NAME = "PaymentService";
@@ -42,6 +42,8 @@ export declare enum TreatmentType {
42
42
  export declare enum TreatmentRequestStatus {
43
43
  TREATMENT_REQUEST_STATUS_UNSPECIFIED = 0,
44
44
  TREATMENT_REQUEST_STATUS_UNPAID = 1,
45
+ TREATMENT_REQUEST_STATUS_PAYMENT_PENDING = 2,
46
+ TREATMENT_REQUEST_STATUS_PAID = 3,
45
47
  UNRECOGNIZED = -1
46
48
  }
47
49
  export interface QuestionnaireAnswers {
@@ -87,6 +89,8 @@ export interface TreatmentRequest {
87
89
  currency: string;
88
90
  expiresAt?: string | undefined;
89
91
  createdAt: string;
92
+ medicationWish: string;
93
+ paidAt?: string | undefined;
90
94
  }
91
95
  export interface GetQuestionnaireRequest {
92
96
  userId: string;
@@ -131,6 +135,28 @@ export interface ListTreatmentRequestsResponse {
131
135
  pageSize: number;
132
136
  total: number;
133
137
  }
138
+ export interface UpdateTreatmentRequestRequest {
139
+ userId: string;
140
+ id: string;
141
+ medicationWish: string;
142
+ }
143
+ export interface UpdateTreatmentRequestResponse {
144
+ request: TreatmentRequest | undefined;
145
+ }
146
+ export interface DeleteTreatmentRequestRequest {
147
+ userId: string;
148
+ id: string;
149
+ }
150
+ export interface DeleteTreatmentRequestResponse {
151
+ }
152
+ export interface StartPaymentRequest {
153
+ userId: string;
154
+ id: string;
155
+ language: string;
156
+ }
157
+ export interface StartPaymentResponse {
158
+ checkoutUrl: string;
159
+ }
134
160
  export declare const TREATMENT_V1_PACKAGE_NAME = "treatment.v1";
135
161
  export interface TreatmentServiceClient {
136
162
  getQuestionnaire(request: GetQuestionnaireRequest): Observable<GetQuestionnaireResponse>;
@@ -139,6 +165,9 @@ export interface TreatmentServiceClient {
139
165
  createTreatmentRequest(request: CreateTreatmentRequestRequest): Observable<CreateTreatmentRequestResponse>;
140
166
  getTreatmentRequest(request: GetTreatmentRequestRequest): Observable<GetTreatmentRequestResponse>;
141
167
  listTreatmentRequests(request: ListTreatmentRequestsRequest): Observable<ListTreatmentRequestsResponse>;
168
+ updateTreatmentRequest(request: UpdateTreatmentRequestRequest): Observable<UpdateTreatmentRequestResponse>;
169
+ deleteTreatmentRequest(request: DeleteTreatmentRequestRequest): Observable<DeleteTreatmentRequestResponse>;
170
+ startPayment(request: StartPaymentRequest): Observable<StartPaymentResponse>;
142
171
  }
143
172
  export interface TreatmentServiceController {
144
173
  getQuestionnaire(request: GetQuestionnaireRequest): Promise<GetQuestionnaireResponse> | Observable<GetQuestionnaireResponse> | GetQuestionnaireResponse;
@@ -147,6 +176,9 @@ export interface TreatmentServiceController {
147
176
  createTreatmentRequest(request: CreateTreatmentRequestRequest): Promise<CreateTreatmentRequestResponse> | Observable<CreateTreatmentRequestResponse> | CreateTreatmentRequestResponse;
148
177
  getTreatmentRequest(request: GetTreatmentRequestRequest): Promise<GetTreatmentRequestResponse> | Observable<GetTreatmentRequestResponse> | GetTreatmentRequestResponse;
149
178
  listTreatmentRequests(request: ListTreatmentRequestsRequest): Promise<ListTreatmentRequestsResponse> | Observable<ListTreatmentRequestsResponse> | ListTreatmentRequestsResponse;
179
+ updateTreatmentRequest(request: UpdateTreatmentRequestRequest): Promise<UpdateTreatmentRequestResponse> | Observable<UpdateTreatmentRequestResponse> | UpdateTreatmentRequestResponse;
180
+ deleteTreatmentRequest(request: DeleteTreatmentRequestRequest): Promise<DeleteTreatmentRequestResponse> | Observable<DeleteTreatmentRequestResponse> | DeleteTreatmentRequestResponse;
181
+ startPayment(request: StartPaymentRequest): Promise<StartPaymentResponse> | Observable<StartPaymentResponse> | StartPaymentResponse;
150
182
  }
151
183
  export declare function TreatmentServiceControllerMethods(): (constructor: Function) => void;
152
184
  export declare const TREATMENT_SERVICE_NAME = "TreatmentService";
@@ -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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -58,6 +58,8 @@ var TreatmentRequestStatus;
58
58
  (function (TreatmentRequestStatus) {
59
59
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNSPECIFIED"] = 0] = "TREATMENT_REQUEST_STATUS_UNSPECIFIED";
60
60
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_UNPAID"] = 1] = "TREATMENT_REQUEST_STATUS_UNPAID";
61
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_PAYMENT_PENDING"] = 2] = "TREATMENT_REQUEST_STATUS_PAYMENT_PENDING";
62
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_PAID"] = 3] = "TREATMENT_REQUEST_STATUS_PAID";
61
63
  TreatmentRequestStatus[TreatmentRequestStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
62
64
  })(TreatmentRequestStatus || (exports.TreatmentRequestStatus = TreatmentRequestStatus = {}));
63
65
  exports.TREATMENT_V1_PACKAGE_NAME = "treatment.v1";
@@ -70,6 +72,9 @@ function TreatmentServiceControllerMethods() {
70
72
  "createTreatmentRequest",
71
73
  "getTreatmentRequest",
72
74
  "listTreatmentRequests",
75
+ "updateTreatmentRequest",
76
+ "deleteTreatmentRequest",
77
+ "startPayment",
73
78
  ];
74
79
  for (const method of grpcMethods) {
75
80
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
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.15.0
4
+ // protoc-gen-ts_proto v2.15.3
5
5
  // protoc v3.21.12
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,4 +5,5 @@ export declare const PROTO_PATHS: {
5
5
  readonly MEDIA: string;
6
6
  readonly KYC: string;
7
7
  readonly TREATMENT: string;
8
+ readonly PAYMENT: string;
8
9
  };
@@ -8,5 +8,6 @@ exports.PROTO_PATHS = {
8
8
  USER: (0, path_1.join)(__dirname, '../../proto/user.proto'),
9
9
  MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
10
  KYC: (0, path_1.join)(__dirname, '../../proto/kyc.proto'),
11
- TREATMENT: (0, path_1.join)(__dirname, '../../proto/treatment.proto')
11
+ TREATMENT: (0, path_1.join)(__dirname, '../../proto/treatment.proto'),
12
+ PAYMENT: (0, path_1.join)(__dirname, '../../proto/payment.proto')
12
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.11.0",
3
+ "version": "6.13.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -0,0 +1,78 @@
1
+ syntax = "proto3";
2
+
3
+ package payment.v1;
4
+
5
+ service PaymentService {
6
+ rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
7
+ rpc GetPayment (GetPaymentRequest) returns (GetPaymentResponse);
8
+ rpc HandleWebhook (HandleWebhookRequest) returns (HandleWebhookResponse);
9
+ }
10
+
11
+ enum PaymentStatus {
12
+ PAYMENT_STATUS_UNSPECIFIED = 0;
13
+ PAYMENT_STATUS_OPEN = 1;
14
+ PAYMENT_STATUS_PENDING = 2;
15
+ PAYMENT_STATUS_PAID = 3;
16
+ PAYMENT_STATUS_CANCELED = 4;
17
+ PAYMENT_STATUS_EXPIRED = 5;
18
+ PAYMENT_STATUS_FAILED = 6;
19
+ }
20
+
21
+ enum PaymentProvider {
22
+ PAYMENT_PROVIDER_UNSPECIFIED = 0;
23
+ PAYMENT_PROVIDER_MOLLIE = 1;
24
+ }
25
+
26
+ message PaymentAddress {
27
+ string street_and_number = 1;
28
+ string postal_code = 2;
29
+ string city = 3;
30
+ string country = 4;
31
+ }
32
+
33
+ message PaymentCustomer {
34
+ optional string email = 1;
35
+ string given_name = 2;
36
+ string family_name = 3;
37
+ optional PaymentAddress address = 4;
38
+ }
39
+
40
+ message Payment {
41
+ string id = 1;
42
+ PaymentStatus status = 2;
43
+ optional string checkout_url = 3;
44
+ optional string expires_at = 4;
45
+ }
46
+
47
+ message CreatePaymentRequest {
48
+ string reference_id = 1;
49
+ string user_id = 2;
50
+ int32 amount = 3;
51
+ string currency = 4;
52
+ string description = 5;
53
+ PaymentCustomer customer = 6;
54
+ string language = 7;
55
+ string redirect_url = 8;
56
+ }
57
+
58
+ message CreatePaymentResponse {
59
+ Payment payment = 1;
60
+ }
61
+
62
+ message GetPaymentRequest {
63
+ string id = 1;
64
+ }
65
+
66
+ message GetPaymentResponse {
67
+ Payment payment = 1;
68
+ }
69
+
70
+ message HandleWebhookRequest {
71
+ PaymentProvider provider = 1;
72
+ string payload = 2;
73
+ optional string signature = 3;
74
+ }
75
+
76
+ message HandleWebhookResponse {
77
+ bool ok = 1;
78
+ }
@@ -9,6 +9,9 @@ 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 UpdateTreatmentRequest (UpdateTreatmentRequestRequest) returns (UpdateTreatmentRequestResponse);
13
+ rpc DeleteTreatmentRequest (DeleteTreatmentRequestRequest) returns (DeleteTreatmentRequestResponse);
14
+ rpc StartPayment (StartPaymentRequest) returns (StartPaymentResponse);
12
15
  }
13
16
 
14
17
  enum QuestionnaireStatus {
@@ -53,6 +56,8 @@ enum TreatmentType {
53
56
  enum TreatmentRequestStatus {
54
57
  TREATMENT_REQUEST_STATUS_UNSPECIFIED = 0;
55
58
  TREATMENT_REQUEST_STATUS_UNPAID = 1;
59
+ TREATMENT_REQUEST_STATUS_PAYMENT_PENDING = 2;
60
+ TREATMENT_REQUEST_STATUS_PAID = 3;
56
61
  }
57
62
 
58
63
  message QuestionnaireAnswers {
@@ -101,6 +106,8 @@ message TreatmentRequest {
101
106
  string currency = 6;
102
107
  optional string expires_at = 7;
103
108
  string created_at = 8;
109
+ string medication_wish = 9;
110
+ optional string paid_at = 10;
104
111
  }
105
112
 
106
113
  message GetQuestionnaireRequest {
@@ -156,3 +163,30 @@ message ListTreatmentRequestsResponse {
156
163
  int32 page_size = 3;
157
164
  int32 total = 4;
158
165
  }
166
+
167
+ message UpdateTreatmentRequestRequest {
168
+ string user_id = 1;
169
+ string id = 2;
170
+ string medication_wish = 3;
171
+ }
172
+
173
+ message UpdateTreatmentRequestResponse {
174
+ TreatmentRequest request = 1;
175
+ }
176
+
177
+ message DeleteTreatmentRequestRequest {
178
+ string user_id = 1;
179
+ string id = 2;
180
+ }
181
+
182
+ message DeleteTreatmentRequestResponse {}
183
+
184
+ message StartPaymentRequest {
185
+ string user_id = 1;
186
+ string id = 2;
187
+ string language = 3;
188
+ }
189
+
190
+ message StartPaymentResponse {
191
+ string checkout_url = 1;
192
+ }