@arbiwallet/contracts 1.0.273 → 1.0.274

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.
@@ -336,6 +336,15 @@ export interface CancelExchangeDealResponse {
336
336
  validationErrors?: { [key: string]: any } | undefined;
337
337
  }
338
338
 
339
+ export interface GetUserIdsWithDealsInPeriodRequest {
340
+ dateFrom?: string | undefined;
341
+ dateTo?: string | undefined;
342
+ }
343
+
344
+ export interface GetUserIdsWithDealsInPeriodResponse {
345
+ userIds: number[];
346
+ }
347
+
339
348
  export interface ExchangeCalculationsFiltersRequest {
340
349
  dateFrom?: string | undefined;
341
350
  dateTo?: string | undefined;
@@ -613,6 +622,10 @@ export interface ExchangeCoreServiceClient {
613
622
 
614
623
  cancelExchangeDeal(request: CancelExchangeDealRequest): Observable<CancelExchangeDealResponse>;
615
624
 
625
+ getUserIdsWithDealsInPeriod(
626
+ request: GetUserIdsWithDealsInPeriodRequest,
627
+ ): Observable<GetUserIdsWithDealsInPeriodResponse>;
628
+
616
629
  createExchangePayment(request: CreateExchangePaymentRequest): Observable<CreateExchangePaymentResponse>;
617
630
 
618
631
  handlePaymentWebhook(request: HandlePaymentWebhookRequest): Observable<HandlePaymentWebhookResponse>;
@@ -685,6 +698,13 @@ export interface ExchangeCoreServiceController {
685
698
  request: CancelExchangeDealRequest,
686
699
  ): Promise<CancelExchangeDealResponse> | Observable<CancelExchangeDealResponse> | CancelExchangeDealResponse;
687
700
 
701
+ getUserIdsWithDealsInPeriod(
702
+ request: GetUserIdsWithDealsInPeriodRequest,
703
+ ):
704
+ | Promise<GetUserIdsWithDealsInPeriodResponse>
705
+ | Observable<GetUserIdsWithDealsInPeriodResponse>
706
+ | GetUserIdsWithDealsInPeriodResponse;
707
+
688
708
  createExchangePayment(
689
709
  request: CreateExchangePaymentRequest,
690
710
  ): Promise<CreateExchangePaymentResponse> | Observable<CreateExchangePaymentResponse> | CreateExchangePaymentResponse;
@@ -746,6 +766,7 @@ export function ExchangeCoreServiceControllerMethods() {
746
766
  "updateExchangeDeal",
747
767
  "completeExchangeDeal",
748
768
  "cancelExchangeDeal",
769
+ "getUserIdsWithDealsInPeriod",
749
770
  "createExchangePayment",
750
771
  "handlePaymentWebhook",
751
772
  "getExchangePayments",
package/gen/user.ts CHANGED
@@ -67,6 +67,20 @@ export interface UserResponse {
67
67
  cardFirstName?: string | undefined;
68
68
  cardLastName?: string | undefined;
69
69
  crmCustomerId?: number | undefined;
70
+ referrerUserId?: number | undefined;
71
+ refPercent?: number | undefined;
72
+ referralVolume?: number | undefined;
73
+ exchangesCount?: number | undefined;
74
+ exchangeCountLastYear?: number | undefined;
75
+ totalAmount?: number | undefined;
76
+ avgCheck?: number | undefined;
77
+ firstExchangeAt?: string | undefined;
78
+ lastExchangeAt?: string | undefined;
79
+ lifePeriod?: number | undefined;
80
+ lifePeriodYear?: number | undefined;
81
+ frequency?: number | undefined;
82
+ ltv?: number | undefined;
83
+ userSearchUpdatedAt?: string | undefined;
70
84
  }
71
85
 
72
86
  export interface UpdateUserRequest {
@@ -91,6 +105,16 @@ export interface ListUsersRequest {
91
105
  search?: string | undefined;
92
106
  statusValue?: UserStatus | undefined;
93
107
  registrationTypeValue?: string | undefined;
108
+ sources: string[];
109
+ tags: string[];
110
+ referrerUserId?: number | undefined;
111
+ registrationFrom?: string | undefined;
112
+ registrationTo?: string | undefined;
113
+ dealFrom?: string | undefined;
114
+ dealTo?: string | undefined;
115
+ lastDealFrom?: string | undefined;
116
+ lastDealTo?: string | undefined;
117
+ sort?: string | undefined;
94
118
  }
95
119
 
96
120
  export interface ListUsersResponse {
@@ -100,6 +124,39 @@ export interface ListUsersResponse {
100
124
  limit: number;
101
125
  }
102
126
 
127
+ export interface UserSearchExchangeStats {
128
+ exchangesCount: number;
129
+ exchangeCountLastYear: number;
130
+ totalAmount: number;
131
+ avgCheck: number;
132
+ firstExchangeAt?: string | undefined;
133
+ lastExchangeAt?: string | undefined;
134
+ lifePeriod?: number | undefined;
135
+ lifePeriodYear?: number | undefined;
136
+ frequency?: number | undefined;
137
+ ltv?: number | undefined;
138
+ }
139
+
140
+ export interface UserSearchReferralStats {
141
+ referrerUserId?: number | undefined;
142
+ refPercent?: number | undefined;
143
+ referralVolume: number;
144
+ }
145
+
146
+ export interface UserSearchStatsUpdate {
147
+ userId: number;
148
+ exchangeStats: UserSearchExchangeStats | undefined;
149
+ referralStats: UserSearchReferralStats | undefined;
150
+ }
151
+
152
+ export interface UpdateUserSearchStatsRequest {
153
+ items: UserSearchStatsUpdate[];
154
+ }
155
+
156
+ export interface UpdateUserSearchStatsResponse {
157
+ updatedCount: number;
158
+ }
159
+
103
160
  export interface GetUserFullNamesByIdsRequest {
104
161
  userIds: number[];
105
162
  }
@@ -518,6 +575,8 @@ export interface UserServiceClient {
518
575
 
519
576
  listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
520
577
 
578
+ updateUserSearchStats(request: UpdateUserSearchStatsRequest): Observable<UpdateUserSearchStatsResponse>;
579
+
521
580
  /** Батч-резолв полных имен пользователей по их id (для enrichment в других сервисах). */
522
581
 
523
582
  getUserFullNamesByIds(request: GetUserFullNamesByIdsRequest): Observable<GetUserFullNamesByIdsResponse>;
@@ -652,6 +711,10 @@ export interface UserServiceController {
652
711
 
653
712
  listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
654
713
 
714
+ updateUserSearchStats(
715
+ request: UpdateUserSearchStatsRequest,
716
+ ): Promise<UpdateUserSearchStatsResponse> | Observable<UpdateUserSearchStatsResponse> | UpdateUserSearchStatsResponse;
717
+
655
718
  /** Батч-резолв полных имен пользователей по их id (для enrichment в других сервисах). */
656
719
 
657
720
  getUserFullNamesByIds(
@@ -886,6 +949,7 @@ export function UserServiceControllerMethods() {
886
949
  "updateUser",
887
950
  "updateUserStatus",
888
951
  "listUsers",
952
+ "updateUserSearchStats",
889
953
  "getUserFullNamesByIds",
890
954
  "resolveUserForTransfer",
891
955
  "getCrmSession",
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.273",
4
+ "version": "1.0.274",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -20,6 +20,7 @@ service ExchangeCoreService {
20
20
  rpc UpdateExchangeDeal(UpdateExchangeDealRequest) returns (UpdateExchangeDealResponse);
21
21
  rpc CompleteExchangeDeal(CompleteExchangeDealRequest) returns (CompleteExchangeDealResponse);
22
22
  rpc CancelExchangeDeal(CancelExchangeDealRequest) returns (CancelExchangeDealResponse);
23
+ rpc GetUserIdsWithDealsInPeriod(GetUserIdsWithDealsInPeriodRequest) returns (GetUserIdsWithDealsInPeriodResponse);
23
24
 
24
25
  rpc CreateExchangePayment(CreateExchangePaymentRequest) returns (CreateExchangePaymentResponse);
25
26
  rpc HandlePaymentWebhook(HandlePaymentWebhookRequest) returns (HandlePaymentWebhookResponse);
@@ -381,6 +382,15 @@ message CancelExchangeDealResponse {
381
382
  optional google.protobuf.Struct validationErrors = 4;
382
383
  }
383
384
 
385
+ message GetUserIdsWithDealsInPeriodRequest {
386
+ optional string date_from = 1;
387
+ optional string date_to = 2;
388
+ }
389
+
390
+ message GetUserIdsWithDealsInPeriodResponse {
391
+ repeated int32 user_ids = 1;
392
+ }
393
+
384
394
  message ExchangeCalculationsFiltersRequest {
385
395
  optional string date_from = 1;
386
396
  optional string date_to = 2;
package/proto/user.proto CHANGED
@@ -6,6 +6,7 @@ service UserService {
6
6
  rpc UpdateUser (UpdateUserRequest) returns (UserResponse);
7
7
  rpc UpdateUserStatus (UpdateUserStatusRequest) returns (UserResponse);
8
8
  rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
9
+ rpc UpdateUserSearchStats (UpdateUserSearchStatsRequest) returns (UpdateUserSearchStatsResponse);
9
10
  // Батч-резолв полных имен пользователей по их id (для enrichment в других сервисах).
10
11
  rpc GetUserFullNamesByIds (GetUserFullNamesByIdsRequest) returns (GetUserFullNamesByIdsResponse);
11
12
  // Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода.
@@ -107,6 +108,20 @@ message UserResponse {
107
108
  optional string card_first_name = 20;
108
109
  optional string card_last_name = 21;
109
110
  optional int32 crm_customer_id = 22;
111
+ optional int32 referrer_user_id = 23;
112
+ optional double ref_percent = 24;
113
+ optional double referral_volume = 25;
114
+ optional int32 exchanges_count = 26;
115
+ optional int32 exchange_count_last_year = 27;
116
+ optional double total_amount = 28;
117
+ optional double avg_check = 29;
118
+ optional string first_exchange_at = 30;
119
+ optional string last_exchange_at = 31;
120
+ optional double life_period = 32;
121
+ optional double life_period_year = 33;
122
+ optional double frequency = 34;
123
+ optional double ltv = 35;
124
+ optional string user_search_updated_at = 36;
110
125
  }
111
126
 
112
127
  message UpdateUserRequest {
@@ -142,6 +157,16 @@ message ListUsersRequest {
142
157
  optional string search = 5;
143
158
  optional UserStatus status_value = 6;
144
159
  optional string registration_type_value = 7;
160
+ repeated string sources = 8;
161
+ repeated string tags = 9;
162
+ optional int32 referrer_user_id = 10;
163
+ optional string registration_from = 11;
164
+ optional string registration_to = 12;
165
+ optional string deal_from = 13;
166
+ optional string deal_to = 14;
167
+ optional string last_deal_from = 15;
168
+ optional string last_deal_to = 16;
169
+ optional string sort = 17;
145
170
  }
146
171
 
147
172
  message ListUsersResponse {
@@ -151,6 +176,39 @@ message ListUsersResponse {
151
176
  int32 limit = 4;
152
177
  }
153
178
 
179
+ message UserSearchExchangeStats {
180
+ int32 exchanges_count = 1;
181
+ int32 exchange_count_last_year = 2;
182
+ double total_amount = 3;
183
+ double avg_check = 4;
184
+ optional string first_exchange_at = 5;
185
+ optional string last_exchange_at = 6;
186
+ optional double life_period = 7;
187
+ optional double life_period_year = 8;
188
+ optional double frequency = 9;
189
+ optional double ltv = 10;
190
+ }
191
+
192
+ message UserSearchReferralStats {
193
+ optional int32 referrer_user_id = 1;
194
+ optional double ref_percent = 2;
195
+ double referral_volume = 3;
196
+ }
197
+
198
+ message UserSearchStatsUpdate {
199
+ int32 user_id = 1;
200
+ UserSearchExchangeStats exchange_stats = 2;
201
+ UserSearchReferralStats referral_stats = 3;
202
+ }
203
+
204
+ message UpdateUserSearchStatsRequest {
205
+ repeated UserSearchStatsUpdate items = 1;
206
+ }
207
+
208
+ message UpdateUserSearchStatsResponse {
209
+ int32 updated_count = 1;
210
+ }
211
+
154
212
  message GetUserFullNamesByIdsRequest {
155
213
  repeated int32 user_ids = 1;
156
214
  }