@mivis/petmart-api 1.2.176 → 1.2.178

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/type.d.ts +31 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mivis/petmart-api",
3
- "version": "1.2.176",
3
+ "version": "1.2.178",
4
4
  "main": "index.js",
5
5
  "types": "type.d.ts",
6
6
  "license": "ISC",
package/type.d.ts CHANGED
@@ -244,10 +244,17 @@ declare namespace Components {
244
244
  value: string;
245
245
  }
246
246
 
247
+ export enum EProductType {
248
+ PRODUCT = 'PRODUCT',
249
+ VARIATION = 'VARIATION',
250
+ }
251
+
247
252
  export interface IProduct {
248
253
  _id: string;
254
+ type: EProductType;
255
+ parent_id?: string | null; // Ссылка на родителя (исключительно для вариаций)
249
256
  name: string;
250
- status: EProductStatus;
257
+ status: EProductStatus; // Для вариаций статус всегда PUBLISHED
251
258
  subCategory_id: string;
252
259
  category_id: string;
253
260
  seller_id: string;
@@ -260,7 +267,7 @@ declare namespace Components {
260
267
  desc: string;
261
268
  characteristic: ICharacteristic[];
262
269
  external_item_id: string | null;
263
- variations: string[];
270
+ variations?: IProduct[];
264
271
  purchases_count: number;
265
272
  viewed?: number;
266
273
  number: number;
@@ -276,6 +283,7 @@ declare namespace Components {
276
283
  name?: string;
277
284
  status?: EProductStatus;
278
285
  all_fields?: string;
286
+ type?: EProductType;
279
287
  }
280
288
 
281
289
  export interface IUserProductQueryRequest extends FilterBaseQuery {
@@ -305,6 +313,8 @@ declare namespace Components {
305
313
  export interface IProductResponse {
306
314
  _id: string;
307
315
  name: string;
316
+ type: EProductType;
317
+ parent_id?: string | null;
308
318
  status: EProductStatus;
309
319
  subCategory_id: {
310
320
  _id: string;
@@ -332,6 +342,7 @@ declare namespace Components {
332
342
  photo: string[];
333
343
  desc: string;
334
344
  characteristic: ICharacteristic[];
345
+ variations?: IProduct[];
335
346
  purchases_count: number;
336
347
  viewed?: number;
337
348
  number: number;
@@ -377,6 +388,11 @@ declare namespace Components {
377
388
  reviewsData: IReviewsData;
378
389
  }
379
390
 
391
+ export interface IAddVariation {
392
+ _id: string;
393
+ characteristic: ICharacteristic[];
394
+ }
395
+
380
396
  export interface ICreateProduct {
381
397
  name: string;
382
398
  status?:
@@ -392,11 +408,19 @@ declare namespace Components {
392
408
  photo: File[];
393
409
  desc: string;
394
410
  characteristic: ICharacteristic[];
411
+ variations?: IAddVariation[];
395
412
  }
396
413
 
414
+ export interface ICreateVariation
415
+ extends Omit<
416
+ ICreateProduct,
417
+ 'status' | 'seller_id' | 'category_id' | 'subCategory_id' | 'variations'
418
+ > {}
419
+
397
420
  export interface IUpdateProduct extends ICreateProduct {
398
421
  id: string;
399
422
  toDeletePhotos?: string[];
423
+ toDeleteVariations?: string[];
400
424
  }
401
425
 
402
426
  export interface ICreateCart {
@@ -1565,5 +1589,10 @@ declare namespace Components {
1565
1589
  SELLERS = 'SELLERS',
1566
1590
  USERS = 'USERS',
1567
1591
  }
1592
+
1593
+ export interface IHintCharacteristics {
1594
+ name: string;
1595
+ values: string[];
1596
+ }
1568
1597
  }
1569
1598
  }