const system = require("../../../system");
const Dao = require("../../dao.base");
class AuthDao extends Dao {
  constructor() {
    super(Dao.getModelName(AuthDao));
  }

  async all(saas_id, attrs) {
    attrs = attrs || "*";
    var sql = [];
    sql.push("SELECT");
    sql.push(attrs);
    sql.push("FROM uc_auth");
    sql.push("WHERE deleted_at IS NULL");
    var params = {};
    if(saas_id) {
      sql.push("AND saas_id = :saas_id");
      params.saas_id = saas_id;
    }
    return this.customQuery(sql.join(" "), params);
  }
}
module.exports = AuthDao;