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

const prefix = "dawn/api/v1/"

const limit = {
  getCreditLimitPages(params) {
    return post(prefix + 'group-credit-limit-pages', params)
  },
  getCreditLimitPlanPages(params) {
    return post(prefix + 'group-credit-limit-plan-pages', params)
  },
  getCreditLimitAssignmentPages(params) {
    return post(prefix + 'group-credit-limit-plan-user-pages', params)
  },
  addCreditLimitPlan(params) {
    return post(prefix + 'group-credit-limit-plans', params)
  },
  deleteCreditLimitPlan(groupCreditPlanId) {
    return del(prefix + 'group-credit-limit-plans/' + groupCreditPlanId)
  },
  addCreditLimit(params) {
    return post(prefix + 'group-credit-limits', params)
  },
  viewCreditLimit(groupCreditPk) {
    return get(prefix + 'group-credit-limits/' + groupCreditPk)
  },
  updateCreditLimit(params) {
    return put(prefix + 'group-credit-limits', params)
  },
  deleteCreditLimit(groupCreditPk) {
    return del(prefix + 'group-credit-limits/' + groupCreditPk)
  },
  assignCreditLimitPlanUser(params) {
    return post(prefix + "assign-group-credit-limit-plan-user", params)
  },
  unassignCreditLimitPlanUser(params) {
    return post(prefix + "unassign-group-credit-limit-plan-user", params)
  },
  approveCreditLimit(data) {
    return post(prefix + "group-credit-limit-approve", data)
  },
  rejectCreditLimit(data) {
    return post(prefix + "group-credit-limit-reject", data)
  },
  getSuspendStatusOptions() {
    return get(prefix + "suspend-status-select")
  },
  getContractStatusOptions() {
    return get(prefix + "contract-status-select")
  },
  getSuspendLimitAssignmentPages(params) {
    return post(prefix + 'group-credit-limit-plan-assigned-user-pages', params)
  },
  suspendCreditLimitPlanUser(params) {
    return post(prefix + "suspend-group-credit-limit-plan-user", params)
  },
  unsuspendCreditLimitPlanUser(params) {
    return post(prefix + "unsuspend-group-credit-limit-plan-user", params)
  }
}

export default limit;