Files
yourpart3/backend/models/falukant/data/director.js
Torsten Schulz (local) 42d0652e48
All checks were successful
Deploy to production / deploy (push) Successful in 1m54s
feat(Director): add autoAdjustIncome feature and enhance director data handling
- Introduced a new boolean field `autoAdjustIncome` in the Director model to manage income adjustments automatically.
- Updated the FalukantService to include `autoAdjustIncome` in director data responses and settings management.
- Enhanced the DirectorInfo component to allow users to toggle the `autoAdjustIncome` setting.
- Updated internationalization files to include translations for the new feature across multiple languages.
2026-05-07 13:29:09 +02:00

54 lines
1.3 KiB
JavaScript

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},
autoAdjustIncome: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false},
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;