Implemented adding the component to the viewer and the search in database. Fixed bug in search of item list
16 lines
500 B
JavaScript
16 lines
500 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const orderSchema = mongoose.Schema({
|
|
address: {type: String, required: true},
|
|
session: {type: String, required: true},
|
|
timestamp: {type: Date, required: true, default: Date.now},
|
|
closed: { type: Boolean, required: true, default:false },
|
|
lines: [{
|
|
qty: {type: Number, required: true, default: 1},
|
|
item: { type: String, required: true},
|
|
cost: { type: Number, required: true, default: 0}
|
|
}]
|
|
});
|
|
|
|
module.exports = mongoose.model('Order', orderSchema);
|