@cendo/database-schemas 1.8.3 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/schemas/Order.js +11 -0
- package/schemas/types/AttachmentObject.js +20 -0
package/package.json
CHANGED
package/schemas/Order.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const {Schema} = require('mongoose')
|
|
2
2
|
const ShippingAddress = require('./types/ShippingAddress')
|
|
3
3
|
const MoneyObject = require('./types/MoneyObject')
|
|
4
|
+
const AttachmentObject = require('./types/AttachmentObject')
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
const Order = new Schema({
|
|
@@ -120,6 +121,16 @@ const Order = new Schema({
|
|
|
120
121
|
default: {}
|
|
121
122
|
},
|
|
122
123
|
|
|
124
|
+
logistic_data: {
|
|
125
|
+
type: Schema.Types.Mixed,
|
|
126
|
+
default: {}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
attachments: {
|
|
130
|
+
type: [AttachmentObject],
|
|
131
|
+
default: []
|
|
132
|
+
},
|
|
133
|
+
|
|
123
134
|
updated_at: {
|
|
124
135
|
type: Date,
|
|
125
136
|
default: Date.now
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const {Schema} = require('mongoose')
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const AttachmentObject = new Schema({
|
|
5
|
+
_id: false,
|
|
6
|
+
|
|
7
|
+
type: {
|
|
8
|
+
type: String,
|
|
9
|
+
trim: true,
|
|
10
|
+
required: true,
|
|
11
|
+
enum: ['image'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
url: {
|
|
15
|
+
type: String,
|
|
16
|
+
trim: true,
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
module.exports = AttachmentObject
|