"use strict";
const {
Model
} = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class Command extends Model {
static associate(models) {
Command.belongsToMany(models.Sandwich, {through: {model: models.SandwichCommand, unique: false}});
Command.belongsTo(models.Department);
Command.belongsTo(models.User);
}
Command.init({
firstName: {
type: DataTypes.STRING,
allowNull: false
},
lastName: {
date: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
price: {
type: DataTypes.FLOAT,
}, {
sequelize,
modelName: "Command",
});
return Command;
};