@mamindom/contracts 1.0.109 → 1.0.111

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.
@@ -466,6 +466,7 @@ export interface DeleteProductVariantRequest {
466
466
  export interface GetRelatedProductsRequest {
467
467
  productId: string;
468
468
  type?: RelatedProductType | undefined;
469
+ productSlug?: string | undefined;
469
470
  }
470
471
  export interface RelatedProductItem {
471
472
  productId: string;
@@ -22,6 +22,7 @@ export interface GetReviewsRequest {
22
22
  pagination: PaginationRequest | undefined;
23
23
  productId?: string | undefined;
24
24
  status?: ReviewStatus | undefined;
25
+ productSlug?: string | undefined;
25
26
  }
26
27
  export interface GetReviewsResponse {
27
28
  items: ReviewResponse[];
@@ -33,6 +34,7 @@ export interface CreateReviewRequest {
33
34
  authorEmail: string;
34
35
  body: string;
35
36
  rating: number;
37
+ productSlug?: string | undefined;
36
38
  }
37
39
  export interface ReviewIdRequest {
38
40
  id: string;
@@ -7,6 +7,11 @@ export declare enum DeliveryType {
7
7
  PICKUP = 3,
8
8
  UNRECOGNIZED = -1
9
9
  }
10
+ export declare enum Gender {
11
+ BOY = 0,
12
+ GIRL = 1,
13
+ UNRECOGNIZED = -1
14
+ }
10
15
  export interface GetMeRequest {
11
16
  id: string;
12
17
  }
@@ -151,6 +156,98 @@ export interface DeleteAccountRequest {
151
156
  export interface DeleteAccountResponse {
152
157
  ok: boolean;
153
158
  }
159
+ export interface Child {
160
+ id: string;
161
+ name: string;
162
+ birthDate: string;
163
+ gender: Gender;
164
+ }
165
+ export interface GetFamilyRequest {
166
+ userId: string;
167
+ }
168
+ export interface GetFamilyResponse {
169
+ children: Child[];
170
+ pregnancyWeek?: number | undefined;
171
+ }
172
+ export interface AddChildRequest {
173
+ userId: string;
174
+ name: string;
175
+ birthDate: string;
176
+ gender: Gender;
177
+ }
178
+ export interface UpdateChildRequest {
179
+ id: string;
180
+ userId: string;
181
+ name?: string | undefined;
182
+ birthDate?: string | undefined;
183
+ gender?: Gender | undefined;
184
+ }
185
+ export interface ChildResponse {
186
+ child: Child | undefined;
187
+ }
188
+ export interface RemoveChildRequest {
189
+ id: string;
190
+ userId: string;
191
+ }
192
+ export interface RemoveChildResponse {
193
+ ok: boolean;
194
+ }
195
+ export interface GetPregnancyRequest {
196
+ userId: string;
197
+ }
198
+ export interface GetPregnancyResponse {
199
+ week?: number | undefined;
200
+ }
201
+ export interface UpdatePregnancyRequest {
202
+ userId: string;
203
+ week: number;
204
+ }
205
+ export interface CartItemVariant {
206
+ key: string;
207
+ value: string;
208
+ }
209
+ export interface CartItemSnapshot {
210
+ nameUk: string;
211
+ nameRu: string;
212
+ price: number;
213
+ oldPrice?: number | undefined;
214
+ mainImage?: string | undefined;
215
+ slug: string;
216
+ categoryId?: string | undefined;
217
+ brandId?: string | undefined;
218
+ }
219
+ export interface CartItemDto {
220
+ cartKey: string;
221
+ productId: string;
222
+ quantity: number;
223
+ variants: CartItemVariant[];
224
+ snapshot: CartItemSnapshot | undefined;
225
+ snapshotJson: string;
226
+ }
227
+ export interface GetCartRequest {
228
+ userId: string;
229
+ }
230
+ export interface GetCartResponse {
231
+ items: CartItemDto[];
232
+ }
233
+ export interface UpsertCartItemRequest {
234
+ userId: string;
235
+ item: CartItemDto | undefined;
236
+ }
237
+ export interface RemoveCartItemRequest {
238
+ userId: string;
239
+ cartKey: string;
240
+ }
241
+ export interface ClearCartRequest {
242
+ userId: string;
243
+ }
244
+ export interface ClearCartResponse {
245
+ ok: boolean;
246
+ }
247
+ export interface SyncCartRequest {
248
+ userId: string;
249
+ items: CartItemDto[];
250
+ }
154
251
  export declare const USERS_V1_PACKAGE_NAME = "users.v1";
155
252
  export interface UsersServiceClient {
156
253
  getMe(request: GetMeRequest): Observable<GetMeResponse>;
@@ -169,6 +266,20 @@ export interface UsersServiceClient {
169
266
  clearViewedHistory(request: ClearViewedHistoryRequest): Observable<ClearViewedHistoryResponse>;
170
267
  exportUserData(request: ExportUserDataRequest): Observable<ExportUserDataResponse>;
171
268
  deleteAccount(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
269
+ /** Family */
270
+ getFamily(request: GetFamilyRequest): Observable<GetFamilyResponse>;
271
+ addChild(request: AddChildRequest): Observable<ChildResponse>;
272
+ updateChild(request: UpdateChildRequest): Observable<ChildResponse>;
273
+ removeChild(request: RemoveChildRequest): Observable<RemoveChildResponse>;
274
+ /** Pregnancy */
275
+ getPregnancy(request: GetPregnancyRequest): Observable<GetPregnancyResponse>;
276
+ updatePregnancy(request: UpdatePregnancyRequest): Observable<GetPregnancyResponse>;
277
+ /** Cart */
278
+ getCart(request: GetCartRequest): Observable<GetCartResponse>;
279
+ upsertCartItem(request: UpsertCartItemRequest): Observable<GetCartResponse>;
280
+ removeCartItem(request: RemoveCartItemRequest): Observable<GetCartResponse>;
281
+ clearCart(request: ClearCartRequest): Observable<ClearCartResponse>;
282
+ syncCart(request: SyncCartRequest): Observable<GetCartResponse>;
172
283
  }
173
284
  export interface UsersServiceController {
174
285
  getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
@@ -187,6 +298,20 @@ export interface UsersServiceController {
187
298
  clearViewedHistory(request: ClearViewedHistoryRequest): Promise<ClearViewedHistoryResponse> | Observable<ClearViewedHistoryResponse> | ClearViewedHistoryResponse;
188
299
  exportUserData(request: ExportUserDataRequest): Promise<ExportUserDataResponse> | Observable<ExportUserDataResponse> | ExportUserDataResponse;
189
300
  deleteAccount(request: DeleteAccountRequest): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
301
+ /** Family */
302
+ getFamily(request: GetFamilyRequest): Promise<GetFamilyResponse> | Observable<GetFamilyResponse> | GetFamilyResponse;
303
+ addChild(request: AddChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
304
+ updateChild(request: UpdateChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
305
+ removeChild(request: RemoveChildRequest): Promise<RemoveChildResponse> | Observable<RemoveChildResponse> | RemoveChildResponse;
306
+ /** Pregnancy */
307
+ getPregnancy(request: GetPregnancyRequest): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
308
+ updatePregnancy(request: UpdatePregnancyRequest): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
309
+ /** Cart */
310
+ getCart(request: GetCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
311
+ upsertCartItem(request: UpsertCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
312
+ removeCartItem(request: RemoveCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
313
+ clearCart(request: ClearCartRequest): Promise<ClearCartResponse> | Observable<ClearCartResponse> | ClearCartResponse;
314
+ syncCart(request: SyncCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
190
315
  }
191
316
  export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
192
317
  export declare const USERS_SERVICE_NAME = "UsersService";
package/dist/gen/users.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // protoc v3.21.12
6
6
  // source: users.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.DeliveryType = exports.protobufPackage = void 0;
8
+ exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.Gender = exports.DeliveryType = exports.protobufPackage = void 0;
9
9
  exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
@@ -18,6 +18,12 @@ var DeliveryType;
18
18
  DeliveryType[DeliveryType["PICKUP"] = 3] = "PICKUP";
19
19
  DeliveryType[DeliveryType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
20
  })(DeliveryType || (exports.DeliveryType = DeliveryType = {}));
21
+ var Gender;
22
+ (function (Gender) {
23
+ Gender[Gender["BOY"] = 0] = "BOY";
24
+ Gender[Gender["GIRL"] = 1] = "GIRL";
25
+ Gender[Gender["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(Gender || (exports.Gender = Gender = {}));
21
27
  exports.USERS_V1_PACKAGE_NAME = "users.v1";
22
28
  function UsersServiceControllerMethods() {
23
29
  return function (constructor) {
@@ -38,6 +44,17 @@ function UsersServiceControllerMethods() {
38
44
  "clearViewedHistory",
39
45
  "exportUserData",
40
46
  "deleteAccount",
47
+ "getFamily",
48
+ "addChild",
49
+ "updateChild",
50
+ "removeChild",
51
+ "getPregnancy",
52
+ "updatePregnancy",
53
+ "getCart",
54
+ "upsertCartItem",
55
+ "removeCartItem",
56
+ "clearCart",
57
+ "syncCart",
41
58
  ];
42
59
  for (const method of grpcMethods) {
43
60
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -425,8 +425,9 @@ enum RelatedProductType {
425
425
  }
426
426
 
427
427
  message GetRelatedProductsRequest {
428
- string product_id = 1;
429
- optional RelatedProductType type = 2;
428
+ string product_id = 1;
429
+ optional RelatedProductType type = 2;
430
+ optional string product_slug = 3;
430
431
  }
431
432
 
432
433
  message RelatedProductItem {
@@ -36,8 +36,9 @@ message ReviewResponse {
36
36
 
37
37
  message GetReviewsRequest {
38
38
  PaginationRequest pagination = 1;
39
- optional string product_id = 2;
40
- optional ReviewStatus status = 3;
39
+ optional string product_id = 2;
40
+ optional ReviewStatus status = 3;
41
+ optional string product_slug = 4;
41
42
  }
42
43
 
43
44
  message GetReviewsResponse {
@@ -47,11 +48,12 @@ message GetReviewsResponse {
47
48
 
48
49
 
49
50
  message CreateReviewRequest {
50
- string product_id = 1;
51
- string author_name = 2;
52
- string author_email = 3;
53
- string body = 4;
54
- int32 rating = 5;
51
+ string product_id = 1;
52
+ string author_name = 2;
53
+ string author_email = 3;
54
+ string body = 4;
55
+ int32 rating = 5;
56
+ optional string product_slug = 6;
55
57
  }
56
58
 
57
59
 
@@ -30,6 +30,23 @@ service UsersService {
30
30
 
31
31
  rpc ExportUserData(ExportUserDataRequest) returns (ExportUserDataResponse);
32
32
  rpc DeleteAccount(DeleteAccountRequest) returns (DeleteAccountResponse);
33
+
34
+ // Family
35
+ rpc GetFamily(GetFamilyRequest) returns (GetFamilyResponse);
36
+ rpc AddChild(AddChildRequest) returns (ChildResponse);
37
+ rpc UpdateChild(UpdateChildRequest) returns (ChildResponse);
38
+ rpc RemoveChild(RemoveChildRequest) returns (RemoveChildResponse);
39
+
40
+ // Pregnancy
41
+ rpc GetPregnancy(GetPregnancyRequest) returns (GetPregnancyResponse);
42
+ rpc UpdatePregnancy(UpdatePregnancyRequest) returns (GetPregnancyResponse);
43
+
44
+ // Cart
45
+ rpc GetCart(GetCartRequest) returns (GetCartResponse);
46
+ rpc UpsertCartItem(UpsertCartItemRequest) returns (GetCartResponse);
47
+ rpc RemoveCartItem(RemoveCartItemRequest) returns (GetCartResponse);
48
+ rpc ClearCart(ClearCartRequest) returns (ClearCartResponse);
49
+ rpc SyncCart(SyncCartRequest) returns (GetCartResponse);
33
50
  }
34
51
 
35
52
  message GetMeRequest {
@@ -214,4 +231,128 @@ message DeleteAccountRequest {
214
231
 
215
232
  message DeleteAccountResponse {
216
233
  bool ok = 1;
234
+ }
235
+
236
+ // ── Family ───────────────────────────────────────────────────────────────────
237
+
238
+ enum Gender {
239
+ BOY = 0;
240
+ GIRL = 1;
241
+ }
242
+
243
+ message Child {
244
+ string id = 1;
245
+ string name = 2;
246
+ string birth_date = 3;
247
+ Gender gender = 4;
248
+ }
249
+
250
+ message GetFamilyRequest {
251
+ string user_id = 1;
252
+ }
253
+
254
+ message GetFamilyResponse {
255
+ repeated Child children = 1;
256
+ optional int32 pregnancy_week = 2;
257
+ }
258
+
259
+ message AddChildRequest {
260
+ string user_id = 1;
261
+ string name = 2;
262
+ string birth_date = 3;
263
+ Gender gender = 4;
264
+ }
265
+
266
+ message UpdateChildRequest {
267
+ string id = 1;
268
+ string user_id = 2;
269
+ optional string name = 3;
270
+ optional string birth_date = 4;
271
+ optional Gender gender = 5;
272
+ }
273
+
274
+ message ChildResponse {
275
+ Child child = 1;
276
+ }
277
+
278
+ message RemoveChildRequest {
279
+ string id = 1;
280
+ string user_id = 2;
281
+ }
282
+
283
+ message RemoveChildResponse {
284
+ bool ok = 1;
285
+ }
286
+
287
+ // ── Pregnancy ────────────────────────────────────────────────────────────────
288
+
289
+ message GetPregnancyRequest {
290
+ string user_id = 1;
291
+ }
292
+
293
+ message GetPregnancyResponse {
294
+ optional int32 week = 1;
295
+ }
296
+
297
+ message UpdatePregnancyRequest {
298
+ string user_id = 1;
299
+ int32 week = 2;
300
+ }
301
+
302
+ // ── Cart ─────────────────────────────────────────────────────────────────────
303
+
304
+ message CartItemVariant {
305
+ string key = 1;
306
+ string value = 2;
307
+ }
308
+
309
+ message CartItemSnapshot {
310
+ string name_uk = 1;
311
+ string name_ru = 2;
312
+ double price = 3;
313
+ optional double old_price = 4;
314
+ optional string main_image = 5;
315
+ string slug = 6;
316
+ optional string category_id = 7;
317
+ optional string brand_id = 8;
318
+ }
319
+
320
+ message CartItemDto {
321
+ string cart_key = 1;
322
+ string product_id = 2;
323
+ int32 quantity = 3;
324
+ repeated CartItemVariant variants = 4;
325
+ CartItemSnapshot snapshot = 5;
326
+ string snapshot_json = 6;
327
+ }
328
+
329
+ message GetCartRequest {
330
+ string user_id = 1;
331
+ }
332
+
333
+ message GetCartResponse {
334
+ repeated CartItemDto items = 1;
335
+ }
336
+
337
+ message UpsertCartItemRequest {
338
+ string user_id = 1;
339
+ CartItemDto item = 2;
340
+ }
341
+
342
+ message RemoveCartItemRequest {
343
+ string user_id = 1;
344
+ string cart_key = 2;
345
+ }
346
+
347
+ message ClearCartRequest {
348
+ string user_id = 1;
349
+ }
350
+
351
+ message ClearCartResponse {
352
+ bool ok = 1;
353
+ }
354
+
355
+ message SyncCartRequest {
356
+ string user_id = 1;
357
+ repeated CartItemDto items = 2;
217
358
  }
package/gen/product.ts CHANGED
@@ -481,6 +481,7 @@ export interface DeleteProductVariantRequest {
481
481
  export interface GetRelatedProductsRequest {
482
482
  productId: string;
483
483
  type?: RelatedProductType | undefined;
484
+ productSlug?: string | undefined;
484
485
  }
485
486
 
486
487
  export interface RelatedProductItem {
@@ -34,6 +34,7 @@ export interface GetReviewsRequest {
34
34
  pagination: PaginationRequest | undefined;
35
35
  productId?: string | undefined;
36
36
  status?: ReviewStatus | undefined;
37
+ productSlug?: string | undefined;
37
38
  }
38
39
 
39
40
  export interface GetReviewsResponse {
@@ -47,6 +48,7 @@ export interface CreateReviewRequest {
47
48
  authorEmail: string;
48
49
  body: string;
49
50
  rating: number;
51
+ productSlug?: string | undefined;
50
52
  }
51
53
 
52
54
  export interface ReviewIdRequest {
package/gen/users.ts CHANGED
@@ -18,6 +18,12 @@ export enum DeliveryType {
18
18
  UNRECOGNIZED = -1,
19
19
  }
20
20
 
21
+ export enum Gender {
22
+ BOY = 0,
23
+ GIRL = 1,
24
+ UNRECOGNIZED = -1,
25
+ }
26
+
21
27
  export interface GetMeRequest {
22
28
  id: string;
23
29
  }
@@ -195,6 +201,119 @@ export interface DeleteAccountResponse {
195
201
  ok: boolean;
196
202
  }
197
203
 
204
+ export interface Child {
205
+ id: string;
206
+ name: string;
207
+ birthDate: string;
208
+ gender: Gender;
209
+ }
210
+
211
+ export interface GetFamilyRequest {
212
+ userId: string;
213
+ }
214
+
215
+ export interface GetFamilyResponse {
216
+ children: Child[];
217
+ pregnancyWeek?: number | undefined;
218
+ }
219
+
220
+ export interface AddChildRequest {
221
+ userId: string;
222
+ name: string;
223
+ birthDate: string;
224
+ gender: Gender;
225
+ }
226
+
227
+ export interface UpdateChildRequest {
228
+ id: string;
229
+ userId: string;
230
+ name?: string | undefined;
231
+ birthDate?: string | undefined;
232
+ gender?: Gender | undefined;
233
+ }
234
+
235
+ export interface ChildResponse {
236
+ child: Child | undefined;
237
+ }
238
+
239
+ export interface RemoveChildRequest {
240
+ id: string;
241
+ userId: string;
242
+ }
243
+
244
+ export interface RemoveChildResponse {
245
+ ok: boolean;
246
+ }
247
+
248
+ export interface GetPregnancyRequest {
249
+ userId: string;
250
+ }
251
+
252
+ export interface GetPregnancyResponse {
253
+ week?: number | undefined;
254
+ }
255
+
256
+ export interface UpdatePregnancyRequest {
257
+ userId: string;
258
+ week: number;
259
+ }
260
+
261
+ export interface CartItemVariant {
262
+ key: string;
263
+ value: string;
264
+ }
265
+
266
+ export interface CartItemSnapshot {
267
+ nameUk: string;
268
+ nameRu: string;
269
+ price: number;
270
+ oldPrice?: number | undefined;
271
+ mainImage?: string | undefined;
272
+ slug: string;
273
+ categoryId?: string | undefined;
274
+ brandId?: string | undefined;
275
+ }
276
+
277
+ export interface CartItemDto {
278
+ cartKey: string;
279
+ productId: string;
280
+ quantity: number;
281
+ variants: CartItemVariant[];
282
+ snapshot: CartItemSnapshot | undefined;
283
+ snapshotJson: string;
284
+ }
285
+
286
+ export interface GetCartRequest {
287
+ userId: string;
288
+ }
289
+
290
+ export interface GetCartResponse {
291
+ items: CartItemDto[];
292
+ }
293
+
294
+ export interface UpsertCartItemRequest {
295
+ userId: string;
296
+ item: CartItemDto | undefined;
297
+ }
298
+
299
+ export interface RemoveCartItemRequest {
300
+ userId: string;
301
+ cartKey: string;
302
+ }
303
+
304
+ export interface ClearCartRequest {
305
+ userId: string;
306
+ }
307
+
308
+ export interface ClearCartResponse {
309
+ ok: boolean;
310
+ }
311
+
312
+ export interface SyncCartRequest {
313
+ userId: string;
314
+ items: CartItemDto[];
315
+ }
316
+
198
317
  export const USERS_V1_PACKAGE_NAME = "users.v1";
199
318
 
200
319
  export interface UsersServiceClient {
@@ -231,6 +350,34 @@ export interface UsersServiceClient {
231
350
  exportUserData(request: ExportUserDataRequest): Observable<ExportUserDataResponse>;
232
351
 
233
352
  deleteAccount(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
353
+
354
+ /** Family */
355
+
356
+ getFamily(request: GetFamilyRequest): Observable<GetFamilyResponse>;
357
+
358
+ addChild(request: AddChildRequest): Observable<ChildResponse>;
359
+
360
+ updateChild(request: UpdateChildRequest): Observable<ChildResponse>;
361
+
362
+ removeChild(request: RemoveChildRequest): Observable<RemoveChildResponse>;
363
+
364
+ /** Pregnancy */
365
+
366
+ getPregnancy(request: GetPregnancyRequest): Observable<GetPregnancyResponse>;
367
+
368
+ updatePregnancy(request: UpdatePregnancyRequest): Observable<GetPregnancyResponse>;
369
+
370
+ /** Cart */
371
+
372
+ getCart(request: GetCartRequest): Observable<GetCartResponse>;
373
+
374
+ upsertCartItem(request: UpsertCartItemRequest): Observable<GetCartResponse>;
375
+
376
+ removeCartItem(request: RemoveCartItemRequest): Observable<GetCartResponse>;
377
+
378
+ clearCart(request: ClearCartRequest): Observable<ClearCartResponse>;
379
+
380
+ syncCart(request: SyncCartRequest): Observable<GetCartResponse>;
234
381
  }
235
382
 
236
383
  export interface UsersServiceController {
@@ -296,6 +443,44 @@ export interface UsersServiceController {
296
443
  deleteAccount(
297
444
  request: DeleteAccountRequest,
298
445
  ): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
446
+
447
+ /** Family */
448
+
449
+ getFamily(request: GetFamilyRequest): Promise<GetFamilyResponse> | Observable<GetFamilyResponse> | GetFamilyResponse;
450
+
451
+ addChild(request: AddChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
452
+
453
+ updateChild(request: UpdateChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
454
+
455
+ removeChild(
456
+ request: RemoveChildRequest,
457
+ ): Promise<RemoveChildResponse> | Observable<RemoveChildResponse> | RemoveChildResponse;
458
+
459
+ /** Pregnancy */
460
+
461
+ getPregnancy(
462
+ request: GetPregnancyRequest,
463
+ ): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
464
+
465
+ updatePregnancy(
466
+ request: UpdatePregnancyRequest,
467
+ ): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
468
+
469
+ /** Cart */
470
+
471
+ getCart(request: GetCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
472
+
473
+ upsertCartItem(
474
+ request: UpsertCartItemRequest,
475
+ ): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
476
+
477
+ removeCartItem(
478
+ request: RemoveCartItemRequest,
479
+ ): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
480
+
481
+ clearCart(request: ClearCartRequest): Promise<ClearCartResponse> | Observable<ClearCartResponse> | ClearCartResponse;
482
+
483
+ syncCart(request: SyncCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
299
484
  }
300
485
 
301
486
  export function UsersServiceControllerMethods() {
@@ -317,6 +502,17 @@ export function UsersServiceControllerMethods() {
317
502
  "clearViewedHistory",
318
503
  "exportUserData",
319
504
  "deleteAccount",
505
+ "getFamily",
506
+ "addChild",
507
+ "updateChild",
508
+ "removeChild",
509
+ "getPregnancy",
510
+ "updatePregnancy",
511
+ "getCart",
512
+ "upsertCartItem",
513
+ "removeCartItem",
514
+ "clearCart",
515
+ "syncCart",
320
516
  ];
321
517
  for (const method of grpcMethods) {
322
518
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.109",
4
+ "version": "1.0.111",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -425,8 +425,9 @@ enum RelatedProductType {
425
425
  }
426
426
 
427
427
  message GetRelatedProductsRequest {
428
- string product_id = 1;
429
- optional RelatedProductType type = 2;
428
+ string product_id = 1;
429
+ optional RelatedProductType type = 2;
430
+ optional string product_slug = 3;
430
431
  }
431
432
 
432
433
  message RelatedProductItem {
@@ -36,8 +36,9 @@ message ReviewResponse {
36
36
 
37
37
  message GetReviewsRequest {
38
38
  PaginationRequest pagination = 1;
39
- optional string product_id = 2;
40
- optional ReviewStatus status = 3;
39
+ optional string product_id = 2;
40
+ optional ReviewStatus status = 3;
41
+ optional string product_slug = 4;
41
42
  }
42
43
 
43
44
  message GetReviewsResponse {
@@ -47,11 +48,12 @@ message GetReviewsResponse {
47
48
 
48
49
 
49
50
  message CreateReviewRequest {
50
- string product_id = 1;
51
- string author_name = 2;
52
- string author_email = 3;
53
- string body = 4;
54
- int32 rating = 5;
51
+ string product_id = 1;
52
+ string author_name = 2;
53
+ string author_email = 3;
54
+ string body = 4;
55
+ int32 rating = 5;
56
+ optional string product_slug = 6;
55
57
  }
56
58
 
57
59
 
package/proto/users.proto CHANGED
@@ -30,6 +30,23 @@ service UsersService {
30
30
 
31
31
  rpc ExportUserData(ExportUserDataRequest) returns (ExportUserDataResponse);
32
32
  rpc DeleteAccount(DeleteAccountRequest) returns (DeleteAccountResponse);
33
+
34
+ // Family
35
+ rpc GetFamily(GetFamilyRequest) returns (GetFamilyResponse);
36
+ rpc AddChild(AddChildRequest) returns (ChildResponse);
37
+ rpc UpdateChild(UpdateChildRequest) returns (ChildResponse);
38
+ rpc RemoveChild(RemoveChildRequest) returns (RemoveChildResponse);
39
+
40
+ // Pregnancy
41
+ rpc GetPregnancy(GetPregnancyRequest) returns (GetPregnancyResponse);
42
+ rpc UpdatePregnancy(UpdatePregnancyRequest) returns (GetPregnancyResponse);
43
+
44
+ // Cart
45
+ rpc GetCart(GetCartRequest) returns (GetCartResponse);
46
+ rpc UpsertCartItem(UpsertCartItemRequest) returns (GetCartResponse);
47
+ rpc RemoveCartItem(RemoveCartItemRequest) returns (GetCartResponse);
48
+ rpc ClearCart(ClearCartRequest) returns (ClearCartResponse);
49
+ rpc SyncCart(SyncCartRequest) returns (GetCartResponse);
33
50
  }
34
51
 
35
52
  message GetMeRequest {
@@ -214,4 +231,128 @@ message DeleteAccountRequest {
214
231
 
215
232
  message DeleteAccountResponse {
216
233
  bool ok = 1;
234
+ }
235
+
236
+ // ── Family ───────────────────────────────────────────────────────────────────
237
+
238
+ enum Gender {
239
+ BOY = 0;
240
+ GIRL = 1;
241
+ }
242
+
243
+ message Child {
244
+ string id = 1;
245
+ string name = 2;
246
+ string birth_date = 3;
247
+ Gender gender = 4;
248
+ }
249
+
250
+ message GetFamilyRequest {
251
+ string user_id = 1;
252
+ }
253
+
254
+ message GetFamilyResponse {
255
+ repeated Child children = 1;
256
+ optional int32 pregnancy_week = 2;
257
+ }
258
+
259
+ message AddChildRequest {
260
+ string user_id = 1;
261
+ string name = 2;
262
+ string birth_date = 3;
263
+ Gender gender = 4;
264
+ }
265
+
266
+ message UpdateChildRequest {
267
+ string id = 1;
268
+ string user_id = 2;
269
+ optional string name = 3;
270
+ optional string birth_date = 4;
271
+ optional Gender gender = 5;
272
+ }
273
+
274
+ message ChildResponse {
275
+ Child child = 1;
276
+ }
277
+
278
+ message RemoveChildRequest {
279
+ string id = 1;
280
+ string user_id = 2;
281
+ }
282
+
283
+ message RemoveChildResponse {
284
+ bool ok = 1;
285
+ }
286
+
287
+ // ── Pregnancy ────────────────────────────────────────────────────────────────
288
+
289
+ message GetPregnancyRequest {
290
+ string user_id = 1;
291
+ }
292
+
293
+ message GetPregnancyResponse {
294
+ optional int32 week = 1;
295
+ }
296
+
297
+ message UpdatePregnancyRequest {
298
+ string user_id = 1;
299
+ int32 week = 2;
300
+ }
301
+
302
+ // ── Cart ─────────────────────────────────────────────────────────────────────
303
+
304
+ message CartItemVariant {
305
+ string key = 1;
306
+ string value = 2;
307
+ }
308
+
309
+ message CartItemSnapshot {
310
+ string name_uk = 1;
311
+ string name_ru = 2;
312
+ double price = 3;
313
+ optional double old_price = 4;
314
+ optional string main_image = 5;
315
+ string slug = 6;
316
+ optional string category_id = 7;
317
+ optional string brand_id = 8;
318
+ }
319
+
320
+ message CartItemDto {
321
+ string cart_key = 1;
322
+ string product_id = 2;
323
+ int32 quantity = 3;
324
+ repeated CartItemVariant variants = 4;
325
+ CartItemSnapshot snapshot = 5;
326
+ string snapshot_json = 6;
327
+ }
328
+
329
+ message GetCartRequest {
330
+ string user_id = 1;
331
+ }
332
+
333
+ message GetCartResponse {
334
+ repeated CartItemDto items = 1;
335
+ }
336
+
337
+ message UpsertCartItemRequest {
338
+ string user_id = 1;
339
+ CartItemDto item = 2;
340
+ }
341
+
342
+ message RemoveCartItemRequest {
343
+ string user_id = 1;
344
+ string cart_key = 2;
345
+ }
346
+
347
+ message ClearCartRequest {
348
+ string user_id = 1;
349
+ }
350
+
351
+ message ClearCartResponse {
352
+ bool ok = 1;
353
+ }
354
+
355
+ message SyncCartRequest {
356
+ string user_id = 1;
357
+ repeated CartItemDto items = 2;
217
358
  }