@postpaybr/protos 1.1.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.
- package/package.json +28 -0
- package/src/account-entry.proto +86 -0
- package/src/address.proto +64 -0
- package/src/admin-card-verification.proto +90 -0
- package/src/administrator.proto +192 -0
- package/src/anticipation.proto +86 -0
- package/src/asset.proto +44 -0
- package/src/auth.proto +29 -0
- package/src/bank-account.proto +62 -0
- package/src/card-vault.proto +36 -0
- package/src/card-verification.proto +30 -0
- package/src/card.proto +138 -0
- package/src/charge-schedule.proto +22 -0
- package/src/charge.proto +610 -0
- package/src/context.proto +174 -0
- package/src/customer.proto +234 -0
- package/src/daily-balance.proto +32 -0
- package/src/document-verification.proto +111 -0
- package/src/email.proto +76 -0
- package/src/expo-push.proto +27 -0
- package/src/fee.proto +65 -0
- package/src/location.proto +40 -0
- package/src/notification.proto +207 -0
- package/src/order.proto +189 -0
- package/src/payable.proto +246 -0
- package/src/payer.proto +24 -0
- package/src/payment-calculator.proto +165 -0
- package/src/payment-card.proto +217 -0
- package/src/payment-gateway.proto +94 -0
- package/src/payment-pix.proto +115 -0
- package/src/receipt.proto +212 -0
- package/src/recipient-payment-gateway.proto +101 -0
- package/src/recipient.proto +237 -0
- package/src/role.proto +57 -0
- package/src/sms.proto +36 -0
- package/src/tax.proto +323 -0
- package/src/transfer.proto +206 -0
- package/src/two-factor.proto +67 -0
- package/src/typescript/account-entry.ts +177 -0
- package/src/typescript/address.ts +133 -0
- package/src/typescript/admin-card-verification.ts +181 -0
- package/src/typescript/administrator.ts +375 -0
- package/src/typescript/anticipation.ts +187 -0
- package/src/typescript/asset.ts +123 -0
- package/src/typescript/auth.ts +84 -0
- package/src/typescript/bank-account.ts +157 -0
- package/src/typescript/card-vault.ts +92 -0
- package/src/typescript/card-verification.ts +93 -0
- package/src/typescript/card.ts +283 -0
- package/src/typescript/charge-schedule.ts +86 -0
- package/src/typescript/charge.ts +930 -0
- package/src/typescript/context.ts +296 -0
- package/src/typescript/customer.ts +425 -0
- package/src/typescript/daily-balance.ts +94 -0
- package/src/typescript/document-verification.ts +219 -0
- package/src/typescript/email.ts +183 -0
- package/src/typescript/expo-push.ts +75 -0
- package/src/typescript/fee.ts +131 -0
- package/src/typescript/location.ts +96 -0
- package/src/typescript/notification.ts +372 -0
- package/src/typescript/order.ts +311 -0
- package/src/typescript/payable.ts +414 -0
- package/src/typescript/payer.ts +68 -0
- package/src/typescript/payment-calculator.ts +252 -0
- package/src/typescript/payment-card.ts +290 -0
- package/src/typescript/payment-gateway.ts +209 -0
- package/src/typescript/payment-pix.ts +170 -0
- package/src/typescript/receipt.ts +344 -0
- package/src/typescript/recipient-payment-gateway.ts +209 -0
- package/src/typescript/recipient.ts +413 -0
- package/src/typescript/role.ts +144 -0
- package/src/typescript/sms.ts +96 -0
- package/src/typescript/tax.ts +463 -0
- package/src/typescript/transfer.ts +260 -0
- package/src/typescript/two-factor.ts +177 -0
- package/src/typescript/user.ts +413 -0
- package/src/typescript/wallet.ts +63 -0
- package/src/user.proto +214 -0
- package/src/wallet.proto +18 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.7.7
|
|
4
|
+
// protoc v6.33.1
|
|
5
|
+
// source: context.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import {
|
|
9
|
+
brandType,
|
|
10
|
+
GatewayIdentification,
|
|
11
|
+
Meta,
|
|
12
|
+
MetaType,
|
|
13
|
+
OrderType,
|
|
14
|
+
PaymentMethods,
|
|
15
|
+
PaymentScheduleType,
|
|
16
|
+
TaxStatus,
|
|
17
|
+
TaxTypes,
|
|
18
|
+
} from '@postpaybr/contracts/types';
|
|
19
|
+
import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
|
|
20
|
+
import { Observable } from 'rxjs';
|
|
21
|
+
|
|
22
|
+
export const protobufPackage = 'context';
|
|
23
|
+
|
|
24
|
+
export interface LocationDetails {
|
|
25
|
+
document: string;
|
|
26
|
+
state: number;
|
|
27
|
+
city: number;
|
|
28
|
+
year: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Tax {
|
|
32
|
+
id: string;
|
|
33
|
+
type: TaxTypes;
|
|
34
|
+
status: TaxStatus;
|
|
35
|
+
description: string;
|
|
36
|
+
amount: number;
|
|
37
|
+
year: number;
|
|
38
|
+
dueAt: string;
|
|
39
|
+
documentId: string;
|
|
40
|
+
code: string;
|
|
41
|
+
isSingleQuota: boolean;
|
|
42
|
+
quota?: number | undefined;
|
|
43
|
+
fee: number;
|
|
44
|
+
fine: number;
|
|
45
|
+
discountAmount: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface Payer {
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
name: string;
|
|
51
|
+
document: string;
|
|
52
|
+
phone?: string | undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MetaAddress {
|
|
56
|
+
street: string;
|
|
57
|
+
complement: string;
|
|
58
|
+
city: string;
|
|
59
|
+
neighborhood: string;
|
|
60
|
+
number: string;
|
|
61
|
+
state: string;
|
|
62
|
+
zipCode: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface TaxLocation {
|
|
66
|
+
state: number;
|
|
67
|
+
city: number;
|
|
68
|
+
recipientId: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface TaxDetail {
|
|
72
|
+
tax: Tax | undefined;
|
|
73
|
+
payer: Payer | undefined;
|
|
74
|
+
location: TaxLocation | undefined;
|
|
75
|
+
metaType: MetaType;
|
|
76
|
+
meta: Meta | undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface PaymentDetails {
|
|
80
|
+
method: PaymentMethods;
|
|
81
|
+
amount: number;
|
|
82
|
+
discountPercentage?: number | undefined;
|
|
83
|
+
fee: number;
|
|
84
|
+
discountAmount?: number | undefined;
|
|
85
|
+
gatewayId?: GatewayIdentification | undefined;
|
|
86
|
+
card?: Card | undefined;
|
|
87
|
+
paymentSchedule: PaymentSchedule | undefined;
|
|
88
|
+
baseFee: number;
|
|
89
|
+
feePercentage: number;
|
|
90
|
+
chargeId?: string | undefined;
|
|
91
|
+
isRetry?: boolean | undefined;
|
|
92
|
+
orderId?: string | undefined;
|
|
93
|
+
keepData?: boolean | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface PaymentSchedule {
|
|
97
|
+
type: PaymentScheduleType;
|
|
98
|
+
date?: string | undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface Card {
|
|
102
|
+
id: string;
|
|
103
|
+
shadowNumber: string;
|
|
104
|
+
brand: brandType | undefined;
|
|
105
|
+
installments?: number | undefined;
|
|
106
|
+
installmentValue?: number | undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface Context {
|
|
110
|
+
taxes?: TaxDetail[];
|
|
111
|
+
location?: LocationDetails | undefined;
|
|
112
|
+
paymentDetails?: PaymentDetails | undefined;
|
|
113
|
+
pushToken?: string | undefined;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface GetContextRequest {
|
|
117
|
+
customerId: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface GetContextResponse {
|
|
121
|
+
context: Context | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface ClearContextRequest {
|
|
125
|
+
customerId: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface ClearContextResponse {
|
|
129
|
+
success: boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface PostLocationRequest {
|
|
133
|
+
customerId: string;
|
|
134
|
+
location: LocationDetails | undefined;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface PostTaxesRequest {
|
|
138
|
+
customerId: string;
|
|
139
|
+
taxes: TaxDetail[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface PostPaymentDetailRequest {
|
|
143
|
+
customerId: string;
|
|
144
|
+
paymentDetails: PaymentDetails | undefined;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface PostPushTokenRequest {
|
|
148
|
+
customerId: string;
|
|
149
|
+
pushToken: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface CheckoutRequest {
|
|
153
|
+
customerId: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface Order {
|
|
157
|
+
id: string;
|
|
158
|
+
totalAmount: number;
|
|
159
|
+
status: string;
|
|
160
|
+
createdAt: Date;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface CheckoutResponse {
|
|
164
|
+
order: Order | undefined;
|
|
165
|
+
orderType: OrderType;
|
|
166
|
+
chargeId?: string | undefined;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface PostPaymentDateRequest {
|
|
170
|
+
customerId: string;
|
|
171
|
+
paymentSchedule: PaymentSchedule | undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export const CONTEXT_PACKAGE_NAME = 'context';
|
|
175
|
+
|
|
176
|
+
export interface ContextServiceClient {
|
|
177
|
+
getContext(request: GetContextRequest): Observable<GetContextResponse>;
|
|
178
|
+
|
|
179
|
+
clearContext(request: ClearContextRequest): Observable<ClearContextResponse>;
|
|
180
|
+
|
|
181
|
+
postLocation(request: PostLocationRequest): Observable<ClearContextResponse>;
|
|
182
|
+
|
|
183
|
+
postTaxes(request: PostTaxesRequest): Observable<ClearContextResponse>;
|
|
184
|
+
|
|
185
|
+
postPaymentDetail(
|
|
186
|
+
request: PostPaymentDetailRequest,
|
|
187
|
+
): Observable<ClearContextResponse>;
|
|
188
|
+
|
|
189
|
+
postPushToken(
|
|
190
|
+
request: PostPushTokenRequest,
|
|
191
|
+
): Observable<ClearContextResponse>;
|
|
192
|
+
|
|
193
|
+
checkout(request: CheckoutRequest): Observable<CheckoutResponse>;
|
|
194
|
+
|
|
195
|
+
postPaymentDate(
|
|
196
|
+
request: PostPaymentDateRequest,
|
|
197
|
+
): Observable<ClearContextResponse>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface ContextServiceController {
|
|
201
|
+
getContext(
|
|
202
|
+
request: GetContextRequest,
|
|
203
|
+
):
|
|
204
|
+
| Promise<GetContextResponse>
|
|
205
|
+
| Observable<GetContextResponse>
|
|
206
|
+
| GetContextResponse;
|
|
207
|
+
|
|
208
|
+
clearContext(
|
|
209
|
+
request: ClearContextRequest,
|
|
210
|
+
):
|
|
211
|
+
| Promise<ClearContextResponse>
|
|
212
|
+
| Observable<ClearContextResponse>
|
|
213
|
+
| ClearContextResponse;
|
|
214
|
+
|
|
215
|
+
postLocation(
|
|
216
|
+
request: PostLocationRequest,
|
|
217
|
+
):
|
|
218
|
+
| Promise<ClearContextResponse>
|
|
219
|
+
| Observable<ClearContextResponse>
|
|
220
|
+
| ClearContextResponse;
|
|
221
|
+
|
|
222
|
+
postTaxes(
|
|
223
|
+
request: PostTaxesRequest,
|
|
224
|
+
):
|
|
225
|
+
| Promise<ClearContextResponse>
|
|
226
|
+
| Observable<ClearContextResponse>
|
|
227
|
+
| ClearContextResponse;
|
|
228
|
+
|
|
229
|
+
postPaymentDetail(
|
|
230
|
+
request: PostPaymentDetailRequest,
|
|
231
|
+
):
|
|
232
|
+
| Promise<ClearContextResponse>
|
|
233
|
+
| Observable<ClearContextResponse>
|
|
234
|
+
| ClearContextResponse;
|
|
235
|
+
|
|
236
|
+
postPushToken(
|
|
237
|
+
request: PostPushTokenRequest,
|
|
238
|
+
):
|
|
239
|
+
| Promise<ClearContextResponse>
|
|
240
|
+
| Observable<ClearContextResponse>
|
|
241
|
+
| ClearContextResponse;
|
|
242
|
+
|
|
243
|
+
checkout(
|
|
244
|
+
request: CheckoutRequest,
|
|
245
|
+
):
|
|
246
|
+
| Promise<CheckoutResponse>
|
|
247
|
+
| Observable<CheckoutResponse>
|
|
248
|
+
| CheckoutResponse;
|
|
249
|
+
|
|
250
|
+
postPaymentDate(
|
|
251
|
+
request: PostPaymentDateRequest,
|
|
252
|
+
):
|
|
253
|
+
| Promise<ClearContextResponse>
|
|
254
|
+
| Observable<ClearContextResponse>
|
|
255
|
+
| ClearContextResponse;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function ContextServiceControllerMethods() {
|
|
259
|
+
return function (constructor: Function) {
|
|
260
|
+
const grpcMethods: string[] = [
|
|
261
|
+
'getContext',
|
|
262
|
+
'clearContext',
|
|
263
|
+
'postLocation',
|
|
264
|
+
'postTaxes',
|
|
265
|
+
'postPaymentDetail',
|
|
266
|
+
'postPushToken',
|
|
267
|
+
'checkout',
|
|
268
|
+
'postPaymentDate',
|
|
269
|
+
];
|
|
270
|
+
for (const method of grpcMethods) {
|
|
271
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
272
|
+
constructor.prototype,
|
|
273
|
+
method,
|
|
274
|
+
);
|
|
275
|
+
GrpcMethod('ContextService', method)(
|
|
276
|
+
constructor.prototype[method],
|
|
277
|
+
method,
|
|
278
|
+
descriptor,
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
const grpcStreamMethods: string[] = [];
|
|
282
|
+
for (const method of grpcStreamMethods) {
|
|
283
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
284
|
+
constructor.prototype,
|
|
285
|
+
method,
|
|
286
|
+
);
|
|
287
|
+
GrpcStreamMethod('ContextService', method)(
|
|
288
|
+
constructor.prototype[method],
|
|
289
|
+
method,
|
|
290
|
+
descriptor,
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export const CONTEXT_SERVICE_NAME = 'ContextService';
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.7.0
|
|
4
|
+
// protoc v3.20.3
|
|
5
|
+
// source: customer.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = 'customer';
|
|
12
|
+
|
|
13
|
+
export interface CreateCustomerRequest {
|
|
14
|
+
customer: CustomerSignUp | undefined;
|
|
15
|
+
user: UserSignUp | undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CreateCustomerResponse {
|
|
19
|
+
success: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CheckCustomerExistsRequest {
|
|
23
|
+
document?: string | undefined;
|
|
24
|
+
email?: string | undefined;
|
|
25
|
+
phone?: string | undefined;
|
|
26
|
+
throwError?: boolean | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CheckCustomerExistsResponse {
|
|
30
|
+
exists: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface GetCustomerByIdRequest {
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GetCustomerByIdResponse {
|
|
38
|
+
customer: Customer | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetCustomerByEmailRequest {
|
|
42
|
+
email: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetCustomerByEmailResponse {
|
|
46
|
+
customer: Customer | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GetVerifiedCustomerByDocumentRequest {
|
|
50
|
+
document: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface GetVerifiedCustomerByDocumentResponse {
|
|
54
|
+
customer: Customer | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface GetProfileRequest {
|
|
58
|
+
customerId: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface GetProfileResponse {
|
|
62
|
+
id: string;
|
|
63
|
+
firstName: string;
|
|
64
|
+
email: string;
|
|
65
|
+
phone: string;
|
|
66
|
+
document: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface UpdateCustomerRequest {
|
|
70
|
+
customerId: string;
|
|
71
|
+
phone?: string | undefined;
|
|
72
|
+
firstName?: string | undefined;
|
|
73
|
+
email?: string | undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface UpdateCustomerResponse {
|
|
77
|
+
firstName: string;
|
|
78
|
+
phone: string;
|
|
79
|
+
email: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface updateIsEmailVerifiedStatusRequest {
|
|
83
|
+
customerId: string;
|
|
84
|
+
verified: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface updateIsEmailVerifiedStatusResponse {}
|
|
88
|
+
|
|
89
|
+
export interface ChangePinRequest {
|
|
90
|
+
customerId: string;
|
|
91
|
+
pin: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ChangePinResponse {
|
|
95
|
+
success: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface CheckIsValidPinRequest {
|
|
99
|
+
customerId: string;
|
|
100
|
+
pin: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface CheckIsValidPinResponse {
|
|
104
|
+
isValid: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface ValidateAndRefreshTokenRequest {
|
|
108
|
+
refreshToken: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ValidateAndRefreshTokenResponse {
|
|
112
|
+
accessToken: string;
|
|
113
|
+
refreshToken: string;
|
|
114
|
+
customer: ReducedCustomer | undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface ValidateAndSignInRequest {
|
|
118
|
+
document: string;
|
|
119
|
+
password: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface ValidateAndSignInResponse {
|
|
123
|
+
accessToken: string;
|
|
124
|
+
refreshToken: string;
|
|
125
|
+
customer: ReducedCustomer | undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface ReducedCustomer {
|
|
129
|
+
id: string;
|
|
130
|
+
firstName: string;
|
|
131
|
+
email: string;
|
|
132
|
+
lastName: string;
|
|
133
|
+
phone: string;
|
|
134
|
+
document: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface Customer {
|
|
138
|
+
id: string;
|
|
139
|
+
firstName: string;
|
|
140
|
+
lastName: string;
|
|
141
|
+
document: string;
|
|
142
|
+
email: string;
|
|
143
|
+
isEmailVerified: boolean;
|
|
144
|
+
phone: string;
|
|
145
|
+
pin: string;
|
|
146
|
+
pinAttempts: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface CustomerSignUp {
|
|
150
|
+
firstName: string;
|
|
151
|
+
lastName: string;
|
|
152
|
+
document: string;
|
|
153
|
+
email: string;
|
|
154
|
+
isEmailVerified: boolean;
|
|
155
|
+
phone: string;
|
|
156
|
+
pin: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface User {
|
|
160
|
+
id: string;
|
|
161
|
+
password: string;
|
|
162
|
+
role: Role | undefined;
|
|
163
|
+
devices: Device[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface UserSignUp {
|
|
167
|
+
password: string;
|
|
168
|
+
devices: Device[];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface Role {
|
|
172
|
+
id: string;
|
|
173
|
+
code: string;
|
|
174
|
+
description: string;
|
|
175
|
+
permissions: string[];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface Device {
|
|
179
|
+
token?: string | undefined;
|
|
180
|
+
expoPushToken: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface GetCustomersWithFiltersRequest {
|
|
184
|
+
pageIndex?: number | undefined;
|
|
185
|
+
pageSize?: number | undefined;
|
|
186
|
+
statuses?: string[];
|
|
187
|
+
globalFilter?: string | undefined;
|
|
188
|
+
startDate?: Date | undefined;
|
|
189
|
+
endDate?: Date | undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface GetCustomersWithFiltersResponse {
|
|
193
|
+
customers: CustomerWithStatus[];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface CustomerWithStatus {
|
|
197
|
+
id: string;
|
|
198
|
+
name: string;
|
|
199
|
+
document: string;
|
|
200
|
+
email: string;
|
|
201
|
+
phone: string;
|
|
202
|
+
userStatus: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface ImageData {
|
|
206
|
+
mimetype: string;
|
|
207
|
+
buffer: Uint8Array;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface InitiateDocumentVerificationRequest {
|
|
211
|
+
customerId: string;
|
|
212
|
+
documentFront: ImageData | undefined;
|
|
213
|
+
selfieWithDocument: ImageData | undefined;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface DocumentVerificationResponse {
|
|
217
|
+
id: string;
|
|
218
|
+
documentFrontUrl: string;
|
|
219
|
+
selfieWithDocumentUrl: string;
|
|
220
|
+
reviewDeadline?: Date;
|
|
221
|
+
rejectionReasons: string[];
|
|
222
|
+
customRejectionReason: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const CUSTOMER_PACKAGE_NAME = 'customer';
|
|
226
|
+
|
|
227
|
+
export interface CustomerServiceClient {
|
|
228
|
+
createCustomer(
|
|
229
|
+
request: CreateCustomerRequest,
|
|
230
|
+
): Observable<CreateCustomerResponse>;
|
|
231
|
+
|
|
232
|
+
checkCustomerExists(
|
|
233
|
+
request: CheckCustomerExistsRequest,
|
|
234
|
+
): Observable<CheckCustomerExistsResponse>;
|
|
235
|
+
|
|
236
|
+
getCustomerById(
|
|
237
|
+
request: GetCustomerByIdRequest,
|
|
238
|
+
): Observable<GetCustomerByIdResponse>;
|
|
239
|
+
|
|
240
|
+
getCustomerByEmail(
|
|
241
|
+
request: GetCustomerByEmailRequest,
|
|
242
|
+
): Observable<GetCustomerByEmailResponse>;
|
|
243
|
+
|
|
244
|
+
getVerifiedCustomerByDocument(
|
|
245
|
+
request: GetVerifiedCustomerByDocumentRequest,
|
|
246
|
+
): Observable<GetVerifiedCustomerByDocumentResponse>;
|
|
247
|
+
|
|
248
|
+
getProfile(request: GetProfileRequest): Observable<GetProfileResponse>;
|
|
249
|
+
|
|
250
|
+
updateCustomer(
|
|
251
|
+
request: UpdateCustomerRequest,
|
|
252
|
+
): Observable<UpdateCustomerResponse>;
|
|
253
|
+
|
|
254
|
+
updateIsEmailVerifiedStatus(
|
|
255
|
+
request: updateIsEmailVerifiedStatusRequest,
|
|
256
|
+
): Observable<updateIsEmailVerifiedStatusResponse>;
|
|
257
|
+
|
|
258
|
+
changePin(request: ChangePinRequest): Observable<ChangePinResponse>;
|
|
259
|
+
|
|
260
|
+
checkIsValidPin(
|
|
261
|
+
request: CheckIsValidPinRequest,
|
|
262
|
+
): Observable<CheckIsValidPinResponse>;
|
|
263
|
+
|
|
264
|
+
validateAndSignIn(
|
|
265
|
+
request: ValidateAndSignInRequest,
|
|
266
|
+
): Observable<ValidateAndSignInResponse>;
|
|
267
|
+
|
|
268
|
+
validateAndRefreshToken(
|
|
269
|
+
request: ValidateAndRefreshTokenRequest,
|
|
270
|
+
): Observable<ValidateAndRefreshTokenResponse>;
|
|
271
|
+
|
|
272
|
+
getCustomersWithFilters(
|
|
273
|
+
request: GetCustomersWithFiltersRequest,
|
|
274
|
+
): Observable<GetCustomersWithFiltersResponse>;
|
|
275
|
+
|
|
276
|
+
initiateDocumentVerification(
|
|
277
|
+
request: InitiateDocumentVerificationRequest,
|
|
278
|
+
): Observable<DocumentVerificationResponse>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface CustomerServiceController {
|
|
282
|
+
createCustomer(
|
|
283
|
+
request: CreateCustomerRequest,
|
|
284
|
+
):
|
|
285
|
+
| Promise<CreateCustomerResponse>
|
|
286
|
+
| Observable<CreateCustomerResponse>
|
|
287
|
+
| CreateCustomerResponse;
|
|
288
|
+
|
|
289
|
+
checkCustomerExists(
|
|
290
|
+
request: CheckCustomerExistsRequest,
|
|
291
|
+
):
|
|
292
|
+
| Promise<CheckCustomerExistsResponse>
|
|
293
|
+
| Observable<CheckCustomerExistsResponse>
|
|
294
|
+
| CheckCustomerExistsResponse;
|
|
295
|
+
|
|
296
|
+
getCustomerById(
|
|
297
|
+
request: GetCustomerByIdRequest,
|
|
298
|
+
):
|
|
299
|
+
| Promise<GetCustomerByIdResponse>
|
|
300
|
+
| Observable<GetCustomerByIdResponse>
|
|
301
|
+
| GetCustomerByIdResponse;
|
|
302
|
+
|
|
303
|
+
getCustomerByEmail(
|
|
304
|
+
request: GetCustomerByEmailRequest,
|
|
305
|
+
):
|
|
306
|
+
| Promise<GetCustomerByEmailResponse>
|
|
307
|
+
| Observable<GetCustomerByEmailResponse>
|
|
308
|
+
| GetCustomerByEmailResponse;
|
|
309
|
+
|
|
310
|
+
getVerifiedCustomerByDocument(
|
|
311
|
+
request: GetVerifiedCustomerByDocumentRequest,
|
|
312
|
+
):
|
|
313
|
+
| Promise<GetVerifiedCustomerByDocumentResponse>
|
|
314
|
+
| Observable<GetVerifiedCustomerByDocumentResponse>
|
|
315
|
+
| GetVerifiedCustomerByDocumentResponse;
|
|
316
|
+
|
|
317
|
+
getProfile(
|
|
318
|
+
request: GetProfileRequest,
|
|
319
|
+
):
|
|
320
|
+
| Promise<GetProfileResponse>
|
|
321
|
+
| Observable<GetProfileResponse>
|
|
322
|
+
| GetProfileResponse;
|
|
323
|
+
|
|
324
|
+
updateCustomer(
|
|
325
|
+
request: UpdateCustomerRequest,
|
|
326
|
+
):
|
|
327
|
+
| Promise<UpdateCustomerResponse>
|
|
328
|
+
| Observable<UpdateCustomerResponse>
|
|
329
|
+
| UpdateCustomerResponse;
|
|
330
|
+
|
|
331
|
+
updateIsEmailVerifiedStatus(
|
|
332
|
+
request: updateIsEmailVerifiedStatusRequest,
|
|
333
|
+
):
|
|
334
|
+
| Promise<updateIsEmailVerifiedStatusResponse>
|
|
335
|
+
| Observable<updateIsEmailVerifiedStatusResponse>
|
|
336
|
+
| updateIsEmailVerifiedStatusResponse;
|
|
337
|
+
|
|
338
|
+
changePin(
|
|
339
|
+
request: ChangePinRequest,
|
|
340
|
+
):
|
|
341
|
+
| Promise<ChangePinResponse>
|
|
342
|
+
| Observable<ChangePinResponse>
|
|
343
|
+
| ChangePinResponse;
|
|
344
|
+
|
|
345
|
+
checkIsValidPin(
|
|
346
|
+
request: CheckIsValidPinRequest,
|
|
347
|
+
):
|
|
348
|
+
| Promise<CheckIsValidPinResponse>
|
|
349
|
+
| Observable<CheckIsValidPinResponse>
|
|
350
|
+
| CheckIsValidPinResponse;
|
|
351
|
+
|
|
352
|
+
validateAndSignIn(
|
|
353
|
+
request: ValidateAndSignInRequest,
|
|
354
|
+
):
|
|
355
|
+
| Promise<ValidateAndSignInResponse>
|
|
356
|
+
| Observable<ValidateAndSignInResponse>
|
|
357
|
+
| ValidateAndSignInResponse;
|
|
358
|
+
|
|
359
|
+
validateAndRefreshToken(
|
|
360
|
+
request: ValidateAndRefreshTokenRequest,
|
|
361
|
+
):
|
|
362
|
+
| Promise<ValidateAndRefreshTokenResponse>
|
|
363
|
+
| Observable<ValidateAndRefreshTokenResponse>
|
|
364
|
+
| ValidateAndRefreshTokenResponse;
|
|
365
|
+
|
|
366
|
+
getCustomersWithFilters(
|
|
367
|
+
request: GetCustomersWithFiltersRequest,
|
|
368
|
+
):
|
|
369
|
+
| Promise<GetCustomersWithFiltersResponse>
|
|
370
|
+
| Observable<GetCustomersWithFiltersResponse>
|
|
371
|
+
| GetCustomersWithFiltersResponse;
|
|
372
|
+
|
|
373
|
+
initiateDocumentVerification(
|
|
374
|
+
request: InitiateDocumentVerificationRequest,
|
|
375
|
+
):
|
|
376
|
+
| Promise<DocumentVerificationResponse>
|
|
377
|
+
| Observable<DocumentVerificationResponse>
|
|
378
|
+
| DocumentVerificationResponse;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export function CustomerServiceControllerMethods() {
|
|
382
|
+
return function (constructor: Function) {
|
|
383
|
+
const grpcMethods: string[] = [
|
|
384
|
+
'createCustomer',
|
|
385
|
+
'checkCustomerExists',
|
|
386
|
+
'getCustomerById',
|
|
387
|
+
'getCustomerByEmail',
|
|
388
|
+
'getVerifiedCustomerByDocument',
|
|
389
|
+
'getProfile',
|
|
390
|
+
'updateCustomer',
|
|
391
|
+
'updateIsEmailVerifiedStatus',
|
|
392
|
+
'changePin',
|
|
393
|
+
'checkIsValidPin',
|
|
394
|
+
'validateAndSignIn',
|
|
395
|
+
'validateAndRefreshToken',
|
|
396
|
+
'getCustomersWithFilters',
|
|
397
|
+
'initiateDocumentVerification',
|
|
398
|
+
];
|
|
399
|
+
for (const method of grpcMethods) {
|
|
400
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
401
|
+
constructor.prototype,
|
|
402
|
+
method,
|
|
403
|
+
);
|
|
404
|
+
GrpcMethod('CustomerService', method)(
|
|
405
|
+
constructor.prototype[method],
|
|
406
|
+
method,
|
|
407
|
+
descriptor,
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
const grpcStreamMethods: string[] = [];
|
|
411
|
+
for (const method of grpcStreamMethods) {
|
|
412
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
413
|
+
constructor.prototype,
|
|
414
|
+
method,
|
|
415
|
+
);
|
|
416
|
+
GrpcStreamMethod('CustomerService', method)(
|
|
417
|
+
constructor.prototype[method],
|
|
418
|
+
method,
|
|
419
|
+
descriptor,
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export const CUSTOMER_SERVICE_NAME = 'CustomerService';
|