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

  async getById (id) {
    return await this.model.findOne(id)
  }

  async deleteById (id) {
    return await this.model.destroy({
      where: {
        id: id
      }
    })
  }

  async deleteByParentId (id) {
    return await this.model.destroy({
      where: {
        parent_id: id
      }
    })
  }
}
module.exports = productItemDao;