@arbiwallet/contracts 1.0.209 → 1.0.211
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/gen/crm_auth.ts +7 -0
- package/gen/crm_manager.ts +10 -0
- package/gen/exchange_core.ts +248 -25
- package/package.json +1 -1
- package/proto/crm_auth.proto +7 -0
- package/proto/crm_manager.proto +10 -0
- package/proto/exchange_core.proto +205 -7
package/gen/crm_auth.ts
CHANGED
|
@@ -55,6 +55,12 @@ export interface CrmGetMeRequest {
|
|
|
55
55
|
accessToken: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
export interface SectionPermission {
|
|
59
|
+
section: string;
|
|
60
|
+
view: boolean;
|
|
61
|
+
edit: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
export interface CrmManagerResponse {
|
|
59
65
|
id: string;
|
|
60
66
|
email: string;
|
|
@@ -68,6 +74,7 @@ export interface CrmManagerResponse {
|
|
|
68
74
|
roles: string[];
|
|
69
75
|
permissions: string[];
|
|
70
76
|
isSuperAdmin: boolean;
|
|
77
|
+
sectionPermissions: SectionPermission[];
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
export interface CrmAuthSessionResponse {
|
package/gen/crm_manager.ts
CHANGED
|
@@ -17,6 +17,12 @@ export enum CrmManagerRecordStatus {
|
|
|
17
17
|
UNRECOGNIZED = -1,
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export interface SectionPermission {
|
|
21
|
+
section: string;
|
|
22
|
+
view: boolean;
|
|
23
|
+
edit: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
export interface ManagerRecord {
|
|
21
27
|
id: string;
|
|
22
28
|
email: string;
|
|
@@ -30,6 +36,7 @@ export interface ManagerRecord {
|
|
|
30
36
|
roles: string[];
|
|
31
37
|
permissions: string[];
|
|
32
38
|
isSuperAdmin: boolean;
|
|
39
|
+
sectionPermissions: SectionPermission[];
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
export interface RoleRecord {
|
|
@@ -62,6 +69,7 @@ export interface CreateManagerRequest {
|
|
|
62
69
|
avatarUrl: string;
|
|
63
70
|
status: CrmManagerRecordStatus;
|
|
64
71
|
roleNames: string[];
|
|
72
|
+
sectionPermissions: SectionPermission[];
|
|
65
73
|
}
|
|
66
74
|
|
|
67
75
|
export interface CreateManagerResponse {
|
|
@@ -81,6 +89,8 @@ export interface UpdateManagerRequest {
|
|
|
81
89
|
status: CrmManagerRecordStatus;
|
|
82
90
|
replaceRoles: boolean;
|
|
83
91
|
roleNames: string[];
|
|
92
|
+
sectionPermissions: SectionPermission[];
|
|
93
|
+
replaceSectionPermissions: boolean;
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
export interface UpdateManagerResponse {
|
package/gen/exchange_core.ts
CHANGED
|
@@ -12,6 +12,22 @@ import { Struct } from "./google/protobuf/struct";
|
|
|
12
12
|
|
|
13
13
|
export const protobufPackage = "exchange_core";
|
|
14
14
|
|
|
15
|
+
export enum ExchangeDealStatus {
|
|
16
|
+
EXCHANGE_DEAL_STATUS_UNSPECIFIED = 0,
|
|
17
|
+
EXCHANGE_DEAL_STATUS_NO_DEAL = 1,
|
|
18
|
+
EXCHANGE_DEAL_STATUS_IN_PROGRESS = 2,
|
|
19
|
+
EXCHANGE_DEAL_STATUS_COMPLETED = 3,
|
|
20
|
+
EXCHANGE_DEAL_STATUS_CANCELLED = 4,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum ExchangeDealAction {
|
|
25
|
+
EXCHANGE_DEAL_ACTION_UNSPECIFIED = 0,
|
|
26
|
+
EXCHANGE_DEAL_ACTION_CREATE_DEAL = 1,
|
|
27
|
+
EXCHANGE_DEAL_ACTION_OPEN_DEAL = 2,
|
|
28
|
+
UNRECOGNIZED = -1,
|
|
29
|
+
}
|
|
30
|
+
|
|
15
31
|
export interface CreateExchangeOrderRequest {
|
|
16
32
|
inputAmount: number;
|
|
17
33
|
outputAmount: number;
|
|
@@ -98,7 +114,7 @@ export interface GetExchangePaymentsResponse {
|
|
|
98
114
|
}
|
|
99
115
|
|
|
100
116
|
export interface CreateExchangeDealRequest {
|
|
101
|
-
managerUserId
|
|
117
|
+
managerUserId: string;
|
|
102
118
|
managerId?: string | undefined;
|
|
103
119
|
calculationId?: string | undefined;
|
|
104
120
|
paymentId?: string | undefined;
|
|
@@ -141,52 +157,259 @@ export interface CreateExchangeDealResponse {
|
|
|
141
157
|
validationErrors?: { [key: string]: any } | undefined;
|
|
142
158
|
}
|
|
143
159
|
|
|
160
|
+
export interface GetExchangeDealsRequest {
|
|
161
|
+
fromDate?: string | undefined;
|
|
162
|
+
toDate?: string | undefined;
|
|
163
|
+
manager?: number | undefined;
|
|
164
|
+
customer?: number | undefined;
|
|
165
|
+
page?: number | undefined;
|
|
166
|
+
pageSize?: number | undefined;
|
|
167
|
+
ordering?: string | undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface GetExchangeDealsManager {
|
|
171
|
+
id: number;
|
|
172
|
+
email: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface GetExchangeDealsItem {
|
|
176
|
+
id: number;
|
|
177
|
+
customerId: number;
|
|
178
|
+
paymentId?: number | undefined;
|
|
179
|
+
inputAmount: number;
|
|
180
|
+
inputCurrencyId: number;
|
|
181
|
+
outputAmount: number;
|
|
182
|
+
outputCurrencyId: number;
|
|
183
|
+
factOutputAmount: number;
|
|
184
|
+
status: boolean;
|
|
185
|
+
exchangeStatusName: string;
|
|
186
|
+
calculationSourceId?: number | undefined;
|
|
187
|
+
manager?: GetExchangeDealsManager | undefined;
|
|
188
|
+
createdAt: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface GetExchangeDealsResponse {
|
|
192
|
+
count: number;
|
|
193
|
+
next?: string | undefined;
|
|
194
|
+
previous?: string | undefined;
|
|
195
|
+
results: GetExchangeDealsItem[];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface UpdateExchangeDealRequest {
|
|
199
|
+
id: number;
|
|
200
|
+
customerId?: number | undefined;
|
|
201
|
+
inputAmount?: number | undefined;
|
|
202
|
+
inputCurrencyId?: number | undefined;
|
|
203
|
+
inputWalletId?: number | undefined;
|
|
204
|
+
methodId?: number | undefined;
|
|
205
|
+
outputCurrencyId?: number | undefined;
|
|
206
|
+
outputAmount?: number | undefined;
|
|
207
|
+
factOutputAmount?: number | undefined;
|
|
208
|
+
outputWalletId?: number | undefined;
|
|
209
|
+
exchangeStatusId?: number | undefined;
|
|
210
|
+
payed?: boolean | undefined;
|
|
211
|
+
managerPersonId?: number | undefined;
|
|
212
|
+
exchangeRate1Iter?: number | undefined;
|
|
213
|
+
exchangeRate2Iter?: number | undefined;
|
|
214
|
+
usdtRate?: number | undefined;
|
|
215
|
+
includeInTotalCalculation?: boolean | undefined;
|
|
216
|
+
receipts: number[];
|
|
217
|
+
customerDocName?: string | undefined;
|
|
218
|
+
customerDocNationality?: string | undefined;
|
|
219
|
+
customerDocNumber?: string | undefined;
|
|
220
|
+
priorityManagerId?: number | undefined;
|
|
221
|
+
priorityOutcomeWalletId?: number | undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface UpdateExchangeDealResult {
|
|
225
|
+
id: number;
|
|
226
|
+
customerId: number;
|
|
227
|
+
inputAmount: number;
|
|
228
|
+
inputCurrencyId: number;
|
|
229
|
+
outputAmount: number;
|
|
230
|
+
outputCurrencyId: number;
|
|
231
|
+
factOutputAmount: number;
|
|
232
|
+
exchangeStatusId: number;
|
|
233
|
+
payed: boolean;
|
|
234
|
+
includeInTotalCalculation: boolean;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface UpdateExchangeDealResponse {
|
|
238
|
+
ok: boolean;
|
|
239
|
+
result?: UpdateExchangeDealResult | undefined;
|
|
240
|
+
error?: string | undefined;
|
|
241
|
+
validationErrors?: { [key: string]: any } | undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface CompleteExchangeDealRequest {
|
|
245
|
+
id: number;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface CompleteExchangeDealResponse {
|
|
249
|
+
success: boolean;
|
|
250
|
+
message?: string | undefined;
|
|
251
|
+
error?: string | undefined;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface CancelExchangeDealRequest {
|
|
255
|
+
id: number;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface CancelExchangeDealResponse {
|
|
259
|
+
success: boolean;
|
|
260
|
+
message?: string | undefined;
|
|
261
|
+
error?: string | undefined;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface GetExchangeDealStatesByCalculationIdsRequest {
|
|
265
|
+
calculationIds: string[];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface ExchangeDealStateByCalculation {
|
|
269
|
+
calculationId: string;
|
|
270
|
+
dealId?: number | undefined;
|
|
271
|
+
status: ExchangeDealStatus;
|
|
272
|
+
allowedActions: ExchangeDealAction[];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface GetExchangeDealStatesByCalculationIdsResponse {
|
|
276
|
+
items: ExchangeDealStateByCalculation[];
|
|
277
|
+
notFoundCalculationIds: string[];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface GetTransactionsRequest {
|
|
281
|
+
startDate?: string | undefined;
|
|
282
|
+
endDate?: string | undefined;
|
|
283
|
+
userId?: number | undefined;
|
|
284
|
+
currencyId?: number | undefined;
|
|
285
|
+
walletId?: number | undefined;
|
|
286
|
+
type?: number | undefined;
|
|
287
|
+
accountType?: number | undefined;
|
|
288
|
+
categoryId?: number | undefined;
|
|
289
|
+
businessUnitId?: number | undefined;
|
|
290
|
+
search?: string | undefined;
|
|
291
|
+
page?: number | undefined;
|
|
292
|
+
pageSize?: number | undefined;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface GetTransactionsSummaryItem {
|
|
296
|
+
currency: string;
|
|
297
|
+
totalIncome: number;
|
|
298
|
+
totalExpense: number;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface GetTransactionsItem {
|
|
302
|
+
id: number;
|
|
303
|
+
transactionDatetime: string;
|
|
304
|
+
createdAt: string;
|
|
305
|
+
amount: number;
|
|
306
|
+
currency?: string | undefined;
|
|
307
|
+
usdtAmount?: number | undefined;
|
|
308
|
+
status: boolean;
|
|
309
|
+
walletId?: number | undefined;
|
|
310
|
+
walletName?: string | undefined;
|
|
311
|
+
moveWalletId?: number | undefined;
|
|
312
|
+
moveWalletName?: string | undefined;
|
|
313
|
+
type: number;
|
|
314
|
+
typeName?: string | undefined;
|
|
315
|
+
categoryId?: number | undefined;
|
|
316
|
+
categoryName?: string | undefined;
|
|
317
|
+
businessUnitId?: number | undefined;
|
|
318
|
+
businessUnitName?: string | undefined;
|
|
319
|
+
name: string;
|
|
320
|
+
comment?: string | undefined;
|
|
321
|
+
exchangeId?: number | undefined;
|
|
322
|
+
exchangeUrl?: string | undefined;
|
|
323
|
+
userId?: number | undefined;
|
|
324
|
+
username?: string | undefined;
|
|
325
|
+
accountType: number;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface GetTransactionsResponse {
|
|
329
|
+
count: number;
|
|
330
|
+
next?: string | undefined;
|
|
331
|
+
previous?: string | undefined;
|
|
332
|
+
results: GetTransactionsItem[];
|
|
333
|
+
summary: GetTransactionsSummaryItem[];
|
|
334
|
+
}
|
|
335
|
+
|
|
144
336
|
export const EXCHANGE_CORE_PACKAGE_NAME = "exchange_core";
|
|
145
337
|
|
|
146
338
|
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
|
147
339
|
|
|
340
|
+
/**
|
|
341
|
+
* rpc CreateExchangePayment(CreateExchangePaymentRequest) returns (CreateExchangePaymentResponse);
|
|
342
|
+
* rpc HandlePaymentWebhook(HandlePaymentWebhookRequest) returns (HandlePaymentWebhookResponse);
|
|
343
|
+
* rpc GetExchangePayments(GetExchangePaymentsRequest) returns (GetExchangePaymentsResponse);
|
|
344
|
+
*/
|
|
345
|
+
|
|
148
346
|
export interface ExchangeCoreServiceClient {
|
|
149
|
-
|
|
347
|
+
createExchangeDeal(request: CreateExchangeDealRequest): Observable<CreateExchangeDealResponse>;
|
|
150
348
|
|
|
151
|
-
|
|
349
|
+
getExchangeDeals(request: GetExchangeDealsRequest): Observable<GetExchangeDealsResponse>;
|
|
152
350
|
|
|
153
|
-
|
|
351
|
+
updateExchangeDeal(request: UpdateExchangeDealRequest): Observable<UpdateExchangeDealResponse>;
|
|
154
352
|
|
|
155
|
-
|
|
353
|
+
completeExchangeDeal(request: CompleteExchangeDealRequest): Observable<CompleteExchangeDealResponse>;
|
|
156
354
|
|
|
157
|
-
|
|
158
|
-
}
|
|
355
|
+
cancelExchangeDeal(request: CancelExchangeDealRequest): Observable<CancelExchangeDealResponse>;
|
|
159
356
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
): Promise<CreateExchangeOrderResponse> | Observable<CreateExchangeOrderResponse> | CreateExchangeOrderResponse;
|
|
357
|
+
getExchangeDealStatesByCalculationIds(
|
|
358
|
+
request: GetExchangeDealStatesByCalculationIdsRequest,
|
|
359
|
+
): Observable<GetExchangeDealStatesByCalculationIdsResponse>;
|
|
164
360
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
): Promise<CreateExchangePaymentResponse> | Observable<CreateExchangePaymentResponse> | CreateExchangePaymentResponse;
|
|
168
|
-
|
|
169
|
-
handlePaymentWebhook(
|
|
170
|
-
request: HandlePaymentWebhookRequest,
|
|
171
|
-
): Promise<HandlePaymentWebhookResponse> | Observable<HandlePaymentWebhookResponse> | HandlePaymentWebhookResponse;
|
|
361
|
+
getTransactions(request: GetTransactionsRequest): Observable<GetTransactionsResponse>;
|
|
362
|
+
}
|
|
172
363
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
364
|
+
/**
|
|
365
|
+
* rpc CreateExchangePayment(CreateExchangePaymentRequest) returns (CreateExchangePaymentResponse);
|
|
366
|
+
* rpc HandlePaymentWebhook(HandlePaymentWebhookRequest) returns (HandlePaymentWebhookResponse);
|
|
367
|
+
* rpc GetExchangePayments(GetExchangePaymentsRequest) returns (GetExchangePaymentsResponse);
|
|
368
|
+
*/
|
|
176
369
|
|
|
370
|
+
export interface ExchangeCoreServiceController {
|
|
177
371
|
createExchangeDeal(
|
|
178
372
|
request: CreateExchangeDealRequest,
|
|
179
373
|
): Promise<CreateExchangeDealResponse> | Observable<CreateExchangeDealResponse> | CreateExchangeDealResponse;
|
|
374
|
+
|
|
375
|
+
getExchangeDeals(
|
|
376
|
+
request: GetExchangeDealsRequest,
|
|
377
|
+
): Promise<GetExchangeDealsResponse> | Observable<GetExchangeDealsResponse> | GetExchangeDealsResponse;
|
|
378
|
+
|
|
379
|
+
updateExchangeDeal(
|
|
380
|
+
request: UpdateExchangeDealRequest,
|
|
381
|
+
): Promise<UpdateExchangeDealResponse> | Observable<UpdateExchangeDealResponse> | UpdateExchangeDealResponse;
|
|
382
|
+
|
|
383
|
+
completeExchangeDeal(
|
|
384
|
+
request: CompleteExchangeDealRequest,
|
|
385
|
+
): Promise<CompleteExchangeDealResponse> | Observable<CompleteExchangeDealResponse> | CompleteExchangeDealResponse;
|
|
386
|
+
|
|
387
|
+
cancelExchangeDeal(
|
|
388
|
+
request: CancelExchangeDealRequest,
|
|
389
|
+
): Promise<CancelExchangeDealResponse> | Observable<CancelExchangeDealResponse> | CancelExchangeDealResponse;
|
|
390
|
+
|
|
391
|
+
getExchangeDealStatesByCalculationIds(
|
|
392
|
+
request: GetExchangeDealStatesByCalculationIdsRequest,
|
|
393
|
+
):
|
|
394
|
+
| Promise<GetExchangeDealStatesByCalculationIdsResponse>
|
|
395
|
+
| Observable<GetExchangeDealStatesByCalculationIdsResponse>
|
|
396
|
+
| GetExchangeDealStatesByCalculationIdsResponse;
|
|
397
|
+
|
|
398
|
+
getTransactions(
|
|
399
|
+
request: GetTransactionsRequest,
|
|
400
|
+
): Promise<GetTransactionsResponse> | Observable<GetTransactionsResponse> | GetTransactionsResponse;
|
|
180
401
|
}
|
|
181
402
|
|
|
182
403
|
export function ExchangeCoreServiceControllerMethods() {
|
|
183
404
|
return function (constructor: Function) {
|
|
184
405
|
const grpcMethods: string[] = [
|
|
185
|
-
"createExchangeOrder",
|
|
186
|
-
"createExchangePayment",
|
|
187
|
-
"handlePaymentWebhook",
|
|
188
|
-
"getExchangePayments",
|
|
189
406
|
"createExchangeDeal",
|
|
407
|
+
"getExchangeDeals",
|
|
408
|
+
"updateExchangeDeal",
|
|
409
|
+
"completeExchangeDeal",
|
|
410
|
+
"cancelExchangeDeal",
|
|
411
|
+
"getExchangeDealStatesByCalculationIds",
|
|
412
|
+
"getTransactions",
|
|
190
413
|
];
|
|
191
414
|
for (const method of grpcMethods) {
|
|
192
415
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbiwallet/contracts",
|
|
3
3
|
"descriptions": "Generate and manage smart contracts for ArbiWallet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.211",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
package/proto/crm_auth.proto
CHANGED
|
@@ -53,6 +53,12 @@ message CrmGetMeRequest {
|
|
|
53
53
|
string access_token = 1;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
message SectionPermission {
|
|
57
|
+
string section = 1;
|
|
58
|
+
bool view = 2;
|
|
59
|
+
bool edit = 3;
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
message CrmManagerResponse {
|
|
57
63
|
string id = 1;
|
|
58
64
|
string email = 2;
|
|
@@ -66,6 +72,7 @@ message CrmManagerResponse {
|
|
|
66
72
|
repeated string roles = 10;
|
|
67
73
|
repeated string permissions = 11;
|
|
68
74
|
bool is_super_admin = 12;
|
|
75
|
+
repeated SectionPermission section_permissions = 13;
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
message CrmAuthSessionResponse {
|
package/proto/crm_manager.proto
CHANGED
|
@@ -15,6 +15,12 @@ enum CrmManagerRecordStatus {
|
|
|
15
15
|
CRM_MANAGER_RECORD_STATUS_DISABLED = 2;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
message SectionPermission {
|
|
19
|
+
string section = 1;
|
|
20
|
+
bool view = 2;
|
|
21
|
+
bool edit = 3;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
message ManagerRecord {
|
|
19
25
|
string id = 1;
|
|
20
26
|
string email = 2;
|
|
@@ -28,6 +34,7 @@ message ManagerRecord {
|
|
|
28
34
|
repeated string roles = 10;
|
|
29
35
|
repeated string permissions = 11;
|
|
30
36
|
bool is_super_admin = 12;
|
|
37
|
+
repeated SectionPermission section_permissions = 13;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
message RoleRecord {
|
|
@@ -60,6 +67,7 @@ message CreateManagerRequest {
|
|
|
60
67
|
string avatar_url = 6;
|
|
61
68
|
CrmManagerRecordStatus status = 7;
|
|
62
69
|
repeated string role_names = 8;
|
|
70
|
+
repeated SectionPermission section_permissions = 9;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
message CreateManagerResponse {
|
|
@@ -79,6 +87,8 @@ message UpdateManagerRequest {
|
|
|
79
87
|
CrmManagerRecordStatus status = 8;
|
|
80
88
|
bool replace_roles = 9;
|
|
81
89
|
repeated string role_names = 10;
|
|
90
|
+
repeated SectionPermission section_permissions = 11;
|
|
91
|
+
bool replace_section_permissions = 12;
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
message UpdateManagerResponse {
|
|
@@ -9,13 +9,19 @@ option java_multiple_files = true;
|
|
|
9
9
|
option java_package = "com.arbiwallet.exchange.core";
|
|
10
10
|
|
|
11
11
|
service ExchangeCoreService {
|
|
12
|
-
rpc
|
|
13
|
-
|
|
14
|
-
rpc
|
|
15
|
-
|
|
16
|
-
rpc GetExchangePayments(GetExchangePaymentsRequest) returns (GetExchangePaymentsResponse);
|
|
17
|
-
|
|
12
|
+
// rpc CreateExchangePayment(CreateExchangePaymentRequest) returns (CreateExchangePaymentResponse);
|
|
13
|
+
// rpc HandlePaymentWebhook(HandlePaymentWebhookRequest) returns (HandlePaymentWebhookResponse);
|
|
14
|
+
// rpc GetExchangePayments(GetExchangePaymentsRequest) returns (GetExchangePaymentsResponse);
|
|
15
|
+
|
|
18
16
|
rpc CreateExchangeDeal(CreateExchangeDealRequest) returns (CreateExchangeDealResponse);
|
|
17
|
+
rpc GetExchangeDeals(GetExchangeDealsRequest) returns (GetExchangeDealsResponse);
|
|
18
|
+
rpc UpdateExchangeDeal(UpdateExchangeDealRequest) returns (UpdateExchangeDealResponse);
|
|
19
|
+
rpc CompleteExchangeDeal(CompleteExchangeDealRequest) returns (CompleteExchangeDealResponse);
|
|
20
|
+
rpc CancelExchangeDeal(CancelExchangeDealRequest) returns (CancelExchangeDealResponse);
|
|
21
|
+
|
|
22
|
+
rpc GetExchangeDealStatesByCalculationIds(GetExchangeDealStatesByCalculationIdsRequest) returns (GetExchangeDealStatesByCalculationIdsResponse);
|
|
23
|
+
|
|
24
|
+
rpc GetTransactions(GetTransactionsRequest) returns (GetTransactionsResponse);
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
message CreateExchangeOrderRequest {
|
|
@@ -105,7 +111,7 @@ message GetExchangePaymentsResponse {
|
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
message CreateExchangeDealRequest {
|
|
108
|
-
|
|
114
|
+
string manager_user_id = 1;
|
|
109
115
|
optional string manager_id = 2;
|
|
110
116
|
|
|
111
117
|
optional string calculation_id = 3;
|
|
@@ -156,3 +162,195 @@ message CreateExchangeDealResponse {
|
|
|
156
162
|
optional string error = 3;
|
|
157
163
|
optional google.protobuf.Struct validationErrors = 4;
|
|
158
164
|
}
|
|
165
|
+
|
|
166
|
+
message GetExchangeDealsRequest {
|
|
167
|
+
optional string from_date = 1;
|
|
168
|
+
optional string to_date = 2;
|
|
169
|
+
optional int32 manager = 3;
|
|
170
|
+
optional int32 customer = 4;
|
|
171
|
+
optional int32 page = 5;
|
|
172
|
+
optional int32 page_size = 6;
|
|
173
|
+
optional string ordering = 7;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
message GetExchangeDealsManager {
|
|
177
|
+
int32 id = 1;
|
|
178
|
+
string email = 2;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
message GetExchangeDealsItem {
|
|
182
|
+
int32 id = 1;
|
|
183
|
+
int32 customer_id = 2;
|
|
184
|
+
optional int32 payment_id = 3;
|
|
185
|
+
double input_amount = 4;
|
|
186
|
+
int32 input_currency_id = 5;
|
|
187
|
+
double output_amount = 6;
|
|
188
|
+
int32 output_currency_id = 7;
|
|
189
|
+
double fact_output_amount = 8;
|
|
190
|
+
bool status = 9;
|
|
191
|
+
string exchange_status_name = 10;
|
|
192
|
+
optional int32 calculation_source_id = 11;
|
|
193
|
+
optional GetExchangeDealsManager manager = 12;
|
|
194
|
+
string created_at = 13;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
message GetExchangeDealsResponse {
|
|
198
|
+
int32 count = 1;
|
|
199
|
+
optional string next = 2;
|
|
200
|
+
optional string previous = 3;
|
|
201
|
+
repeated GetExchangeDealsItem results = 4;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
message UpdateExchangeDealRequest {
|
|
205
|
+
int32 id = 1;
|
|
206
|
+
|
|
207
|
+
optional int32 customer_id = 2;
|
|
208
|
+
optional double input_amount = 3;
|
|
209
|
+
optional int32 input_currency_id = 4;
|
|
210
|
+
optional int32 input_wallet_id = 5;
|
|
211
|
+
optional int32 method_id = 6;
|
|
212
|
+
optional int32 output_currency_id = 7;
|
|
213
|
+
optional double output_amount = 8;
|
|
214
|
+
optional double fact_output_amount = 9;
|
|
215
|
+
optional int32 output_wallet_id = 10;
|
|
216
|
+
optional int32 exchange_status_id = 11;
|
|
217
|
+
optional bool payed = 12;
|
|
218
|
+
optional int32 manager_person_id = 13;
|
|
219
|
+
optional double exchange_rate_1_iter = 14;
|
|
220
|
+
optional double exchange_rate_2_iter = 15;
|
|
221
|
+
optional double usdt_rate = 16;
|
|
222
|
+
optional bool include_in_total_calculation = 17;
|
|
223
|
+
|
|
224
|
+
repeated double receipts = 18;
|
|
225
|
+
optional string customer_doc_name = 19;
|
|
226
|
+
optional string customer_doc_nationality = 20;
|
|
227
|
+
optional string customer_doc_number = 21;
|
|
228
|
+
optional int32 priority_manager_id = 22;
|
|
229
|
+
optional int32 priority_outcome_wallet_id = 23;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
message UpdateExchangeDealResult {
|
|
233
|
+
int32 id = 1;
|
|
234
|
+
int32 customer_id = 2;
|
|
235
|
+
double input_amount = 3;
|
|
236
|
+
int32 input_currency_id = 4;
|
|
237
|
+
double output_amount = 5;
|
|
238
|
+
int32 output_currency_id = 6;
|
|
239
|
+
double fact_output_amount = 7;
|
|
240
|
+
int32 exchange_status_id = 8;
|
|
241
|
+
bool payed = 9;
|
|
242
|
+
bool include_in_total_calculation = 10;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
message UpdateExchangeDealResponse {
|
|
246
|
+
bool ok = 1;
|
|
247
|
+
optional UpdateExchangeDealResult result = 2;
|
|
248
|
+
optional string error = 3;
|
|
249
|
+
optional google.protobuf.Struct validationErrors = 4;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
message CompleteExchangeDealRequest {
|
|
253
|
+
int32 id = 1;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
message CompleteExchangeDealResponse {
|
|
257
|
+
bool success = 1;
|
|
258
|
+
optional string message = 2;
|
|
259
|
+
optional string error = 3;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
message CancelExchangeDealRequest {
|
|
263
|
+
int32 id = 1;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
message CancelExchangeDealResponse {
|
|
267
|
+
bool success = 1;
|
|
268
|
+
optional string message = 2;
|
|
269
|
+
optional string error = 3;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
message GetExchangeDealStatesByCalculationIdsRequest {
|
|
273
|
+
repeated string calculation_ids = 1;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
enum ExchangeDealStatus {
|
|
277
|
+
EXCHANGE_DEAL_STATUS_UNSPECIFIED = 0;
|
|
278
|
+
EXCHANGE_DEAL_STATUS_NO_DEAL = 1;
|
|
279
|
+
EXCHANGE_DEAL_STATUS_IN_PROGRESS = 2;
|
|
280
|
+
EXCHANGE_DEAL_STATUS_COMPLETED = 3;
|
|
281
|
+
EXCHANGE_DEAL_STATUS_CANCELLED = 4;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
enum ExchangeDealAction {
|
|
285
|
+
EXCHANGE_DEAL_ACTION_UNSPECIFIED = 0;
|
|
286
|
+
EXCHANGE_DEAL_ACTION_CREATE_DEAL = 1;
|
|
287
|
+
EXCHANGE_DEAL_ACTION_OPEN_DEAL = 2;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
message ExchangeDealStateByCalculation {
|
|
291
|
+
string calculation_id = 1;
|
|
292
|
+
optional int32 deal_id = 2;
|
|
293
|
+
ExchangeDealStatus status = 3;
|
|
294
|
+
repeated ExchangeDealAction allowed_actions = 4;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
message GetExchangeDealStatesByCalculationIdsResponse {
|
|
298
|
+
repeated ExchangeDealStateByCalculation items = 1;
|
|
299
|
+
repeated string not_found_calculation_ids = 2;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
message GetTransactionsRequest {
|
|
303
|
+
optional string start_date = 1;
|
|
304
|
+
optional string end_date = 2;
|
|
305
|
+
optional int32 user_id = 3;
|
|
306
|
+
optional int32 currency_id = 4;
|
|
307
|
+
optional int32 wallet_id = 5;
|
|
308
|
+
optional int32 type = 6;
|
|
309
|
+
optional int32 account_type = 7;
|
|
310
|
+
optional int32 category_id = 8;
|
|
311
|
+
optional int32 business_unit_id = 9;
|
|
312
|
+
optional string search = 10;
|
|
313
|
+
optional int32 page = 11;
|
|
314
|
+
optional int32 page_size = 12;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
message GetTransactionsSummaryItem {
|
|
318
|
+
string currency = 1;
|
|
319
|
+
double total_income = 2;
|
|
320
|
+
double total_expense = 3;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
message GetTransactionsItem {
|
|
324
|
+
int32 id = 1;
|
|
325
|
+
string transaction_datetime = 2;
|
|
326
|
+
string created_at = 3;
|
|
327
|
+
double amount = 4;
|
|
328
|
+
optional string currency = 5;
|
|
329
|
+
optional double usdt_amount = 6;
|
|
330
|
+
bool status = 7;
|
|
331
|
+
optional int32 wallet_id = 8;
|
|
332
|
+
optional string wallet_name = 9;
|
|
333
|
+
optional int32 move_wallet_id = 10;
|
|
334
|
+
optional string move_wallet_name = 11;
|
|
335
|
+
int32 type = 12;
|
|
336
|
+
optional string type_name = 13;
|
|
337
|
+
optional int32 category_id = 14;
|
|
338
|
+
optional string category_name = 15;
|
|
339
|
+
optional int32 business_unit_id = 16;
|
|
340
|
+
optional string business_unit_name = 17;
|
|
341
|
+
string name = 18;
|
|
342
|
+
optional string comment = 19;
|
|
343
|
+
optional int32 exchange_id = 20;
|
|
344
|
+
optional string exchange_url = 21;
|
|
345
|
+
optional int32 user_id = 22;
|
|
346
|
+
optional string username = 23;
|
|
347
|
+
int32 account_type = 24;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
message GetTransactionsResponse {
|
|
351
|
+
int32 count = 1;
|
|
352
|
+
optional string next = 2;
|
|
353
|
+
optional string previous = 3;
|
|
354
|
+
repeated GetTransactionsItem results = 4;
|
|
355
|
+
repeated GetTransactionsSummaryItem summary = 5;
|
|
356
|
+
}
|