36 lines
585 B
JavaScript
36 lines
585 B
JavaScript
|
|
import {
|
|
DataTypes
|
|
} from 'sequelize';
|
|
|
|
import {
|
|
DBLogger,
|
|
LabelDB
|
|
} from './db_conn.mjs'
|
|
|
|
import {
|
|
Printer
|
|
} from "./printer.model.mjs";
|
|
|
|
|
|
export const Queue = LabelDB.define('queue', {
|
|
id: {
|
|
type: DataTypes.UUID,
|
|
defaultValue: DataTypes.UUIDV4,
|
|
primaryKey: true
|
|
},
|
|
name: {
|
|
type: DataTypes.STRING,
|
|
allowNull: false
|
|
},
|
|
auto_print: {
|
|
type: DataTypes.BOOLEAN,
|
|
defaultValue: false,
|
|
allowNull: false
|
|
}
|
|
}, {
|
|
timestamps: false
|
|
});
|
|
|
|
Queue.belongsTo(Printer);
|
|
Printer.hasMany(Queue);
|