@mamindom/contracts 1.0.109 → 1.0.110
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/dist/gen/users.d.ts +124 -0
- package/dist/gen/users.js +18 -1
- package/dist/proto/users.proto +140 -0
- package/gen/users.ts +195 -0
- package/package.json +1 -1
- package/proto/users.proto +140 -0
package/dist/gen/users.d.ts
CHANGED
|
@@ -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,97 @@ 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
|
+
}
|
|
226
|
+
export interface GetCartRequest {
|
|
227
|
+
userId: string;
|
|
228
|
+
}
|
|
229
|
+
export interface GetCartResponse {
|
|
230
|
+
items: CartItemDto[];
|
|
231
|
+
}
|
|
232
|
+
export interface UpsertCartItemRequest {
|
|
233
|
+
userId: string;
|
|
234
|
+
item: CartItemDto | undefined;
|
|
235
|
+
}
|
|
236
|
+
export interface RemoveCartItemRequest {
|
|
237
|
+
userId: string;
|
|
238
|
+
cartKey: string;
|
|
239
|
+
}
|
|
240
|
+
export interface ClearCartRequest {
|
|
241
|
+
userId: string;
|
|
242
|
+
}
|
|
243
|
+
export interface ClearCartResponse {
|
|
244
|
+
ok: boolean;
|
|
245
|
+
}
|
|
246
|
+
export interface SyncCartRequest {
|
|
247
|
+
userId: string;
|
|
248
|
+
items: CartItemDto[];
|
|
249
|
+
}
|
|
154
250
|
export declare const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
155
251
|
export interface UsersServiceClient {
|
|
156
252
|
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
@@ -169,6 +265,20 @@ export interface UsersServiceClient {
|
|
|
169
265
|
clearViewedHistory(request: ClearViewedHistoryRequest): Observable<ClearViewedHistoryResponse>;
|
|
170
266
|
exportUserData(request: ExportUserDataRequest): Observable<ExportUserDataResponse>;
|
|
171
267
|
deleteAccount(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
|
|
268
|
+
/** Family */
|
|
269
|
+
getFamily(request: GetFamilyRequest): Observable<GetFamilyResponse>;
|
|
270
|
+
addChild(request: AddChildRequest): Observable<ChildResponse>;
|
|
271
|
+
updateChild(request: UpdateChildRequest): Observable<ChildResponse>;
|
|
272
|
+
removeChild(request: RemoveChildRequest): Observable<RemoveChildResponse>;
|
|
273
|
+
/** Pregnancy */
|
|
274
|
+
getPregnancy(request: GetPregnancyRequest): Observable<GetPregnancyResponse>;
|
|
275
|
+
updatePregnancy(request: UpdatePregnancyRequest): Observable<GetPregnancyResponse>;
|
|
276
|
+
/** Cart */
|
|
277
|
+
getCart(request: GetCartRequest): Observable<GetCartResponse>;
|
|
278
|
+
upsertCartItem(request: UpsertCartItemRequest): Observable<GetCartResponse>;
|
|
279
|
+
removeCartItem(request: RemoveCartItemRequest): Observable<GetCartResponse>;
|
|
280
|
+
clearCart(request: ClearCartRequest): Observable<ClearCartResponse>;
|
|
281
|
+
syncCart(request: SyncCartRequest): Observable<GetCartResponse>;
|
|
172
282
|
}
|
|
173
283
|
export interface UsersServiceController {
|
|
174
284
|
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
@@ -187,6 +297,20 @@ export interface UsersServiceController {
|
|
|
187
297
|
clearViewedHistory(request: ClearViewedHistoryRequest): Promise<ClearViewedHistoryResponse> | Observable<ClearViewedHistoryResponse> | ClearViewedHistoryResponse;
|
|
188
298
|
exportUserData(request: ExportUserDataRequest): Promise<ExportUserDataResponse> | Observable<ExportUserDataResponse> | ExportUserDataResponse;
|
|
189
299
|
deleteAccount(request: DeleteAccountRequest): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
|
|
300
|
+
/** Family */
|
|
301
|
+
getFamily(request: GetFamilyRequest): Promise<GetFamilyResponse> | Observable<GetFamilyResponse> | GetFamilyResponse;
|
|
302
|
+
addChild(request: AddChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
|
|
303
|
+
updateChild(request: UpdateChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
|
|
304
|
+
removeChild(request: RemoveChildRequest): Promise<RemoveChildResponse> | Observable<RemoveChildResponse> | RemoveChildResponse;
|
|
305
|
+
/** Pregnancy */
|
|
306
|
+
getPregnancy(request: GetPregnancyRequest): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
|
|
307
|
+
updatePregnancy(request: UpdatePregnancyRequest): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
|
|
308
|
+
/** Cart */
|
|
309
|
+
getCart(request: GetCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
310
|
+
upsertCartItem(request: UpsertCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
311
|
+
removeCartItem(request: RemoveCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
312
|
+
clearCart(request: ClearCartRequest): Promise<ClearCartResponse> | Observable<ClearCartResponse> | ClearCartResponse;
|
|
313
|
+
syncCart(request: SyncCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
190
314
|
}
|
|
191
315
|
export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
|
|
192
316
|
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);
|
package/dist/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,127 @@ 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
|
+
}
|
|
327
|
+
|
|
328
|
+
message GetCartRequest {
|
|
329
|
+
string user_id = 1;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
message GetCartResponse {
|
|
333
|
+
repeated CartItemDto items = 1;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
message UpsertCartItemRequest {
|
|
337
|
+
string user_id = 1;
|
|
338
|
+
CartItemDto item = 2;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
message RemoveCartItemRequest {
|
|
342
|
+
string user_id = 1;
|
|
343
|
+
string cart_key = 2;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
message ClearCartRequest {
|
|
347
|
+
string user_id = 1;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
message ClearCartResponse {
|
|
351
|
+
bool ok = 1;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
message SyncCartRequest {
|
|
355
|
+
string user_id = 1;
|
|
356
|
+
repeated CartItemDto items = 2;
|
|
217
357
|
}
|
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,118 @@ 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
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface GetCartRequest {
|
|
286
|
+
userId: string;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface GetCartResponse {
|
|
290
|
+
items: CartItemDto[];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface UpsertCartItemRequest {
|
|
294
|
+
userId: string;
|
|
295
|
+
item: CartItemDto | undefined;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export interface RemoveCartItemRequest {
|
|
299
|
+
userId: string;
|
|
300
|
+
cartKey: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface ClearCartRequest {
|
|
304
|
+
userId: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export interface ClearCartResponse {
|
|
308
|
+
ok: boolean;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface SyncCartRequest {
|
|
312
|
+
userId: string;
|
|
313
|
+
items: CartItemDto[];
|
|
314
|
+
}
|
|
315
|
+
|
|
198
316
|
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
199
317
|
|
|
200
318
|
export interface UsersServiceClient {
|
|
@@ -231,6 +349,34 @@ export interface UsersServiceClient {
|
|
|
231
349
|
exportUserData(request: ExportUserDataRequest): Observable<ExportUserDataResponse>;
|
|
232
350
|
|
|
233
351
|
deleteAccount(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
|
|
352
|
+
|
|
353
|
+
/** Family */
|
|
354
|
+
|
|
355
|
+
getFamily(request: GetFamilyRequest): Observable<GetFamilyResponse>;
|
|
356
|
+
|
|
357
|
+
addChild(request: AddChildRequest): Observable<ChildResponse>;
|
|
358
|
+
|
|
359
|
+
updateChild(request: UpdateChildRequest): Observable<ChildResponse>;
|
|
360
|
+
|
|
361
|
+
removeChild(request: RemoveChildRequest): Observable<RemoveChildResponse>;
|
|
362
|
+
|
|
363
|
+
/** Pregnancy */
|
|
364
|
+
|
|
365
|
+
getPregnancy(request: GetPregnancyRequest): Observable<GetPregnancyResponse>;
|
|
366
|
+
|
|
367
|
+
updatePregnancy(request: UpdatePregnancyRequest): Observable<GetPregnancyResponse>;
|
|
368
|
+
|
|
369
|
+
/** Cart */
|
|
370
|
+
|
|
371
|
+
getCart(request: GetCartRequest): Observable<GetCartResponse>;
|
|
372
|
+
|
|
373
|
+
upsertCartItem(request: UpsertCartItemRequest): Observable<GetCartResponse>;
|
|
374
|
+
|
|
375
|
+
removeCartItem(request: RemoveCartItemRequest): Observable<GetCartResponse>;
|
|
376
|
+
|
|
377
|
+
clearCart(request: ClearCartRequest): Observable<ClearCartResponse>;
|
|
378
|
+
|
|
379
|
+
syncCart(request: SyncCartRequest): Observable<GetCartResponse>;
|
|
234
380
|
}
|
|
235
381
|
|
|
236
382
|
export interface UsersServiceController {
|
|
@@ -296,6 +442,44 @@ export interface UsersServiceController {
|
|
|
296
442
|
deleteAccount(
|
|
297
443
|
request: DeleteAccountRequest,
|
|
298
444
|
): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
|
|
445
|
+
|
|
446
|
+
/** Family */
|
|
447
|
+
|
|
448
|
+
getFamily(request: GetFamilyRequest): Promise<GetFamilyResponse> | Observable<GetFamilyResponse> | GetFamilyResponse;
|
|
449
|
+
|
|
450
|
+
addChild(request: AddChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
|
|
451
|
+
|
|
452
|
+
updateChild(request: UpdateChildRequest): Promise<ChildResponse> | Observable<ChildResponse> | ChildResponse;
|
|
453
|
+
|
|
454
|
+
removeChild(
|
|
455
|
+
request: RemoveChildRequest,
|
|
456
|
+
): Promise<RemoveChildResponse> | Observable<RemoveChildResponse> | RemoveChildResponse;
|
|
457
|
+
|
|
458
|
+
/** Pregnancy */
|
|
459
|
+
|
|
460
|
+
getPregnancy(
|
|
461
|
+
request: GetPregnancyRequest,
|
|
462
|
+
): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
|
|
463
|
+
|
|
464
|
+
updatePregnancy(
|
|
465
|
+
request: UpdatePregnancyRequest,
|
|
466
|
+
): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
|
|
467
|
+
|
|
468
|
+
/** Cart */
|
|
469
|
+
|
|
470
|
+
getCart(request: GetCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
471
|
+
|
|
472
|
+
upsertCartItem(
|
|
473
|
+
request: UpsertCartItemRequest,
|
|
474
|
+
): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
475
|
+
|
|
476
|
+
removeCartItem(
|
|
477
|
+
request: RemoveCartItemRequest,
|
|
478
|
+
): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
479
|
+
|
|
480
|
+
clearCart(request: ClearCartRequest): Promise<ClearCartResponse> | Observable<ClearCartResponse> | ClearCartResponse;
|
|
481
|
+
|
|
482
|
+
syncCart(request: SyncCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
|
|
299
483
|
}
|
|
300
484
|
|
|
301
485
|
export function UsersServiceControllerMethods() {
|
|
@@ -317,6 +501,17 @@ export function UsersServiceControllerMethods() {
|
|
|
317
501
|
"clearViewedHistory",
|
|
318
502
|
"exportUserData",
|
|
319
503
|
"deleteAccount",
|
|
504
|
+
"getFamily",
|
|
505
|
+
"addChild",
|
|
506
|
+
"updateChild",
|
|
507
|
+
"removeChild",
|
|
508
|
+
"getPregnancy",
|
|
509
|
+
"updatePregnancy",
|
|
510
|
+
"getCart",
|
|
511
|
+
"upsertCartItem",
|
|
512
|
+
"removeCartItem",
|
|
513
|
+
"clearCart",
|
|
514
|
+
"syncCart",
|
|
320
515
|
];
|
|
321
516
|
for (const method of grpcMethods) {
|
|
322
517
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
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,127 @@ 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
|
+
}
|
|
327
|
+
|
|
328
|
+
message GetCartRequest {
|
|
329
|
+
string user_id = 1;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
message GetCartResponse {
|
|
333
|
+
repeated CartItemDto items = 1;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
message UpsertCartItemRequest {
|
|
337
|
+
string user_id = 1;
|
|
338
|
+
CartItemDto item = 2;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
message RemoveCartItemRequest {
|
|
342
|
+
string user_id = 1;
|
|
343
|
+
string cart_key = 2;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
message ClearCartRequest {
|
|
347
|
+
string user_id = 1;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
message ClearCartResponse {
|
|
351
|
+
bool ok = 1;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
message SyncCartRequest {
|
|
355
|
+
string user_id = 1;
|
|
356
|
+
repeated CartItemDto items = 2;
|
|
217
357
|
}
|