@cendo/database-schemas 1.8.4 → 1.8.6
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 +12 -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({
|
|
@@ -125,6 +126,17 @@ const Order = new Schema({
|
|
|
125
126
|
default: {}
|
|
126
127
|
},
|
|
127
128
|
|
|
129
|
+
attachments: {
|
|
130
|
+
type: [AttachmentObject],
|
|
131
|
+
default: []
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
tags: {
|
|
135
|
+
type: [String],
|
|
136
|
+
default: [],
|
|
137
|
+
index: true
|
|
138
|
+
},
|
|
139
|
+
|
|
128
140
|
updated_at: {
|
|
129
141
|
type: Date,
|
|
130
142
|
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
|