import { ResPage, StoreUser } from "@/api/interface/index";
import { PORT_NONE } from "@/api/config/servicePort";
import http from "@/api";
import httpApi from "@/api/indexApi";

/** 商家端优惠券列表 GET /alienStore/life-discount-coupon/getStoreAllCouponList */
export const getStoreAllCouponList = (params: {
  storeId: string | number;
  tab?: string;
  size?: number;
  page?: number;
  couponName?: string;
  couponType?: string | number;
  couponsFromType?: number;
}) => {
  return httpApi.get<any>(`/alienStore/life-discount-coupon/getStoreAllCouponList`, params);
};

export const delCouponById = (params: { id: string }) => {
  return http.get(PORT_NONE + `/discountCouponPlatform/deleteDiscountCoupon`, params);
};
export const updateCouponStatus = params => {
  return http.get(PORT_NONE + `/discountCouponPlatform/cutDiscountCouponStatus`, params);
};
export const updateCouponSingleQty = params => {
  return http.get(PORT_NONE + `/discountCouponPlatform/updateCouponSingleQty`, params);
};
export const addDiscountCoupon = params => {
  return http.post(PORT_NONE + `/discountCouponPlatform/addDiscountCoupon`, params);
};
export const editDiscountCoupon = params => {
  return http.post(PORT_NONE + `/discountCouponPlatform/editDiscountCoupon`, params);
};
export const getCouponDetail = (params: StoreUser.ReqUserParams) => {
  return http.get<StoreUser.ResStoreUserList>(PORT_NONE + `/discountCouponPlatform/getCounponDetailById`, params);
};
