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 = "92410204MA477NWU0H";
    try {
      return await this.invoiceSve.apiSaveInvoiceCNB(pobj);
    } catch (e) {
      console.log(e);
    }
    return result;
  }

  async invoiceListApi(pobj, query, req) {
    try {
      pobj.businessmenCreditCode = "92410204MA477NWU0H";
      // 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;