var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
var cacheBaseComp = null;

class BusinesstypeCtl extends CtlBase {
    constructor() {
        super("configmag", CtlBase.getServiceName(BusinesstypeCtl));
    }

    async refQuery(pobj, qobj, req) {
        pobj.refwhere.company_id = pobj.company_id;
        let rtn = await this.service.refQuery(pobj);
        return rtn
    }

    async create(pobj, qobj, req) {
        if(!pobj.p_id || pobj.p_id.length<1){
            pobj["p_id"] = 0;
        }
        const up = await this.service.create(pobj);
        return system.getResult(up);
      }
}

module.exports = BusinesstypeCtl;
