// models/falukant/predefine/political_office_prerequisite.js

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

class PoliticalOfficePrerequisite extends Model {}

PoliticalOfficePrerequisite.init({
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true},

  // Neu: Feld heißt jetzt eindeutig "office_type_id"
  officeTypeId: {
    type: DataTypes.INTEGER,
    field: 'office_type_id',
    allowNull: false},

  prerequisite: {
    type: DataTypes.JSONB,
    allowNull: false}}, {
  sequelize,
  modelName: 'PoliticalOfficePrerequisite',
  tableName: 'political_office_prerequisite',
  schema: 'falukant_predefine',
  timestamps: false,
  underscored: true});

export default PoliticalOfficePrerequisite;
