import request from '@/config/axios'

// 平台每日结算信息表，记录店铺的结算信息 VO
export interface PtSettlementVO {
  // 结算id
  id: number
  // 平台代收金额
  platformCollectionAmount: number
  // 店铺应得金额
  shopAmount: number
  // 平台确认转帐完成时间
  platformTransferConfirmTime: Date
  // 高精度成本价格
  shopHighAmount: number
  // 共计成本价格(高精度的)
  shopTotalHighAmount: number
}

// 平台每日结算信息表，记录店铺的结算信息 API
export const PtSettlementApi = {
  // 查询平台每日结算信息表，记录店铺的结算信息分页
  getPtSettlementPage: async (params: any) => {
    return await request.get({ url: `/distri/pt-settlement/page`, params })
  },

  // 查询平台每日结算信息表，记录店铺的结算信息详情
  getPtSettlement: async (id: number) => {
    return await request.get({ url: `/distri/pt-settlement/get?id=` + id })
  },

  // 新增平台每日结算信息表，记录店铺的结算信息
  createPtSettlement: async (data: PtSettlementVO) => {
    return await request.post({ url: `/distri/pt-settlement/create`, data })
  },

  // 修改平台每日结算信息表，记录店铺的结算信息
  updatePtSettlement: async (data: PtSettlementVO) => {
    return await request.put({ url: `/distri/pt-settlement/update`, data })
  },

  // 删除平台每日结算信息表，记录店铺的结算信息
  deletePtSettlement: async (id: number) => {
    return await request.delete({ url: `/distri/pt-settlement/delete?id=` + id })
  },

  // 导出平台每日店铺结算信息表，记录店铺的结算信息 Excel
  exportPtSettlement: async (params) => {
    return await request.download({ url: `/distri/shop-settlement/export-excel`, params })
  },
  
 // 导出平台每日店铺结算信息付款单 网商银行
 exportPaymentList: async (params) => {
  return await request.download({ url: `/distri/pt-settlement/export-transfer-template`, params })
},
}