import {get, post} from '../http'

const MODULE_NAME = 'siteManagement'

const site = {
  getAllSiteList: (params) => {
    return get('siteManagement/getAllSiteList', params)
  },
  getRateTypeList: () => {
    return get(`${MODULE_NAME}/getRateTypeList`)
  },
  getTypeList: () => {
    return get(`${MODULE_NAME}/getChargeTypes`)
  },
  getChargeTypeList: () => {
    return get(`${MODULE_NAME}/getChargeTypeList`)
  },
  getSiteTypeList: () => {
    return get(`${MODULE_NAME}/getSiteTypeList`)
  },
  addSite: (data) => {
    return post(`${MODULE_NAME}/addSite`, data)
  },
  getSiteList: (data) => {
    return post(`${MODULE_NAME}/getSitePages`, data)
  },
  updateSite: (data) => {
    return post(`${MODULE_NAME}/updateSite`, data)
  },
  getSiteInfo: (data) => {
    return get(`${MODULE_NAME}/getSiteInfo`, data)
  },
  deleteChargeRate: (params) => {
    return get(`${MODULE_NAME}/delChargeRate`, params)
  },
  deleteWhitelistUser: (params) => {
    return get(`${MODULE_NAME}/delWhitelistUser`, params)
  },
  deleteWhitelistFleet: (params) => {
    return get(`${MODULE_NAME}/delGroupWhitelist`, params)
  },
  getCountryList: () => {
    return get(`${MODULE_NAME}/getCountryList`)
  },
  deleteSite: (params) => {
    return get(`${MODULE_NAME}/delSite`, params)
  },
  getChargingProfiles() {
    return get(MODULE_NAME+ '/getChargingProfiles')
  },
  getBalancingChargingProfiles(params) {
    return get(MODULE_NAME+ '/getLoadBalancingChargingProfiles', params)
  },
  getBalancingOptions() {
    return get(MODULE_NAME+ '/getLoadBalancingList')
  },
  deleteChargingProfile(id) {
    return get(MODULE_NAME+ '/delSiteChargingProfile', {siteChargingProfileId: id})
  }
}

export default site;