Files
yourpart3/backend/models/falukant/data/user.js
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

58 lines
1.4 KiB
JavaScript
Executable File

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
import RegionData from './region.js';
class FalukantUser extends Model { }
FalukantUser.init({
userId: {
type: DataTypes.INTEGER,
allowNull: false,
unique: true},
money: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
defaultValue: 0.00},
creditAmount: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
defaultValue: 0.00},
todayCreditTaken: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
defaultValue: 0.00},
creditInterestRate: {
type: DataTypes.DECIMAL(5, 2),
allowNull: false,
defaultValue: 0.00},
certificate: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 1},
certificateProductionsCountSince: {
type: DataTypes.DATE,
allowNull: true
},
mainBranchRegionId: {
type: DataTypes.INTEGER,
allowNull: true
},
lastNobilityAdvanceAt: {
type: DataTypes.DATE,
allowNull: true
},
lastPoliticalDailySalaryOn: {
type: DataTypes.DATEONLY,
allowNull: true,
field: 'last_political_daily_salary_on'
}
}, {
sequelize,
modelName: 'FalukantUser',
tableName: 'falukant_user',
schema: 'falukant_data',
timestamps: true,
underscored: true});
export default FalukantUser;