"use strict";
const common_js_net_http = require("./http.js");
const common_js_cache_storage = require("../cache/storage.js");
const apiPath = {
  mineInvoiceOrderList: "/api/invoicerecharge/recharge-listpage/{userId}/{status}",
  //可以开具发票的订单
  mineInvoiceList: "/api/invoice-config/listpage/{userId}",
  //我的开票信息
  saveInvoiceInfo: "/api/invoice-config/save/{userId}",
  //保存开票信息
  updateInvoiceInfo: "/api/invoice-config/update/{invoiceId}",
  //修改开票信息
  deleteInvoiceInfo: "/api/invoice-config/remove/{ids}",
  //删除开票信息
  mineInvoiceRecordList: "/api/invoicerecharge/listpage/{userId}",
  //我的开票记录
  saveInvoiceRecord: "/api/invoicerecharge/save/{userId}",
  // 保存开票申请
  updateInvoiceRecord: "/api/invoicerecharge/update/{invoiceRechargeId}",
  //修改开票申请
  cancelInvoiceRecord: "/api/invoicerecharge/cancel/{invoiceRechargeId}",
  //取消开票申请
  dicByPId: "/api/data/listbyparentid/{pId}"
  //数据字典
};
class InvoiceApi {
  //获取可以开具发票的订单
  static doGetMineInvoiceOrderList(data, status) {
    const userId = common_js_cache_storage.get("userId");
    const path = apiPath.mineInvoiceOrderList.replace("{userId}", userId).replace("{status}", status);
    return common_js_net_http.request(path, "GET", data, null, "plug");
  }
  static doGetDicListByPId(id) {
    const path = apiPath.dicByPId.replace("{pId}", id);
    return common_js_net_http.request(path, "GET");
  }
  //我的开票信息
  static doGetMineInvoiceList(data) {
    const userId = common_js_cache_storage.get("userId");
    const path = apiPath.mineInvoiceList.replace("{userId}", userId);
    return common_js_net_http.request(path, "GET", data, null, "plug");
  }
  //保存我的开票信息
  static doSaveMineInvoiceInfo(data) {
    const userId = common_js_cache_storage.get("userId");
    const path = apiPath.saveInvoiceInfo.replace("{userId}", userId);
    return common_js_net_http.request(path, "POST", data, null, "plug");
  }
  //编辑开票信息
  static doUpdateMineInvoiceInfo(id, data) {
    const path = apiPath.updateInvoiceInfo.replace("{invoiceId}", id);
    return common_js_net_http.request(path, "PUT", data, null, "plug");
  }
  //删除开票信息
  static doDelMineInvoiceInfo(id) {
    const path = apiPath.deleteInvoiceInfo.replace("{ids}", id);
    return common_js_net_http.request(path, "DELETE", null, null, "plug");
  }
  //开票申请列表
  static doGetInvoiceRecordList(data) {
    const userId = common_js_cache_storage.get("userId");
    const path = apiPath.mineInvoiceRecordList.replace("{userId}", userId);
    return common_js_net_http.request(path, "GET", data, null, "plug");
  }
  //取消开票申请
  static doCancelInvoiceRecord(id) {
    const path = apiPath.cancelInvoiceRecord.replace("{invoiceRechargeId}", id);
    return common_js_net_http.request(path, "PUT", null, null, "plug");
  }
  //提交开票申请
  static doSaveInvoiceRecord(data) {
    const userId = common_js_cache_storage.get("userId");
    const path = apiPath.saveInvoiceRecord.replace("{userId}", userId);
    return common_js_net_http.request(path, "POST", data, null, "plug");
  }
  //修改开票申请
  static doUpdateInvoiceRecord(id, data) {
    const path = apiPath.updateInvoiceRecord.replace("{invoiceRechargeId}", id);
    return common_js_net_http.request(path, "PUT", data, null, "plug");
  }
}
exports.InvoiceApi = InvoiceApi;
//# sourceMappingURL=../../../../.sourcemap/mp-toutiao/common/js/net/InvoiceApi.js.map
