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

class PoliticalOfficeType extends Model {}

PoliticalOfficeType.init({
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true},
  name: {
    type: DataTypes.STRING,
    allowNull: false},
  seatsPerRegion: {
    type: DataTypes.INTEGER,
    allowNull: false},
  regionType: {
    type: DataTypes.STRING,
    allowNull: false},
  termLength: {                
    type: DataTypes.INTEGER,
    allowNull: false,
    defaultValue: 0}}, {
  sequelize,
  modelName: 'PoliticalOfficeType',
  tableName: 'political_office_type',
  schema: 'falukant_type',
  timestamps: false,
  underscored: true});

export default PoliticalOfficeType;
