import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';

class Branch extends Model { }

Branch.init({
    branchTypeId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    regionId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    falukantUserId: {
        type: DataTypes.INTEGER,
        allowNull: false}}, {
    sequelize,
    modelName: 'Branch',
    tableName: 'branch',
    schema: 'falukant_data',
    timestamps: false,
    underscored: true,
    indexes: [
        {
            unique: true,
            fields: ['region_id', 'falukant_user_id']
        }
    ]});

export default Branch;
