// 促销模块

// 获取促销列表
export const getPromotionList = {
  url: '/promotion/promotionPermission/list',
  method: 'GET',
  dealReqData: ({ pageNum, pageSize, name, promotionId, status }) => {
    return { pageNum, pageSize, name, promotionId, status }
  }
}

// 添加促销规则
export const addPromotion = {
  url: '/promotion/promotionPermission/save',
  method: 'POST',
  dealReqData: (form) => {
    return form
  }
}

// 修改促销
export const updatePromotion = {
  url: '/promotion/promotionPermission/update',
  method: 'PUT',
  dealReqData: (form) => {
    return form
  }
}

// 获取促销详情
export const getPromotionDetail = {
  url: '/promotion/promotionPermission',
  method: 'GET',
  dealReqData: ({ promotionId }) => {
    return { promotionId }
  }
}

// 删除促销活动
export const deletePromotion = {
  url: '/promotion/promotionPermission/delete',
  method: 'DELETE',
  dealUrl: (url, promotionId) => {
    return `${url}/${promotionId}`
  }
}

// // 暂停或开放促销活动
// export const stopOrOpenPromotion = {
//   url: '/promotion/promotion/stopOrOpen',
//   method: 'PUT',
//   dealReqData: ({ promotionId }) => {
//     return { promotionId }
//   }
// }

// // 获取优惠券列表
// export const getCouponList = {
//   url: '/promotion/coupon/page',
//   method: 'GET',
//   dealReqData: ({ pageNum, pageSize, startTimeHead, startTimeTail, endTimeHead, endTimeTail, keyword, status, type }) => {
//     return { pageNum, pageSize, startTimeHead, startTimeTail, endTimeHead, endTimeTail, keyword, status, type }
//   }
// }

// // 添加或修改优惠券
// export const addOrUpdateCoupon = {
//   url: '/promotion/coupon/addOrUpdate',
//   method: 'POST',
//   dealReqData: ({ couponId, couponName, goodsNo, couponType, startTime, endTime, fullMoney, reduceMoney, straightDownMoney }) => {
//     return { couponId, couponName, goodsNo, couponType, startTime, endTime, fullMoney, reduceMoney, straightDownMoney }
//   }
// }

// // 删除优惠券
// export const deleteCoupon = {
//   url: '/promotion/coupon/delete',
//   method: 'DELETE',
//   dealReqData: ({ couponId }) => {
//     return { couponId }
//   }
// }

// // 暂停或开放优惠券
// export const stopOrOpenCoupon = {
//   url: '/promotion/coupon/stopOrOpen',
//   method: 'PUT',
//   dealReqData: ({ couponId }) => {
//     return { couponId }
//   }
// }
