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

class ElectionResult extends Model {}

ElectionResult.init({
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true},
  electionId: {
    type: DataTypes.INTEGER,
    allowNull: false},
  candidateId: {
    type: DataTypes.INTEGER,
    allowNull: false},
  votesReceived: {
    type: DataTypes.INTEGER,
    allowNull: false}}, {
  sequelize,
  modelName: 'ElectionResult',
  tableName: 'election_result',
  schema: 'falukant_data',
  timestamps: true,
  underscored: true});

export default ElectionResult;
