Files
yourpart3/backend/models/falukant/data/production.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

40 lines
1.0 KiB
JavaScript
Executable File

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
import WeatherType from '../type/weather.js';
class Production extends Model { }
Production.init({
branchId: {
type: DataTypes.INTEGER,
allowNull: false},
productId: {
type: DataTypes.INTEGER,
allowNull: false},
quantity: {
type: DataTypes.INTEGER,
allowNull: false},
weatherTypeId: {
type: DataTypes.INTEGER,
allowNull: true,
comment: 'Wetter zum Zeitpunkt der Produktionserstellung'
},
startTimestamp: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.literal('CURRENT_TIMESTAMP')},
sleep: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
comment: 'Produktion ist zurückgestellt'}
}, {
sequelize,
modelName: 'Production',
tableName: 'production',
schema: 'falukant_data',
timestamps: false,
underscored: true});
export default Production;