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

class Director extends Model { }

Director.init({
    directorCharacterId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    employerUserId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    income: {
        type: DataTypes.INTEGER,
        allowNull: false},
    satisfaction: {
        type: DataTypes.INTEGER,
        allowNull: false,
        defaultValue: 100},
    mayProduce: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true},
    maySell: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true},
    mayStartTransport: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true},
    mayRepairVehicles: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true},
    lastSalaryPayout: {
        type: DataTypes.DATE,
        allowNull: false,
        defaultValue: new Date(0)
    }
}, {
    sequelize,
    modelName: 'Director',
    tableName: 'director',
    schema: 'falukant_data',
    timestamps: false,
    underscored: true});

export default Director;
