@aepstore-dev/contracts 1.61.0 → 1.62.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/gen/payments.d.ts CHANGED
@@ -13,16 +13,23 @@ export interface Purchase {
13
13
  productId: string;
14
14
  productName: string;
15
15
  userId: string;
16
+ /** settled RUB amount */
16
17
  price: string;
17
18
  /** PENDING | COMPLETED | FAILED | REFUNDED */
18
19
  status: string;
19
20
  paymentId: string;
20
- /** BALANCE | YOOKASSA */
21
+ /** BALANCE | YOOKASSA | CRYPTO */
21
22
  paymentMethod: string;
22
23
  commissionPercent: string;
23
24
  sellerAmount: string;
24
25
  createdAt: string;
25
26
  completedAt: string;
27
+ /** FX snapshot at checkout (empty for legacy RUB purchases). */
28
+ listingCurrency: string;
29
+ /** Decimal as string, in listing_currency */
30
+ listingPrice: string;
31
+ /** listing→RUB rate used (Decimal as string) */
32
+ fxRate: string;
26
33
  }
27
34
  export interface TopupRequest {
28
35
  userId: string;
@@ -37,7 +44,7 @@ export interface TopupRequest {
37
44
  export interface CreateCheckoutRequest {
38
45
  userId: string;
39
46
  productId: string;
40
- /** BALANCE | YOOKASSA | SAVED_CARD (default YOOKASSA) */
47
+ /** BALANCE | YOOKASSA | SAVED_CARD | CRYPTO (default YOOKASSA) */
41
48
  paymentMethod: string;
42
49
  returnUrl: string;
43
50
  /**
@@ -277,6 +284,38 @@ export interface ProviderCallbackRequest {
277
284
  /** exact raw JSON body as received (signature input) */
278
285
  rawBody: string;
279
286
  }
287
+ /**
288
+ * ---------------------------------------------------------------------------
289
+ * FX rates / payment methods
290
+ * ---------------------------------------------------------------------------
291
+ */
292
+ export interface GetRatesRequest {
293
+ }
294
+ export interface FxRate {
295
+ /** USD | EUR */
296
+ currency: string;
297
+ /** RUB per 1 unit, Decimal as string */
298
+ rate: string;
299
+ }
300
+ export interface GetRatesResponse {
301
+ /** always RUB */
302
+ base: string;
303
+ /** YYYY-MM-DD the rates are for */
304
+ asOf: string;
305
+ rates: FxRate[];
306
+ }
307
+ export interface GetPaymentMethodsRequest {
308
+ }
309
+ export interface PaymentMethodInfo {
310
+ /** YOOKASSA | SAVED_CARD | CRYPTO | BALANCE */
311
+ method: string;
312
+ /** yookassa | heleket | '' (BALANCE) */
313
+ provider: string;
314
+ currencies: string[];
315
+ }
316
+ export interface GetPaymentMethodsResponse {
317
+ methods: PaymentMethodInfo[];
318
+ }
280
319
  /**
281
320
  * ---------------------------------------------------------------------------
282
321
  * Admin
@@ -624,6 +663,18 @@ export interface PaymentsServiceClient {
624
663
  * completion. Ownership-checked by user_id.
625
664
  */
626
665
  getPaymentIntent(request: GetPaymentIntentRequest): Observable<PaymentIntentStatus>;
666
+ /**
667
+ * ----- FX / available methods (public, cached) -----
668
+ * Daily CBR rates (RUB base). Frontend uses this for the "≈" display hint;
669
+ * the authoritative charge amount is always computed server-side at checkout.
670
+ */
671
+ getRates(request: GetRatesRequest): Observable<GetRatesResponse>;
672
+ /**
673
+ * Payment methods derived from live provider capabilities — the client
674
+ * renders only what is actually available (e.g. CRYPTO appears once the
675
+ * Heleket merchant is configured).
676
+ */
677
+ getPaymentMethods(request: GetPaymentMethodsRequest): Observable<GetPaymentMethodsResponse>;
627
678
  /** ----- payout details ----- */
628
679
  updatePayoutDetails(request: UpdatePayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
629
680
  getPayoutDetails(request: GetPayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
@@ -694,6 +745,18 @@ export interface PaymentsServiceController {
694
745
  * completion. Ownership-checked by user_id.
695
746
  */
696
747
  getPaymentIntent(request: GetPaymentIntentRequest): Promise<PaymentIntentStatus> | Observable<PaymentIntentStatus> | PaymentIntentStatus;
748
+ /**
749
+ * ----- FX / available methods (public, cached) -----
750
+ * Daily CBR rates (RUB base). Frontend uses this for the "≈" display hint;
751
+ * the authoritative charge amount is always computed server-side at checkout.
752
+ */
753
+ getRates(request: GetRatesRequest): Promise<GetRatesResponse> | Observable<GetRatesResponse> | GetRatesResponse;
754
+ /**
755
+ * Payment methods derived from live provider capabilities — the client
756
+ * renders only what is actually available (e.g. CRYPTO appears once the
757
+ * Heleket merchant is configured).
758
+ */
759
+ getPaymentMethods(request: GetPaymentMethodsRequest): Promise<GetPaymentMethodsResponse> | Observable<GetPaymentMethodsResponse> | GetPaymentMethodsResponse;
697
760
  /** ----- payout details ----- */
698
761
  updatePayoutDetails(request: UpdatePayoutDetailsRequest): Promise<UpdatePayoutDetailsResponse> | Observable<UpdatePayoutDetailsResponse> | UpdatePayoutDetailsResponse;
699
762
  getPayoutDetails(request: GetPayoutDetailsRequest): Promise<UpdatePayoutDetailsResponse> | Observable<UpdatePayoutDetailsResponse> | UpdatePayoutDetailsResponse;
package/gen/payments.js CHANGED
@@ -40,6 +40,8 @@ function PaymentsServiceControllerMethods() {
40
40
  "updateSavedCard",
41
41
  "bindCard",
42
42
  "getPaymentIntent",
43
+ "getRates",
44
+ "getPaymentMethods",
43
45
  "updatePayoutDetails",
44
46
  "getPayoutDetails",
45
47
  "getAdminOverview",
package/gen/payments.ts CHANGED
@@ -24,16 +24,23 @@ export interface Purchase {
24
24
  productId: string;
25
25
  productName: string;
26
26
  userId: string;
27
+ /** settled RUB amount */
27
28
  price: string;
28
29
  /** PENDING | COMPLETED | FAILED | REFUNDED */
29
30
  status: string;
30
31
  paymentId: string;
31
- /** BALANCE | YOOKASSA */
32
+ /** BALANCE | YOOKASSA | CRYPTO */
32
33
  paymentMethod: string;
33
34
  commissionPercent: string;
34
35
  sellerAmount: string;
35
36
  createdAt: string;
36
37
  completedAt: string;
38
+ /** FX snapshot at checkout (empty for legacy RUB purchases). */
39
+ listingCurrency: string;
40
+ /** Decimal as string, in listing_currency */
41
+ listingPrice: string;
42
+ /** listing→RUB rate used (Decimal as string) */
43
+ fxRate: string;
37
44
  }
38
45
 
39
46
  export interface TopupRequest {
@@ -50,7 +57,7 @@ export interface TopupRequest {
50
57
  export interface CreateCheckoutRequest {
51
58
  userId: string;
52
59
  productId: string;
53
- /** BALANCE | YOOKASSA | SAVED_CARD (default YOOKASSA) */
60
+ /** BALANCE | YOOKASSA | SAVED_CARD | CRYPTO (default YOOKASSA) */
54
61
  paymentMethod: string;
55
62
  returnUrl: string;
56
63
  /**
@@ -313,6 +320,44 @@ export interface ProviderCallbackRequest {
313
320
  rawBody: string;
314
321
  }
315
322
 
323
+ /**
324
+ * ---------------------------------------------------------------------------
325
+ * FX rates / payment methods
326
+ * ---------------------------------------------------------------------------
327
+ */
328
+ export interface GetRatesRequest {
329
+ }
330
+
331
+ export interface FxRate {
332
+ /** USD | EUR */
333
+ currency: string;
334
+ /** RUB per 1 unit, Decimal as string */
335
+ rate: string;
336
+ }
337
+
338
+ export interface GetRatesResponse {
339
+ /** always RUB */
340
+ base: string;
341
+ /** YYYY-MM-DD the rates are for */
342
+ asOf: string;
343
+ rates: FxRate[];
344
+ }
345
+
346
+ export interface GetPaymentMethodsRequest {
347
+ }
348
+
349
+ export interface PaymentMethodInfo {
350
+ /** YOOKASSA | SAVED_CARD | CRYPTO | BALANCE */
351
+ method: string;
352
+ /** yookassa | heleket | '' (BALANCE) */
353
+ provider: string;
354
+ currencies: string[];
355
+ }
356
+
357
+ export interface GetPaymentMethodsResponse {
358
+ methods: PaymentMethodInfo[];
359
+ }
360
+
316
361
  /**
317
362
  * ---------------------------------------------------------------------------
318
363
  * Admin
@@ -739,6 +784,22 @@ export interface PaymentsServiceClient {
739
784
 
740
785
  getPaymentIntent(request: GetPaymentIntentRequest): Observable<PaymentIntentStatus>;
741
786
 
787
+ /**
788
+ * ----- FX / available methods (public, cached) -----
789
+ * Daily CBR rates (RUB base). Frontend uses this for the "≈" display hint;
790
+ * the authoritative charge amount is always computed server-side at checkout.
791
+ */
792
+
793
+ getRates(request: GetRatesRequest): Observable<GetRatesResponse>;
794
+
795
+ /**
796
+ * Payment methods derived from live provider capabilities — the client
797
+ * renders only what is actually available (e.g. CRYPTO appears once the
798
+ * Heleket merchant is configured).
799
+ */
800
+
801
+ getPaymentMethods(request: GetPaymentMethodsRequest): Observable<GetPaymentMethodsResponse>;
802
+
742
803
  /** ----- payout details ----- */
743
804
 
744
805
  updatePayoutDetails(request: UpdatePayoutDetailsRequest): Observable<UpdatePayoutDetailsResponse>;
@@ -884,6 +945,24 @@ export interface PaymentsServiceController {
884
945
  request: GetPaymentIntentRequest,
885
946
  ): Promise<PaymentIntentStatus> | Observable<PaymentIntentStatus> | PaymentIntentStatus;
886
947
 
948
+ /**
949
+ * ----- FX / available methods (public, cached) -----
950
+ * Daily CBR rates (RUB base). Frontend uses this for the "≈" display hint;
951
+ * the authoritative charge amount is always computed server-side at checkout.
952
+ */
953
+
954
+ getRates(request: GetRatesRequest): Promise<GetRatesResponse> | Observable<GetRatesResponse> | GetRatesResponse;
955
+
956
+ /**
957
+ * Payment methods derived from live provider capabilities — the client
958
+ * renders only what is actually available (e.g. CRYPTO appears once the
959
+ * Heleket merchant is configured).
960
+ */
961
+
962
+ getPaymentMethods(
963
+ request: GetPaymentMethodsRequest,
964
+ ): Promise<GetPaymentMethodsResponse> | Observable<GetPaymentMethodsResponse> | GetPaymentMethodsResponse;
965
+
887
966
  /** ----- payout details ----- */
888
967
 
889
968
  updatePayoutDetails(
@@ -944,6 +1023,8 @@ export function PaymentsServiceControllerMethods() {
944
1023
  "updateSavedCard",
945
1024
  "bindCard",
946
1025
  "getPaymentIntent",
1026
+ "getRates",
1027
+ "getPaymentMethods",
947
1028
  "updatePayoutDetails",
948
1029
  "getPayoutDetails",
949
1030
  "getAdminOverview",
package/gen/products.d.ts CHANGED
@@ -71,15 +71,20 @@ export interface Product {
71
71
  id: string;
72
72
  name: string;
73
73
  description: string;
74
- /** Decimal as string (D7) */
74
+ /** Decimal as string (D7), in `currency` */
75
75
  price: string;
76
76
  /** Decimal as string */
77
77
  discountPercent: string;
78
- /** Decimal as string */
78
+ /** Decimal as string, in `currency` */
79
79
  finalPrice: string;
80
80
  /** double as string for consistency */
81
81
  averageRating: string;
82
82
  status: ProductStatus;
83
+ /**
84
+ * Listing currency the seller priced in: RUB | USD | EUR (default RUB).
85
+ * Settlement/ledger is always RUB — conversion is snapshotted at checkout.
86
+ */
87
+ currency: string;
83
88
  /** null while DRAFT / not yet submitted */
84
89
  moderation: ProductModeration | undefined;
85
90
  createdAt: string;
@@ -170,6 +175,8 @@ export interface CreateProductRequest {
170
175
  video: string;
171
176
  description: string;
172
177
  status: ProductStatus;
178
+ /** RUB | USD | EUR; empty → RUB */
179
+ currency: string;
173
180
  }
174
181
  export interface UpdateProductRequest {
175
182
  userId: string;
@@ -182,6 +189,8 @@ export interface UpdateProductRequest {
182
189
  tags: string[];
183
190
  categoryIds: string[];
184
191
  applicationIds: string[];
192
+ /** RUB | USD | EUR; empty → no change */
193
+ currency: string;
185
194
  }
186
195
  export interface QueryProductsRequest {
187
196
  search: string;
package/gen/products.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.10.1
5
- // protoc v7.35.1
5
+ // protoc v7.35.0
6
6
  // source: products.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PRODUCTS_SERVICE_NAME = exports.PRODUCTS_V1_PACKAGE_NAME = exports.MediaType = exports.ModerationStatus = exports.ProductStatus = exports.protobufPackage = void 0;
package/gen/products.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v7.35.1
4
+ // protoc v7.35.0
5
5
  // source: products.proto
6
6
 
7
7
  /* eslint-disable */
@@ -91,15 +91,20 @@ export interface Product {
91
91
  id: string;
92
92
  name: string;
93
93
  description: string;
94
- /** Decimal as string (D7) */
94
+ /** Decimal as string (D7), in `currency` */
95
95
  price: string;
96
96
  /** Decimal as string */
97
97
  discountPercent: string;
98
- /** Decimal as string */
98
+ /** Decimal as string, in `currency` */
99
99
  finalPrice: string;
100
100
  /** double as string for consistency */
101
101
  averageRating: string;
102
102
  status: ProductStatus;
103
+ /**
104
+ * Listing currency the seller priced in: RUB | USD | EUR (default RUB).
105
+ * Settlement/ledger is always RUB — conversion is snapshotted at checkout.
106
+ */
107
+ currency: string;
103
108
  /** null while DRAFT / not yet submitted */
104
109
  moderation: ProductModeration | undefined;
105
110
  createdAt: string;
@@ -200,6 +205,8 @@ export interface CreateProductRequest {
200
205
  video: string;
201
206
  description: string;
202
207
  status: ProductStatus;
208
+ /** RUB | USD | EUR; empty → RUB */
209
+ currency: string;
203
210
  }
204
211
 
205
212
  export interface UpdateProductRequest {
@@ -213,6 +220,8 @@ export interface UpdateProductRequest {
213
220
  tags: string[];
214
221
  categoryIds: string[];
215
222
  applicationIds: string[];
223
+ /** RUB | USD | EUR; empty → no change */
224
+ currency: string;
216
225
  }
217
226
 
218
227
  export interface QueryProductsRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.61.0",
3
+ "version": "1.62.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -56,6 +56,15 @@ service PaymentsService {
56
56
  // completion. Ownership-checked by user_id.
57
57
  rpc GetPaymentIntent(GetPaymentIntentRequest) returns (PaymentIntentStatus);
58
58
 
59
+ // ----- FX / available methods (public, cached) -----
60
+ // Daily CBR rates (RUB base). Frontend uses this for the "≈" display hint;
61
+ // the authoritative charge amount is always computed server-side at checkout.
62
+ rpc GetRates(GetRatesRequest) returns (GetRatesResponse);
63
+ // Payment methods derived from live provider capabilities — the client
64
+ // renders only what is actually available (e.g. CRYPTO appears once the
65
+ // Heleket merchant is configured).
66
+ rpc GetPaymentMethods(GetPaymentMethodsRequest) returns (GetPaymentMethodsResponse);
67
+
59
68
  // ----- payout details -----
60
69
  rpc UpdatePayoutDetails(UpdatePayoutDetailsRequest) returns (UpdatePayoutDetailsResponse);
61
70
  rpc GetPayoutDetails(GetPayoutDetailsRequest) returns (UpdatePayoutDetailsResponse);
@@ -78,14 +87,18 @@ message Purchase {
78
87
  string product_id = 2;
79
88
  string product_name = 3;
80
89
  string user_id = 4;
81
- string price = 5;
90
+ string price = 5; // settled RUB amount
82
91
  string status = 6; // PENDING | COMPLETED | FAILED | REFUNDED
83
92
  string payment_id = 7;
84
- string payment_method = 8; // BALANCE | YOOKASSA
93
+ string payment_method = 8; // BALANCE | YOOKASSA | CRYPTO
85
94
  string commission_percent = 9;
86
95
  string seller_amount = 10;
87
96
  string created_at = 11;
88
97
  string completed_at = 12;
98
+ // FX snapshot at checkout (empty for legacy RUB purchases).
99
+ string listing_currency = 13; // RUB | USD | EUR
100
+ string listing_price = 14; // Decimal as string, in listing_currency
101
+ string fx_rate = 15; // listing→RUB rate used (Decimal as string)
89
102
  }
90
103
 
91
104
  message TopupRequest {
@@ -99,7 +112,7 @@ message TopupRequest {
99
112
  message CreateCheckoutRequest {
100
113
  string user_id = 1;
101
114
  string product_id = 2;
102
- string payment_method = 3; // BALANCE | YOOKASSA | SAVED_CARD (default YOOKASSA)
115
+ string payment_method = 3; // BALANCE | YOOKASSA | SAVED_CARD | CRYPTO (default YOOKASSA)
103
116
  string return_url = 4;
104
117
  // When payment_method=SAVED_CARD — required. ID of a SavedCard row owned
105
118
  // by user_id. Ignored otherwise.
@@ -257,6 +270,34 @@ message ProviderCallbackRequest {
257
270
  string raw_body = 2; // exact raw JSON body as received (signature input)
258
271
  }
259
272
 
273
+ // ---------------------------------------------------------------------------
274
+ // FX rates / payment methods
275
+ // ---------------------------------------------------------------------------
276
+ message GetRatesRequest {}
277
+
278
+ message FxRate {
279
+ string currency = 1; // USD | EUR
280
+ string rate = 2; // RUB per 1 unit, Decimal as string
281
+ }
282
+
283
+ message GetRatesResponse {
284
+ string base = 1; // always RUB
285
+ string as_of = 2; // YYYY-MM-DD the rates are for
286
+ repeated FxRate rates = 3;
287
+ }
288
+
289
+ message GetPaymentMethodsRequest {}
290
+
291
+ message PaymentMethodInfo {
292
+ string method = 1; // YOOKASSA | SAVED_CARD | CRYPTO | BALANCE
293
+ string provider = 2; // yookassa | heleket | '' (BALANCE)
294
+ repeated string currencies = 3;
295
+ }
296
+
297
+ message GetPaymentMethodsResponse {
298
+ repeated PaymentMethodInfo methods = 1;
299
+ }
300
+
260
301
  // ---------------------------------------------------------------------------
261
302
  // Admin
262
303
  // ---------------------------------------------------------------------------
@@ -116,11 +116,14 @@ message Product {
116
116
  string id = 1;
117
117
  string name = 2;
118
118
  string description = 3;
119
- string price = 4; // Decimal as string (D7)
119
+ string price = 4; // Decimal as string (D7), in `currency`
120
120
  string discount_percent = 5; // Decimal as string
121
- string final_price = 6; // Decimal as string
121
+ string final_price = 6; // Decimal as string, in `currency`
122
122
  string average_rating = 7; // double as string for consistency
123
123
  ProductStatus status = 8;
124
+ // Listing currency the seller priced in: RUB | USD | EUR (default RUB).
125
+ // Settlement/ledger is always RUB — conversion is snapshotted at checkout.
126
+ string currency = 35;
124
127
  ProductModeration moderation = 32; // null while DRAFT / not yet submitted
125
128
  string created_at = 13;
126
129
  string updated_at = 14;
@@ -213,6 +216,7 @@ message CreateProductRequest {
213
216
  string video = 9;
214
217
  string description = 10;
215
218
  ProductStatus status = 11;
219
+ string currency = 12; // RUB | USD | EUR; empty → RUB
216
220
  }
217
221
 
218
222
  message UpdateProductRequest {
@@ -226,6 +230,7 @@ message UpdateProductRequest {
226
230
  repeated string tags = 8;
227
231
  repeated string category_ids = 9;
228
232
  repeated string application_ids = 10;
233
+ string currency = 11; // RUB | USD | EUR; empty → no change
229
234
  }
230
235
 
231
236
  message QueryProductsRequest {