@mivis/petmart-api 1.2.296 → 1.2.300

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 (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/type.d.ts +82 -9
package/index.js CHANGED
@@ -1 +1 @@
1
- // is empty
1
+ // is empty
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mivis/petmart-api",
3
- "version": "1.2.296",
3
+ "version": "1.2.300",
4
4
  "main": "index.js",
5
5
  "types": "type.d.ts",
6
6
  "license": "ISC",
package/type.d.ts CHANGED
@@ -1214,6 +1214,7 @@ declare namespace Components {
1214
1214
  updatedAt: Date;
1215
1215
  type?: DeliveryTypes;
1216
1216
  yandex_offer?: OfferDto;
1217
+ promo_codes?: string[];
1217
1218
  }
1218
1219
 
1219
1220
  export interface IAdminMultiOrderResponse
@@ -2354,27 +2355,74 @@ declare namespace Components {
2354
2355
  // PromoCode
2355
2356
 
2356
2357
  export interface ICreatePromo {
2357
- discount_percent: number;
2358
- start_date?: string; // default: new Date().toISOString()
2359
- end_date: string;
2358
+ code: string;
2359
+ discount_type: EDiscountType;
2360
+ discount_value: number;
2361
+ start_date: Date;
2362
+ end_date: Date;
2363
+ usage_limit_user?: number; // 0 for unlimited
2364
+ target_type: EPromoTargetType;
2365
+ target_sellers?: string[];
2366
+ target_categories?: string[];
2367
+ target_subcategories?: string[];
2368
+ target_products?: string[];
2369
+ description?: string;
2360
2370
  }
2361
2371
 
2362
2372
  export interface IApplyPromo {
2363
2373
  code: string;
2364
2374
  }
2365
2375
 
2376
+ export enum EDiscountType {
2377
+ PERCENT = 'PERCENT',
2378
+ FIXED = 'FIXED',
2379
+ }
2380
+
2381
+ export enum EPromoStatus {
2382
+ ACTIVE = 'ACTIVE',
2383
+ ARCHIVED = 'ARCHIVED',
2384
+ EXPIRED = 'EXPIRED', // Computed
2385
+ }
2386
+
2387
+ export enum EPromoTargetType {
2388
+ GLOBAL = 'GLOBAL',
2389
+ SPECIFIC = 'SPECIFIC',
2390
+ }
2391
+
2392
+ export enum EPromoCreatorType {
2393
+ ADMIN = 'ADMIN',
2394
+ SELLER = 'SELLER',
2395
+ }
2396
+
2366
2397
  export interface IPromoCode {
2367
2398
  _id: string;
2368
- seller_id: string; // Привязка к продавцу
2369
- code: string; // Сам промокод, например HSYORK20
2370
- discount_percent: number; // Процент скидки (20 -> 20%)
2371
- start_date: Date; // Дата начала действия промокода
2372
- end_date: Date; // Дата окончания действия промокода
2373
- showcase_url: string; // Ссылка на витрину продавца
2399
+ code: string; // Uppercase
2400
+ discount_type: EDiscountType;
2401
+ discount_value: number;
2402
+ start_date: Date;
2403
+ end_date: Date;
2404
+ status: EPromoStatus;
2405
+ usage_limit_user: number;
2406
+ used_count: number;
2407
+ target_type: EPromoTargetType;
2408
+ target_sellers: string[];
2409
+ target_categories: string[];
2410
+ target_subcategories: string[];
2411
+ target_products: string[];
2412
+ description: string;
2413
+ creator_id: string;
2414
+ creator_type: EPromoCreatorType;
2415
+ showcase_url?: string;
2416
+ isExpired?: boolean;
2374
2417
  createdAt: Date;
2375
2418
  updatedAt: Date;
2376
2419
  }
2377
2420
 
2421
+ export interface IGetPromoCodesQuery extends FilterBaseQuery {
2422
+ code?: string;
2423
+ status?: EPromoStatus;
2424
+ }
2425
+
2378
2426
  /**
2379
2427
  * Порядок сортировки
2380
2428
  */
@@ -2555,5 +2603,30 @@ declare namespace Components {
2555
2603
  products: IProductResponse[];
2556
2604
  filters: IFilterWithSelect[];
2557
2605
  }
2606
+
2607
+ export interface IProductsByCategoryIdQueryRequest extends FilterBaseQuery {
2608
+ user_id?: string;
2609
+ skip: string;
2610
+ limit: string;
2611
+ sortBy?: EProductsSortOptions;
2612
+ }
2613
+
2614
+ export interface IProductsByCategoryIdResponse {
2615
+ products: IProductResponse[];
2616
+ }
2617
+
2618
+ export interface IProductsBySellerIdQueryRequest extends FilterBaseQuery {
2619
+ user_id?: string;
2620
+ skip: string;
2621
+ limit: string;
2622
+ sortBy?: EProductsSortOptions;
2623
+ subCategory_id?: string;
2624
+ priceMin?: string;
2625
+ priceMax?: string;
2626
+ }
2627
+
2628
+ export interface IProductsBySellerIdResponse {
2629
+ products: IProductResponse[];
2630
+ }
2558
2631
  }
2559
2632
  }