import {del, download, get, post, put} from '../http'

const apiUser = {
  getGroupTypeOptions() {
    return get("group/group-type-select")
  },
  getGroupByType(type) {
    return get("group/group-select", {groupType: type})
  },
  getUserTypeOptions() {
    return get("device-user/user-types")
  },
  pageAppUsers(params) {
    return post("device-user/user-pages", params)
  },
  getAppUserInfo(userPk) {
    return get('device-user/users/' + userPk)
  },
  addAppUser(data) {
    return post('device-user/users', data)
  },
  updateAppUser(data) {
    return put('device-user/users', data)
  },
  getAppUserInfo(userPk) {
    return get('device-user/users/' + userPk)
  },
  deleteAppUser(userPk) {
    return del('device-user/users/' + userPk)
  },
  approveUserMembership(membershipId) {
    return put('device-user/membership-pass/' + membershipId)
  },
  rejectUserMembership(membershipId) {
    return put('device-user/membership-reject/' + membershipId)
  },
  deleteUserMembership(membershipId) {
    return del('device-user/membership-delete/' + membershipId)
  },
  deleteUserVehicle(vehiclePk) {
    return del('device-user/user-vehicles/' + vehiclePk)
  },
  downloadTemplate() {
    return download('device-user/download-template')
  },
  userTopup(params) {
    return post("device-user/manual-top-up", params)
  },
  pageChargeHistory(params) {
    return post("device-user/charging-history", params)
  },
  pageTopupHistory(params) {
    return post("device-user/top-up-history", params)
  }
}
  
export default apiUser;