13 lines
402 B
JavaScript
13 lines
402 B
JavaScript
|
const mongoose = require('mongoose');
|
||
|
|
||
|
const orderSchema = mongoose.Schema({
|
||
|
address: {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}
|
||
|
}]
|
||
|
});
|