Füge neue Modelle für Produktion, Inventar und kaufbare Bestände hinzu; aktualisiere bestehende Modelle und Routen

This commit is contained in:
Torsten Schulz
2024-12-23 10:37:43 +01:00
parent 1bb2bd49d5
commit 6f7d97672e
15 changed files with 1143 additions and 44 deletions

View File

@@ -0,0 +1,33 @@
import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.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,
},
startTimestamp: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
}
}, {
sequelize,
modelName: 'Production',
tableName: 'production',
schema: 'falukant_data',
timestamps: false,
underscored: true,
});
export default Production;