Files
yourpart3/backend/models/falukant/log/moneyflow.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

38 lines
911 B
JavaScript
Executable File

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
class MoneyFlow extends Model { }
MoneyFlow.init({
falukantUserId: {
type: DataTypes.INTEGER,
allowNull: false},
activity: {
type: DataTypes.STRING,
allowNull: false},
moneyBefore: {
type: DataTypes.DOUBLE,
allowNull: false},
moneyAfter: {
type: DataTypes.DOUBLE,
allowNull: true},
time: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW
},
changeValue: {
type: DataTypes.DOUBLE,
allowNull: false},
changedBy: {
type: DataTypes.INTEGER,
allowNull: true}}, {
sequelize,
modelName: 'MoneyFlow',
tableName: 'moneyflow',
schema: 'falukant_log',
timestamps: false,
underscored: true});
export default MoneyFlow;