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

const prefix = "dawn/api/v1/"

const transaction = {
  getTransactionFilters: () => get('transaction/getTransactionFilters'),
  getTransactionStatus() {
    return get(prefix + "transaction/status")
  },
  getTransactionPages: (params) => post('transaction/getTransactionPages', params),
  getTransactionPagesV2(params) {
    return post(prefix + 'transaction/pages', params)
  },
  getTransactionDetail: (params) => get('transaction/getTransactionDetail', params),
  getTransactionDetailV2(params) {
    return get(prefix + 'transaction/details/' + params.chargingPk, params)
  },
  downloadInvoice: (chargingPk) => download('transaction/downloadInvoice', {transactionPk: chargingPk}),
  getMeasurandOptions: () => get('transaction/getMeasurands'),
  getMeasurandOptionsV2() {
    return get(prefix + 'transaction/measurands')
  },
  endTransaction: (params) => get('transaction/endTransaction', params),
  endTransactionV2(params) {
    return post(prefix + 'transaction/manual-settlement', params)
  } 
}

export default transaction;