2021-10-25 17:49:50 +00:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
const orderSchema = mongoose.Schema({
|
|
|
|
address: {type: String, required: true},
|
2021-10-25 20:01:06 +00:00
|
|
|
session: {type: String, required: true},
|
2021-10-25 17:49:50 +00:00
|
|
|
timestamp: {type: Date, required: true, default: Date.now},
|
|
|
|
closed: { type: Boolean, required: true, default:false },
|
2021-11-05 13:21:19 +00:00
|
|
|
price: { type: Number, required: true},
|
2021-11-05 14:30:35 +00:00
|
|
|
total: { type: Number},
|
|
|
|
totalZec: {type: Number},
|
2021-10-25 17:49:50 +00:00
|
|
|
lines: [{
|
|
|
|
qty: {type: Number, required: true, default: 1},
|
2021-10-27 20:21:55 +00:00
|
|
|
name: { type: String, required: true},
|
2021-10-25 17:49:50 +00:00
|
|
|
cost: { type: Number, required: true, default: 0}
|
|
|
|
}]
|
|
|
|
});
|
2021-10-25 20:01:06 +00:00
|
|
|
|
|
|
|
module.exports = mongoose.model('Order', orderSchema);
|