@aepstore-dev/contracts 1.61.0 → 1.63.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
@@ -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.0
5
+ // protoc v7.35.1
6
6
  // source: payments.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PAYMENTS_SERVICE_NAME = exports.PAYMENTS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
@@ -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
@@ -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.0
4
+ // protoc v7.35.1
5
5
  // source: payments.proto
6
6
 
7
7
  /* eslint-disable */
@@ -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,27 @@ 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
+ /**
81
+ * Converted final_price display amounts by currency (RUB/USD/EUR).
82
+ * Not persisted; computed from the cached payments-service FX rates.
83
+ */
84
+ prices: {
85
+ [key: string]: string;
86
+ };
80
87
  /** double as string for consistency */
81
88
  averageRating: string;
82
89
  status: ProductStatus;
90
+ /**
91
+ * Listing currency the seller priced in: RUB | USD | EUR (default RUB).
92
+ * Settlement/ledger is always RUB — conversion is snapshotted at checkout.
93
+ */
94
+ currency: string;
83
95
  /** null while DRAFT / not yet submitted */
84
96
  moderation: ProductModeration | undefined;
85
97
  createdAt: string;
@@ -116,6 +128,10 @@ export interface Product {
116
128
  */
117
129
  attachments: ProductAttachment[];
118
130
  }
131
+ export interface Product_PricesEntry {
132
+ key: string;
133
+ value: string;
134
+ }
119
135
  export interface ProductAttachment {
120
136
  id: string;
121
137
  fileName: string;
@@ -134,6 +150,16 @@ export interface RelatedProduct {
134
150
  preview: string;
135
151
  user: ProductUser | undefined;
136
152
  categories: Category[];
153
+ /** RUB | USD | EUR */
154
+ currency: string;
155
+ /** Converted final_price display amounts. */
156
+ prices: {
157
+ [key: string]: string;
158
+ };
159
+ }
160
+ export interface RelatedProduct_PricesEntry {
161
+ key: string;
162
+ value: string;
137
163
  }
138
164
  export interface ProductResponse {
139
165
  product: Product | undefined;
@@ -170,6 +196,8 @@ export interface CreateProductRequest {
170
196
  video: string;
171
197
  description: string;
172
198
  status: ProductStatus;
199
+ /** RUB | USD | EUR; empty → RUB */
200
+ currency: string;
173
201
  }
174
202
  export interface UpdateProductRequest {
175
203
  userId: string;
@@ -182,6 +210,8 @@ export interface UpdateProductRequest {
182
210
  tags: string[];
183
211
  categoryIds: string[];
184
212
  applicationIds: string[];
213
+ /** RUB | USD | EUR; empty → no change */
214
+ currency: string;
185
215
  }
186
216
  export interface QueryProductsRequest {
187
217
  search: string;
package/gen/products.ts CHANGED
@@ -91,15 +91,25 @@ 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
+ /**
101
+ * Converted final_price display amounts by currency (RUB/USD/EUR).
102
+ * Not persisted; computed from the cached payments-service FX rates.
103
+ */
104
+ prices: { [key: string]: string };
100
105
  /** double as string for consistency */
101
106
  averageRating: string;
102
107
  status: ProductStatus;
108
+ /**
109
+ * Listing currency the seller priced in: RUB | USD | EUR (default RUB).
110
+ * Settlement/ledger is always RUB — conversion is snapshotted at checkout.
111
+ */
112
+ currency: string;
103
113
  /** null while DRAFT / not yet submitted */
104
114
  moderation: ProductModeration | undefined;
105
115
  createdAt: string;
@@ -137,6 +147,11 @@ export interface Product {
137
147
  attachments: ProductAttachment[];
138
148
  }
139
149
 
150
+ export interface Product_PricesEntry {
151
+ key: string;
152
+ value: string;
153
+ }
154
+
140
155
  export interface ProductAttachment {
141
156
  id: string;
142
157
  fileName: string;
@@ -156,6 +171,15 @@ export interface RelatedProduct {
156
171
  preview: string;
157
172
  user: ProductUser | undefined;
158
173
  categories: Category[];
174
+ /** RUB | USD | EUR */
175
+ currency: string;
176
+ /** Converted final_price display amounts. */
177
+ prices: { [key: string]: string };
178
+ }
179
+
180
+ export interface RelatedProduct_PricesEntry {
181
+ key: string;
182
+ value: string;
159
183
  }
160
184
 
161
185
  export interface ProductResponse {
@@ -200,6 +224,8 @@ export interface CreateProductRequest {
200
224
  video: string;
201
225
  description: string;
202
226
  status: ProductStatus;
227
+ /** RUB | USD | EUR; empty → RUB */
228
+ currency: string;
203
229
  }
204
230
 
205
231
  export interface UpdateProductRequest {
@@ -213,6 +239,8 @@ export interface UpdateProductRequest {
213
239
  tags: string[];
214
240
  categoryIds: string[];
215
241
  applicationIds: string[];
242
+ /** RUB | USD | EUR; empty → no change */
243
+ currency: string;
216
244
  }
217
245
 
218
246
  export interface QueryProductsRequest {
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "@aepstore-dev/contracts",
3
- "version": "1.61.0",
4
- "description": "Protobuf definitions for aepstore microservices",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "scripts": {
8
- "generate": "node scripts/generate.cjs",
9
- "build": "tsc -p tsconfig.build.json && tsc -p tsconfig.gen.json"
10
- },
11
- "files": [
12
- "dist",
13
- "proto",
14
- "gen"
15
- ],
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "author": {
20
- "name": "torroixq",
21
- "email": "cato.ixq@gmail.com"
22
- },
23
- "peerDependencies": {
24
- "@nestjs/microservices": "^11.1.11",
25
- "rxjs": "^7.8.2"
26
- },
27
- "devDependencies": {
28
- "@nestjs/microservices": "^11.1.11",
29
- "@protobuf-ts/protoc": "^2.9.4",
30
- "@types/node": "^25.0.3",
31
- "rxjs": "^7.8.2",
32
- "ts-proto": "^2.10.1",
33
- "typescript": "^5.9.3"
34
- }
35
- }
1
+ {
2
+ "name": "@aepstore-dev/contracts",
3
+ "version": "1.63.0",
4
+ "description": "Protobuf definitions for aepstore microservices",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "generate": "node scripts/generate.cjs",
9
+ "build": "tsc -p tsconfig.build.json && tsc -p tsconfig.gen.json"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "proto",
14
+ "gen"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "author": {
20
+ "name": "torroixq",
21
+ "email": "cato.ixq@gmail.com"
22
+ },
23
+ "peerDependencies": {
24
+ "@nestjs/microservices": "^11.1.11",
25
+ "rxjs": "^7.8.2"
26
+ },
27
+ "devDependencies": {
28
+ "@nestjs/microservices": "^11.1.11",
29
+ "@protobuf-ts/protoc": "^2.9.4",
30
+ "@types/node": "^25.0.3",
31
+ "rxjs": "^7.8.2",
32
+ "ts-proto": "^2.10.1",
33
+ "typescript": "^5.9.3"
34
+ }
35
+ }