var APIBase = require("../../api.base");
var system = require("../../../system");

class InvoiceApi extends APIBase {
  constructor() {
    super();
    // this.orderSve = system.getObject("service.order.orderSve");
    // this.platformUtils = system.getObject("util.businessManager.opPlatformUtils");
    this.invoiceSve = system.getObject("service.invoice.invoiceSve");
  }

  async saveInvoiceApi(pobj, query, req) {
    pobj.creditCode = "91110105589080831E";
    try {
      return await this.invoiceSve.apiSaveInvoiceCNB(pobj);
    } catch (e) {
      console.log(e);
    }
    return result;
  }

  async invoiceListApi(pobj, query, req) {
    try {
      pobj.creditCode = "91110105589080831E";
      // pobj.businessmenCreditCode = "111";

      return await this.invoiceSve.apiInvoiceListCNB(pobj);
    } catch (e) {
      console.log(e);
    }
    return result;
  }

  exam() {
    return "";
  }

  classDesc() {
    return {
      groupName: "",
      groupDesc: "",
      name: "",
      desc: "",
      exam: "",
    };
  }

  methodDescs() {
    return [
      {
        methodDesc: "",
        methodName: "",
        paramdescs: [
          {
            paramDesc: "",
            paramName: "",
            paramType: "",
            defaultValue: "",
          }
        ],
        rtnTypeDesc: "",
        rtnType: ""
      }
    ];
  }
}

module.exports = InvoiceApi;