@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.
Files changed (79) hide show
  1. package/package.json +28 -0
  2. package/src/account-entry.proto +86 -0
  3. package/src/address.proto +64 -0
  4. package/src/admin-card-verification.proto +90 -0
  5. package/src/administrator.proto +192 -0
  6. package/src/anticipation.proto +86 -0
  7. package/src/asset.proto +44 -0
  8. package/src/auth.proto +29 -0
  9. package/src/bank-account.proto +62 -0
  10. package/src/card-vault.proto +36 -0
  11. package/src/card-verification.proto +30 -0
  12. package/src/card.proto +138 -0
  13. package/src/charge-schedule.proto +22 -0
  14. package/src/charge.proto +610 -0
  15. package/src/context.proto +174 -0
  16. package/src/customer.proto +234 -0
  17. package/src/daily-balance.proto +32 -0
  18. package/src/document-verification.proto +111 -0
  19. package/src/email.proto +76 -0
  20. package/src/expo-push.proto +27 -0
  21. package/src/fee.proto +65 -0
  22. package/src/location.proto +40 -0
  23. package/src/notification.proto +207 -0
  24. package/src/order.proto +189 -0
  25. package/src/payable.proto +246 -0
  26. package/src/payer.proto +24 -0
  27. package/src/payment-calculator.proto +165 -0
  28. package/src/payment-card.proto +217 -0
  29. package/src/payment-gateway.proto +94 -0
  30. package/src/payment-pix.proto +115 -0
  31. package/src/receipt.proto +212 -0
  32. package/src/recipient-payment-gateway.proto +101 -0
  33. package/src/recipient.proto +237 -0
  34. package/src/role.proto +57 -0
  35. package/src/sms.proto +36 -0
  36. package/src/tax.proto +323 -0
  37. package/src/transfer.proto +206 -0
  38. package/src/two-factor.proto +67 -0
  39. package/src/typescript/account-entry.ts +177 -0
  40. package/src/typescript/address.ts +133 -0
  41. package/src/typescript/admin-card-verification.ts +181 -0
  42. package/src/typescript/administrator.ts +375 -0
  43. package/src/typescript/anticipation.ts +187 -0
  44. package/src/typescript/asset.ts +123 -0
  45. package/src/typescript/auth.ts +84 -0
  46. package/src/typescript/bank-account.ts +157 -0
  47. package/src/typescript/card-vault.ts +92 -0
  48. package/src/typescript/card-verification.ts +93 -0
  49. package/src/typescript/card.ts +283 -0
  50. package/src/typescript/charge-schedule.ts +86 -0
  51. package/src/typescript/charge.ts +930 -0
  52. package/src/typescript/context.ts +296 -0
  53. package/src/typescript/customer.ts +425 -0
  54. package/src/typescript/daily-balance.ts +94 -0
  55. package/src/typescript/document-verification.ts +219 -0
  56. package/src/typescript/email.ts +183 -0
  57. package/src/typescript/expo-push.ts +75 -0
  58. package/src/typescript/fee.ts +131 -0
  59. package/src/typescript/location.ts +96 -0
  60. package/src/typescript/notification.ts +372 -0
  61. package/src/typescript/order.ts +311 -0
  62. package/src/typescript/payable.ts +414 -0
  63. package/src/typescript/payer.ts +68 -0
  64. package/src/typescript/payment-calculator.ts +252 -0
  65. package/src/typescript/payment-card.ts +290 -0
  66. package/src/typescript/payment-gateway.ts +209 -0
  67. package/src/typescript/payment-pix.ts +170 -0
  68. package/src/typescript/receipt.ts +344 -0
  69. package/src/typescript/recipient-payment-gateway.ts +209 -0
  70. package/src/typescript/recipient.ts +413 -0
  71. package/src/typescript/role.ts +144 -0
  72. package/src/typescript/sms.ts +96 -0
  73. package/src/typescript/tax.ts +463 -0
  74. package/src/typescript/transfer.ts +260 -0
  75. package/src/typescript/two-factor.ts +177 -0
  76. package/src/typescript/user.ts +413 -0
  77. package/src/typescript/wallet.ts +63 -0
  78. package/src/user.proto +214 -0
  79. package/src/wallet.proto +18 -0
@@ -0,0 +1,84 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.6.0
4
+ // protoc v3.20.3
5
+ // source: auth.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
9
+ import { Observable } from 'rxjs';
10
+
11
+ export const protobufPackage = 'auth';
12
+
13
+ export interface SignInRequest {
14
+ id: string;
15
+ }
16
+
17
+ export interface SignInResponse {
18
+ accessToken: string;
19
+ refreshToken: string;
20
+ }
21
+
22
+ export interface RefreshAccessTokenRequest {
23
+ refreshToken: string;
24
+ }
25
+
26
+ export interface RefreshAccessTokenResponse {
27
+ accessToken: string;
28
+ refreshToken: string;
29
+ accountId?: string;
30
+ }
31
+
32
+ export const AUTH_PACKAGE_NAME = 'auth';
33
+
34
+ export interface AuthServiceClient {
35
+ signIn(request: SignInRequest): Observable<SignInResponse>;
36
+
37
+ refreshAccessToken(
38
+ request: RefreshAccessTokenRequest,
39
+ ): Observable<RefreshAccessTokenResponse>;
40
+ }
41
+
42
+ export interface AuthServiceController {
43
+ signIn(
44
+ request: SignInRequest,
45
+ ): Promise<SignInResponse> | Observable<SignInResponse> | SignInResponse;
46
+
47
+ refreshAccessToken(
48
+ request: RefreshAccessTokenRequest,
49
+ ):
50
+ | Promise<RefreshAccessTokenResponse>
51
+ | Observable<RefreshAccessTokenResponse>
52
+ | RefreshAccessTokenResponse;
53
+ }
54
+
55
+ export function AuthServiceControllerMethods() {
56
+ return function (constructor: Function) {
57
+ const grpcMethods: string[] = ['signIn', 'refreshAccessToken'];
58
+ for (const method of grpcMethods) {
59
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
60
+ constructor.prototype,
61
+ method,
62
+ );
63
+ GrpcMethod('AuthService', method)(
64
+ constructor.prototype[method],
65
+ method,
66
+ descriptor,
67
+ );
68
+ }
69
+ const grpcStreamMethods: string[] = [];
70
+ for (const method of grpcStreamMethods) {
71
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
72
+ constructor.prototype,
73
+ method,
74
+ );
75
+ GrpcStreamMethod('AuthService', method)(
76
+ constructor.prototype[method],
77
+ method,
78
+ descriptor,
79
+ );
80
+ }
81
+ };
82
+ }
83
+
84
+ export const AUTH_SERVICE_NAME = 'AuthService';
@@ -0,0 +1,157 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v6.32.0
5
+ // source: bank-account.proto
6
+
7
+ /* eslint-disable */
8
+ import { BankAccountType, HolderType } from '@postpaybr/contracts/enums';
9
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
10
+ import { Observable } from 'rxjs';
11
+
12
+ export const protobufPackage = 'bankAccount';
13
+
14
+ export interface CreateBankAccountRequest {
15
+ bankCompeCode: number;
16
+ agency: string;
17
+ account: string;
18
+ digitAccount: string;
19
+ balance: number;
20
+ pixKey?: string;
21
+ holderType: HolderType;
22
+ accountType: BankAccountType;
23
+ recipientId: string;
24
+ }
25
+
26
+ export interface GetBankAccountByRecipientIdRequest {
27
+ recipientId: string;
28
+ }
29
+
30
+ export interface GetBankAccountByRecipientIdResponse {
31
+ bankAccount: BankAccount | undefined;
32
+ }
33
+
34
+ export interface GetAllBankAccountsResponse {
35
+ bankAccount: BankAccount[];
36
+ }
37
+
38
+ export interface BankAccount {
39
+ id: string;
40
+ bankCompeCode: number;
41
+ agency: string;
42
+ account: string;
43
+ digitAccount: string;
44
+ balance: number;
45
+ pixKey?: string;
46
+ holderType: HolderType;
47
+ accountType: BankAccountType;
48
+ recipientId: string;
49
+ }
50
+
51
+ export interface BankAccountResponse {
52
+ bankAccount: BankAccount | undefined;
53
+ }
54
+
55
+ export interface Void {}
56
+
57
+ export interface GetBankAccountRequest {
58
+ id: string;
59
+ }
60
+
61
+ export interface MainBankAccountResponse {
62
+ mainBankAccount: BankAccount | undefined;
63
+ }
64
+
65
+ export const BANK_ACCOUNT_PACKAGE_NAME = 'bankAccount';
66
+
67
+ export interface BankAccountServiceClient {
68
+ createBankAccount(
69
+ request: CreateBankAccountRequest,
70
+ ): Observable<BankAccountResponse>;
71
+
72
+ getBankAccountByRecipientId(
73
+ request: GetBankAccountByRecipientIdRequest,
74
+ ): Observable<GetBankAccountByRecipientIdResponse>;
75
+
76
+ getMainAccount(request: Void): Observable<MainBankAccountResponse>;
77
+
78
+ getAllBankAccounts(request: Void): Observable<GetAllBankAccountsResponse>;
79
+
80
+ getBankAccount(
81
+ request: GetBankAccountRequest,
82
+ ): Observable<BankAccountResponse>;
83
+ }
84
+
85
+ export interface BankAccountServiceController {
86
+ createBankAccount(
87
+ request: CreateBankAccountRequest,
88
+ ):
89
+ | Promise<BankAccountResponse>
90
+ | Observable<BankAccountResponse>
91
+ | BankAccountResponse;
92
+
93
+ getBankAccountByRecipientId(
94
+ request: GetBankAccountByRecipientIdRequest,
95
+ ):
96
+ | Promise<GetBankAccountByRecipientIdResponse>
97
+ | Observable<GetBankAccountByRecipientIdResponse>
98
+ | GetBankAccountByRecipientIdResponse;
99
+
100
+ getMainAccount(
101
+ request: Void,
102
+ ):
103
+ | Promise<MainBankAccountResponse>
104
+ | Observable<MainBankAccountResponse>
105
+ | MainBankAccountResponse;
106
+
107
+ getAllBankAccounts(
108
+ request: Void,
109
+ ):
110
+ | Promise<GetAllBankAccountsResponse>
111
+ | Observable<GetAllBankAccountsResponse>
112
+ | GetAllBankAccountsResponse;
113
+
114
+ getBankAccount(
115
+ request: GetBankAccountRequest,
116
+ ):
117
+ | Promise<BankAccountResponse>
118
+ | Observable<BankAccountResponse>
119
+ | BankAccountResponse;
120
+ }
121
+
122
+ export function BankAccountServiceControllerMethods() {
123
+ return function (constructor: Function) {
124
+ const grpcMethods: string[] = [
125
+ 'createBankAccount',
126
+ 'getBankAccountByRecipientId',
127
+ 'getMainAccount',
128
+ 'getAllBankAccounts',
129
+ 'getBankAccount',
130
+ ];
131
+ for (const method of grpcMethods) {
132
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
133
+ constructor.prototype,
134
+ method,
135
+ );
136
+ GrpcMethod('BankAccountService', method)(
137
+ constructor.prototype[method],
138
+ method,
139
+ descriptor,
140
+ );
141
+ }
142
+ const grpcStreamMethods: string[] = [];
143
+ for (const method of grpcStreamMethods) {
144
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
145
+ constructor.prototype,
146
+ method,
147
+ );
148
+ GrpcStreamMethod('BankAccountService', method)(
149
+ constructor.prototype[method],
150
+ method,
151
+ descriptor,
152
+ );
153
+ }
154
+ };
155
+ }
156
+
157
+ export const BANK_ACCOUNT_SERVICE_NAME = 'BankAccountService';
@@ -0,0 +1,92 @@
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: card-vault.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
9
+ import { Observable } from 'rxjs';
10
+
11
+ export const protobufPackage = 'cardVault';
12
+
13
+ export interface CardDetailsPayload {
14
+ token: string;
15
+ tokenCvv: string;
16
+ }
17
+
18
+ export interface CardDetailsResponse {
19
+ cvv: string;
20
+ firstSix: string;
21
+ lastFour: string;
22
+ ccn?: string | undefined;
23
+ expMonth: number;
24
+ expYear: number;
25
+ fullName: string;
26
+ cardType: string;
27
+ token: string;
28
+ }
29
+
30
+ export interface DeleteCardPayload {
31
+ cardToken: string;
32
+ cvvToken: string;
33
+ }
34
+
35
+ export interface DeleteCardResponse {
36
+ success: boolean;
37
+ }
38
+
39
+ export const CARD_VAULT_PACKAGE_NAME = 'cardVault';
40
+
41
+ export interface CardVaultServiceClient {
42
+ getCardDetails(request: CardDetailsPayload): Observable<CardDetailsResponse>;
43
+
44
+ deleteCard(request: DeleteCardPayload): Observable<DeleteCardResponse>;
45
+ }
46
+
47
+ export interface CardVaultServiceController {
48
+ getCardDetails(
49
+ request: CardDetailsPayload,
50
+ ):
51
+ | Promise<CardDetailsResponse>
52
+ | Observable<CardDetailsResponse>
53
+ | CardDetailsResponse;
54
+
55
+ deleteCard(
56
+ request: DeleteCardPayload,
57
+ ):
58
+ | Promise<DeleteCardResponse>
59
+ | Observable<DeleteCardResponse>
60
+ | DeleteCardResponse;
61
+ }
62
+
63
+ export function CardVaultServiceControllerMethods() {
64
+ return function (constructor: Function) {
65
+ const grpcMethods: string[] = ['getCardDetails', 'deleteCard'];
66
+ for (const method of grpcMethods) {
67
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
68
+ constructor.prototype,
69
+ method,
70
+ );
71
+ GrpcMethod('CardVaultService', method)(
72
+ constructor.prototype[method],
73
+ method,
74
+ descriptor,
75
+ );
76
+ }
77
+ const grpcStreamMethods: string[] = [];
78
+ for (const method of grpcStreamMethods) {
79
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
80
+ constructor.prototype,
81
+ method,
82
+ );
83
+ GrpcStreamMethod('CardVaultService', method)(
84
+ constructor.prototype[method],
85
+ method,
86
+ descriptor,
87
+ );
88
+ }
89
+ };
90
+ }
91
+
92
+ export const CARD_VAULT_SERVICE_NAME = 'CardVaultService';
@@ -0,0 +1,93 @@
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: card-verification.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
9
+ import { Observable } from 'rxjs';
10
+
11
+ export const protobufPackage = 'cardVerification';
12
+
13
+ export interface CreateCardVerificationRequest {
14
+ customerId: string;
15
+ cardId: string;
16
+ }
17
+
18
+ export interface CreateCardVerificationResponse {
19
+ id: string;
20
+ }
21
+
22
+ export interface CheckVerifyCardCodeRequest {
23
+ verificationId: string;
24
+ value: number;
25
+ }
26
+
27
+ export interface CheckVerifyCardCodeResponse {
28
+ remainingAttempts: number;
29
+ isSuccessfullyVerified: boolean;
30
+ cardId: string;
31
+ }
32
+
33
+ export const CARD_VERIFICATION_PACKAGE_NAME = 'cardVerification';
34
+
35
+ export interface CardVerificationServiceClient {
36
+ createCardVerification(
37
+ request: CreateCardVerificationRequest,
38
+ ): Observable<CreateCardVerificationResponse>;
39
+
40
+ checkVerifyCardCode(
41
+ request: CheckVerifyCardCodeRequest,
42
+ ): Observable<CheckVerifyCardCodeResponse>;
43
+ }
44
+
45
+ export interface CardVerificationServiceController {
46
+ createCardVerification(
47
+ request: CreateCardVerificationRequest,
48
+ ):
49
+ | Promise<CreateCardVerificationResponse>
50
+ | Observable<CreateCardVerificationResponse>
51
+ | CreateCardVerificationResponse;
52
+
53
+ checkVerifyCardCode(
54
+ request: CheckVerifyCardCodeRequest,
55
+ ):
56
+ | Promise<CheckVerifyCardCodeResponse>
57
+ | Observable<CheckVerifyCardCodeResponse>
58
+ | CheckVerifyCardCodeResponse;
59
+ }
60
+
61
+ export function CardVerificationServiceControllerMethods() {
62
+ return function (constructor: Function) {
63
+ const grpcMethods: string[] = [
64
+ 'createCardVerification',
65
+ 'checkVerifyCardCode',
66
+ ];
67
+ for (const method of grpcMethods) {
68
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
69
+ constructor.prototype,
70
+ method,
71
+ );
72
+ GrpcMethod('CardVerificationService', method)(
73
+ constructor.prototype[method],
74
+ method,
75
+ descriptor,
76
+ );
77
+ }
78
+ const grpcStreamMethods: string[] = [];
79
+ for (const method of grpcStreamMethods) {
80
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
81
+ constructor.prototype,
82
+ method,
83
+ );
84
+ GrpcStreamMethod('CardVerificationService', method)(
85
+ constructor.prototype[method],
86
+ method,
87
+ descriptor,
88
+ );
89
+ }
90
+ };
91
+ }
92
+
93
+ export const CARD_VERIFICATION_SERVICE_NAME = 'CardVerificationService';
@@ -0,0 +1,283 @@
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.4
5
+ // source: card.proto
6
+
7
+ /* eslint-disable */
8
+ import { brandType } from '@postpaybr/contracts/types';
9
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
10
+ import { Observable } from 'rxjs';
11
+
12
+ export const protobufPackage = 'card';
13
+
14
+ export interface CreateCardRequest {
15
+ customerId: string;
16
+ cardData: CardData | undefined;
17
+ }
18
+
19
+ export interface CreateCardResponse {
20
+ id: string;
21
+ shadowNumber: string;
22
+ brand: brandType;
23
+ expiration: string;
24
+ isCredit: boolean;
25
+ isDebit: boolean;
26
+ issuer?: string | undefined;
27
+ }
28
+
29
+ export interface CardData {
30
+ holderName: string;
31
+ nickname?: string | undefined;
32
+ number: string;
33
+ expiration: string;
34
+ cvv: string;
35
+ isCreditCard: boolean;
36
+ isDebitCard: boolean;
37
+ associatedAddressId: string;
38
+ }
39
+
40
+ export interface UpdateCardNicknameRequest {
41
+ customerId: string;
42
+ cardId: string;
43
+ nickname: string;
44
+ }
45
+
46
+ export interface UpdateCardNicknameResponse {
47
+ id: string;
48
+ nickname?: string | undefined;
49
+ brand: brandType;
50
+ shadowNumber: string;
51
+ vaultToken: string;
52
+ vaultTokenCvv: string;
53
+ expiration: string;
54
+ isCredit: boolean;
55
+ isDebit: boolean;
56
+ isDisabled: boolean;
57
+ isVerified: boolean;
58
+ customerId: string;
59
+ addressId: string;
60
+ issuer?: string | undefined;
61
+ }
62
+
63
+ export interface DeleteCardRequest {
64
+ cardId: string;
65
+ }
66
+
67
+ export interface GetCardsByTypeRequest {
68
+ customerId: string;
69
+ type: string;
70
+ }
71
+
72
+ export interface GetCardsByTypeResponse {
73
+ cards: CardDetails[];
74
+ }
75
+
76
+ export interface CardDetails {
77
+ id: string;
78
+ nickname?: string | undefined;
79
+ brand: brandType;
80
+ shadowNumber: string;
81
+ vaultToken: string;
82
+ vaultTokenCvv: string;
83
+ expiration: string;
84
+ isCredit: boolean;
85
+ isDebit: boolean;
86
+ isDisabled: boolean;
87
+ isVerified: boolean;
88
+ customerId: string;
89
+ addressId: string;
90
+ issuer?: string | undefined;
91
+ }
92
+
93
+ export interface GetVaultCardDetailsRequest {
94
+ customerId: string;
95
+ cardId: string;
96
+ }
97
+
98
+ export interface GetVaultCardDetailsResponse {
99
+ token: string;
100
+ cvv: string;
101
+ }
102
+
103
+ export interface TokenizeCardRequest {
104
+ ccn: string;
105
+ cvv: string;
106
+ expMonth: number;
107
+ expYear: number;
108
+ cardType: string;
109
+ fullName: string;
110
+ referenceId: string;
111
+ cvvTtl: number;
112
+ }
113
+
114
+ export interface TokenizeCardResponse {
115
+ vaultToken: string;
116
+ vaultTokenCvv: string;
117
+ }
118
+
119
+ export interface GetAllCardsByCustomerIdRequest {
120
+ customerId: string;
121
+ }
122
+
123
+ export interface GetAllCardsByCustomerIdResponse {
124
+ cards: CardDetails[];
125
+ }
126
+
127
+ export interface GetCardByIdRequest {
128
+ id: string;
129
+ includeVaultTokens?: boolean | undefined;
130
+ }
131
+
132
+ export interface ValidateCardNumberRequest {
133
+ cardNumber: string;
134
+ }
135
+
136
+ export interface ValidateCardNumberResponse {
137
+ isValid: boolean;
138
+ }
139
+
140
+ export interface ValidateCVVRequest {
141
+ cardId: string;
142
+ cvv: string;
143
+ customerId: string;
144
+ }
145
+
146
+ export interface ValidateCVVResponse {
147
+ isValid: boolean;
148
+ remainingAttempts: number;
149
+ isBlocked: boolean;
150
+ blockedUntil?: Date;
151
+ }
152
+
153
+ export const CARD_PACKAGE_NAME = 'card';
154
+
155
+ export interface CardServiceClient {
156
+ createCard(request: CreateCardRequest): Observable<CreateCardResponse>;
157
+
158
+ updateCardNickname(
159
+ request: UpdateCardNicknameRequest,
160
+ ): Observable<UpdateCardNicknameResponse>;
161
+
162
+ deleteCard(request: DeleteCardRequest): Observable<CardDetails>;
163
+
164
+ getCardsByType(
165
+ request: GetCardsByTypeRequest,
166
+ ): Observable<GetCardsByTypeResponse>;
167
+
168
+ getVaultCardDetails(
169
+ request: GetVaultCardDetailsRequest,
170
+ ): Observable<GetVaultCardDetailsResponse>;
171
+
172
+ getAllCardsByCustomerId(
173
+ request: GetAllCardsByCustomerIdRequest,
174
+ ): Observable<GetAllCardsByCustomerIdResponse>;
175
+
176
+ getCardById(request: GetCardByIdRequest): Observable<CardDetails>;
177
+
178
+ validateCardNumber(
179
+ request: ValidateCardNumberRequest,
180
+ ): Observable<ValidateCardNumberResponse>;
181
+
182
+ validateCvv(request: ValidateCVVRequest): Observable<ValidateCVVResponse>;
183
+ }
184
+
185
+ export interface CardServiceController {
186
+ createCard(
187
+ request: CreateCardRequest,
188
+ ):
189
+ | Promise<CreateCardResponse>
190
+ | Observable<CreateCardResponse>
191
+ | CreateCardResponse;
192
+
193
+ updateCardNickname(
194
+ request: UpdateCardNicknameRequest,
195
+ ):
196
+ | Promise<UpdateCardNicknameResponse>
197
+ | Observable<UpdateCardNicknameResponse>
198
+ | UpdateCardNicknameResponse;
199
+
200
+ deleteCard(
201
+ request: DeleteCardRequest,
202
+ ): Promise<CardDetails> | Observable<CardDetails> | CardDetails;
203
+
204
+ getCardsByType(
205
+ request: GetCardsByTypeRequest,
206
+ ):
207
+ | Promise<GetCardsByTypeResponse>
208
+ | Observable<GetCardsByTypeResponse>
209
+ | GetCardsByTypeResponse;
210
+
211
+ getVaultCardDetails(
212
+ request: GetVaultCardDetailsRequest,
213
+ ):
214
+ | Promise<GetVaultCardDetailsResponse>
215
+ | Observable<GetVaultCardDetailsResponse>
216
+ | GetVaultCardDetailsResponse;
217
+
218
+ getAllCardsByCustomerId(
219
+ request: GetAllCardsByCustomerIdRequest,
220
+ ):
221
+ | Promise<GetAllCardsByCustomerIdResponse>
222
+ | Observable<GetAllCardsByCustomerIdResponse>
223
+ | GetAllCardsByCustomerIdResponse;
224
+
225
+ getCardById(
226
+ request: GetCardByIdRequest,
227
+ ): Promise<CardDetails> | Observable<CardDetails> | CardDetails;
228
+
229
+ validateCardNumber(
230
+ request: ValidateCardNumberRequest,
231
+ ):
232
+ | Promise<ValidateCardNumberResponse>
233
+ | Observable<ValidateCardNumberResponse>
234
+ | ValidateCardNumberResponse;
235
+
236
+ validateCvv(
237
+ request: ValidateCVVRequest,
238
+ ):
239
+ | Promise<ValidateCVVResponse>
240
+ | Observable<ValidateCVVResponse>
241
+ | ValidateCVVResponse;
242
+ }
243
+
244
+ export function CardServiceControllerMethods() {
245
+ return function (constructor: Function) {
246
+ const grpcMethods: string[] = [
247
+ 'createCard',
248
+ 'updateCardNickname',
249
+ 'deleteCard',
250
+ 'getCardsByType',
251
+ 'getVaultCardDetails',
252
+ 'getAllCardsByCustomerId',
253
+ 'getCardById',
254
+ 'validateCardNumber',
255
+ 'validateCvv',
256
+ ];
257
+ for (const method of grpcMethods) {
258
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
259
+ constructor.prototype,
260
+ method,
261
+ );
262
+ GrpcMethod('CardService', method)(
263
+ constructor.prototype[method],
264
+ method,
265
+ descriptor,
266
+ );
267
+ }
268
+ const grpcStreamMethods: string[] = [];
269
+ for (const method of grpcStreamMethods) {
270
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
271
+ constructor.prototype,
272
+ method,
273
+ );
274
+ GrpcStreamMethod('CardService', method)(
275
+ constructor.prototype[method],
276
+ method,
277
+ descriptor,
278
+ );
279
+ }
280
+ };
281
+ }
282
+
283
+ export const CARD_SERVICE_NAME = 'CardService';