import request from '@/utils/request'

// 分页查询平台代金券
export function getAllPlatformVoucher(data) {
  return request({
    url: '/platformVoucher/getAll',
    method: 'post',
    data
  })
}

// 充值代金券统计
export function getByUserOrderShopVoucher(params) {
  return request({
    url: '/shopVoucherEntryRecord/getByUserOrderVoucher',
    method: 'get',
    params
  })
}

// 兑换代金券统计
export function getShopTotalShopVoucher(data) {
  return request({
    url: '/shopVoucherEntryRecord/shopTotal',
    method: 'post',
    data
  })
}

// 充值代金券转赠
export function updateTransferRechargeShopVoucher(data) {
  return request({
    url: '/shopVoucherEntryRecord/getByUserOrderVoucher',
    method: 'post',
    data
  })
}

// 兑换代金券转赠
export function updateTransferExchangeShopVoucher(data) {
  return request({
    url: '/shopVoucherEntryRecord/transfer',
    method: 'post',
    data
  })
}

// 代金券购买提交订单
export function submitShopVoucherEntryRecord(data) {
  return request({
    url: '/shopVoucherEntryRecord/submitVoucher',
    method: 'post',
    data
  })
}
