@mivis/petmart-api 1.2.81 → 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 +39 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mivis/petmart-api",
3
- "version": "1.2.81",
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
@@ -765,12 +765,49 @@ declare namespace Components {
765
765
  }
766
766
 
767
767
  export interface ICreateOrder {
768
- items: Omit<IOrderItem[], '_id' | 'items_status'>;
768
+ items: Omit<IOrderItem, '_id' | 'items_status'>[];
769
769
  receive_method: ERecieveMethod;
770
770
  receive_method_data: IDeliveryInfo | IPVZ | IPickUpPoint;
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;
@@ -837,7 +874,7 @@ declare namespace Components {
837
874
  export interface GetDeliverySum {
838
875
  address: string;
839
876
  type: ERecieveMethod.COURIER | ERecieveMethod.PVZ;
840
- items: Omit<IOrderItem[], '_id' | 'items_status'>;
877
+ items: Omit<IOrderItem, '_id' | 'items_status'>[];
841
878
  }
842
879
 
843
880
  export interface IDeliverySum {