@mivis/petmart-api 1.2.82 → 1.2.83

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 +37 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mivis/petmart-api",
3
- "version": "1.2.82",
3
+ "version": "1.2.83",
4
4
  "main": "index.js",
5
5
  "types": "type.d.ts",
6
6
  "license": "ISC",
package/type.d.ts CHANGED
@@ -771,6 +771,43 @@ declare namespace Components {
771
771
  seller_id: string;
772
772
  }
773
773
 
774
+ export interface IGetAllOrders {
775
+ user_id: string;
776
+ skip: number;
777
+ limit: number;
778
+ }
779
+
780
+ export type IPopulatedOrderShop = Pick<IShop, '_id' | 'name' | 'address'>;
781
+
782
+ export interface IPopulatedOrderItemApp
783
+ extends Omit<IOrderItem, 'product_id'> {
784
+ product_id: Pick<IProduct, '_id' | 'name' | 'photo' | 'discount'>;
785
+ }
786
+
787
+ export type IPopulatedOrderUserApp = Pick<IUser, '_id' | 'name' | 'tel'>;
788
+
789
+ export type IPopulatedOrderApp = Omit<
790
+ IOrder,
791
+ 'items' | 'shop_id' | 'user_id'
792
+ > & {
793
+ items: IPopulatedOrderItemApp[];
794
+ user_id: IPopulatedOrderUserApp;
795
+ shop_id: IPopulatedOrderShop;
796
+ };
797
+
798
+ export enum EReasonOfCancel {
799
+ CHANGED_DELIVERY_DATE = 'Перенесли срок доставки',
800
+ INCORRECT_CREATED_ORDER = 'Хочу изменить заказ и оформить заново',
801
+ FOUND_CHEAPER = 'Перенесли срок доставки',
802
+ WRONG_ADDRESS = 'Указал неверный адрес',
803
+ OTHER = 'Другое',
804
+ }
805
+
806
+ export interface ICancelOrderRequest {
807
+ order_id: string;
808
+ reason_of_cancel: EReasonOfCancel;
809
+ }
810
+
774
811
  export interface ICreateMultiOrder {
775
812
  orders: ICreateOrder[];
776
813
  sum: number;