'use strict';
const { Model } = require('sequelize');
const { defaultKeys, modelDefaults, actionUsers } = require('../sequelize/defaults');
module.exports = (sequelize, DataTypes) => {
  class Branch extends Model {
    static associate(models) {
      actionUsers(Branch, models);
    }
  }

  Branch.init({
    ...defaultKeys("branch_id"),
    branch_name: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    active_status: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: 1,
    },
  }, modelDefaults(sequelize, 'branches'));
  return Branch;
};