@pintahub/database-schemas 4.5.0 → 4.6.1
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/.claude/settings.local.json +9 -0
- package/CLAUDE.md +16 -66
- package/package.json +1 -1
- package/schemas/Account.js +11 -1
- package/schemas/AnnouncementBar.js +12 -1
- package/schemas/Artwork.js +12 -1
- package/schemas/BlockedLocation.js +6 -0
- package/schemas/Collection.js +24 -0
- package/schemas/CreatorReport.js +33 -0
- package/schemas/CustomField.js +9 -0
- package/schemas/Customize.js +13 -0
- package/schemas/DimensionObject.js +3 -0
- package/schemas/ExportJob.js +19 -1
- package/schemas/FavoriteItem.js +8 -1
- package/schemas/FieldSetting.js +3 -0
- package/schemas/Fulfillment.js +13 -1
- package/schemas/Group.js +21 -1
- package/schemas/GroupArtwork.js +7 -1
- package/schemas/GroupItem.js +9 -1
- package/schemas/Image.js +8 -0
- package/schemas/ImageObject.js +6 -0
- package/schemas/LatestEvent.js +14 -0
- package/schemas/LogURL.js +7 -0
- package/schemas/MarketingCost.js +13 -0
- package/schemas/Media.js +11 -0
- package/schemas/MediaUpload.js +16 -1
- package/schemas/Menu.js +9 -0
- package/schemas/MenuItem.js +14 -0
- package/schemas/MoneyObject.js +3 -0
- package/schemas/Order.js +38 -1
- package/schemas/OrderItem.js +17 -1
- package/schemas/Payout.js +10 -1
- package/schemas/Post.js +19 -1
- package/schemas/PriceRange.js +6 -0
- package/schemas/Product.js +67 -5
- package/schemas/ProductFeature.js +26 -0
- package/schemas/ProductImage.js +15 -0
- package/schemas/ProductImport.js +26 -0
- package/schemas/ProductRaw.js +22 -0
- package/schemas/ProductReport.js +104 -0
- package/schemas/ProductTag.js +8 -1
- package/schemas/ProductType.js +9 -1
- package/schemas/Publication.js +7 -0
- package/schemas/RecentView.js +5 -1
- package/schemas/Review.js +18 -1
- package/schemas/SearchTerm.js +4 -0
- package/schemas/Shop.js +10 -0
- package/schemas/ShopifyAPI.js +11 -1
- package/schemas/ShopifyObject.js +14 -1
- package/schemas/ShortDomain.js +10 -1
- package/schemas/ShortLog.js +10 -0
- package/schemas/ShortUrl.js +14 -0
- package/schemas/Store.js +19 -1
- package/schemas/StoreEvent.js +13 -1
- package/schemas/StoreSetting.js +25 -1
- package/schemas/TrackPage.js +9 -1
- package/schemas/TransferJob.js +22 -0
- package/schemas/User.js +6 -0
- package/schemas/WebhookEvent.js +7 -1
- package/schemas/products/MediaObject.js +8 -0
- package/schemas/products/SeoObject.js +3 -0
- package/schemas/products/VideoObject.js +6 -0
- package/schemas/types/BrandSettings.js +3 -0
- package/schemas/types/DMCASetting.js +3 -0
- package/schemas/types/FacebookObject.js +3 -0
- package/schemas/types/FooterSetting.js +2 -0
- package/schemas/types/FreeShippingSetting.js +3 -0
- package/schemas/types/GoogleAnalytics.js +2 -0
- package/schemas/types/KlaviyoObject.js +3 -0
- package/schemas/types/MerchizeSettings.js +3 -0
- package/schemas/types/SocialsObject.js +8 -0
- package/schemas/types/TopBarSettings.js +2 -0
- package/schemas/types/TrustpilotObject.js +4 -0
package/schemas/Order.js
CHANGED
|
@@ -2,45 +2,54 @@ const {Schema} = require('mongoose')
|
|
|
2
2
|
const MoneyObject = require('./MoneyObject')
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
/** Embedded shipping address */
|
|
5
6
|
const ShippingAddress = new Schema({
|
|
6
7
|
_id: false,
|
|
7
8
|
|
|
9
|
+
/** Display name */
|
|
8
10
|
name: {
|
|
9
11
|
type: String,
|
|
10
12
|
trim: true
|
|
11
13
|
},
|
|
12
14
|
|
|
15
|
+
/** Street address line 1 */
|
|
13
16
|
address1: {
|
|
14
17
|
type: String,
|
|
15
18
|
trim: true
|
|
16
19
|
},
|
|
17
20
|
|
|
21
|
+
/** Street address line 2 */
|
|
18
22
|
address2: {
|
|
19
23
|
type: String,
|
|
20
24
|
trim: true
|
|
21
25
|
},
|
|
22
26
|
|
|
27
|
+
/** City */
|
|
23
28
|
city: {
|
|
24
29
|
type: String,
|
|
25
30
|
trim: true
|
|
26
31
|
},
|
|
27
32
|
|
|
33
|
+
/** State/Province */
|
|
28
34
|
province: {
|
|
29
35
|
type: String,
|
|
30
36
|
trim: true
|
|
31
37
|
},
|
|
32
38
|
|
|
39
|
+
/** ZIP/Postal code */
|
|
33
40
|
zip: {
|
|
34
41
|
type: String,
|
|
35
42
|
trim: true
|
|
36
43
|
},
|
|
37
44
|
|
|
45
|
+
/** Country code */
|
|
38
46
|
country: {
|
|
39
47
|
type: String,
|
|
40
48
|
trim: true,
|
|
41
49
|
index: true
|
|
42
50
|
},
|
|
43
51
|
|
|
52
|
+
/** Phone number */
|
|
44
53
|
phone: {
|
|
45
54
|
type: String,
|
|
46
55
|
trim: true
|
|
@@ -48,34 +57,41 @@ const ShippingAddress = new Schema({
|
|
|
48
57
|
})
|
|
49
58
|
|
|
50
59
|
|
|
60
|
+
/** Order with shipping, payment, and fulfillment tracking */
|
|
51
61
|
const Order = new Schema({
|
|
62
|
+
/** @ref Store */
|
|
52
63
|
store: {
|
|
53
64
|
type: Schema.Types.ObjectId,
|
|
54
65
|
index: true,
|
|
55
66
|
required: true
|
|
56
67
|
},
|
|
57
68
|
|
|
69
|
+
/** Shopify order ID */
|
|
58
70
|
id: {
|
|
59
71
|
type: String,
|
|
60
72
|
trim: true,
|
|
61
73
|
index: true
|
|
62
74
|
},
|
|
63
75
|
|
|
76
|
+
/** Order display name, e.g. '#1001' */
|
|
64
77
|
name: {
|
|
65
78
|
type: String,
|
|
66
79
|
trim: true,
|
|
67
80
|
index: true
|
|
68
81
|
},
|
|
69
82
|
|
|
83
|
+
/** Order number */
|
|
70
84
|
number: {
|
|
71
85
|
type: String,
|
|
72
86
|
trim: true
|
|
73
87
|
},
|
|
74
88
|
|
|
89
|
+
/** Customer shipping address */
|
|
75
90
|
shipping_address: {
|
|
76
91
|
type: ShippingAddress
|
|
77
92
|
},
|
|
78
93
|
|
|
94
|
+
/** e.g. 'fulfilled', 'unfulfilled', 'partial' */
|
|
79
95
|
fulfillment_status: {
|
|
80
96
|
type: String,
|
|
81
97
|
trim: true,
|
|
@@ -83,6 +99,7 @@ const Order = new Schema({
|
|
|
83
99
|
lowercase: true
|
|
84
100
|
},
|
|
85
101
|
|
|
102
|
+
/** e.g. 'paid', 'pending', 'refunded' */
|
|
86
103
|
financial_status: {
|
|
87
104
|
type: String,
|
|
88
105
|
trim: true,
|
|
@@ -90,6 +107,7 @@ const Order = new Schema({
|
|
|
90
107
|
lowercase: true
|
|
91
108
|
},
|
|
92
109
|
|
|
110
|
+
/** Cancellation status */
|
|
93
111
|
cancel_status: {
|
|
94
112
|
type: String,
|
|
95
113
|
trim: true,
|
|
@@ -97,94 +115,113 @@ const Order = new Schema({
|
|
|
97
115
|
lowercase: true
|
|
98
116
|
},
|
|
99
117
|
|
|
118
|
+
/** Order total amount */
|
|
100
119
|
total_price: {
|
|
101
120
|
type: MoneyObject
|
|
102
121
|
},
|
|
103
122
|
|
|
123
|
+
/** Shipping/fulfillment cost */
|
|
104
124
|
fulfillment_cost: {
|
|
105
125
|
type: MoneyObject
|
|
106
126
|
},
|
|
107
127
|
|
|
128
|
+
/** Payment processing fee */
|
|
108
129
|
transaction_fee: {
|
|
109
130
|
type: MoneyObject
|
|
110
131
|
},
|
|
111
132
|
|
|
133
|
+
/** Net payout amount */
|
|
112
134
|
payout: {
|
|
113
135
|
type: MoneyObject
|
|
114
136
|
},
|
|
115
137
|
|
|
138
|
+
/** Email address */
|
|
116
139
|
email: {
|
|
117
140
|
type: String,
|
|
118
141
|
trim: true,
|
|
119
142
|
index: true
|
|
120
143
|
},
|
|
121
144
|
|
|
145
|
+
/** Phone number */
|
|
122
146
|
phone: {
|
|
123
147
|
type: String,
|
|
124
148
|
trim: true,
|
|
125
149
|
index: true
|
|
126
150
|
},
|
|
127
151
|
|
|
152
|
+
/** Shopify order status page URL */
|
|
128
153
|
status_page_url: {
|
|
129
154
|
type: String,
|
|
130
155
|
trim: true
|
|
131
156
|
},
|
|
132
157
|
|
|
158
|
+
/** Last Shopify sync timestamp */
|
|
133
159
|
last_synced_at: {
|
|
134
160
|
type: Date,
|
|
135
161
|
default: Date.now
|
|
136
162
|
},
|
|
137
163
|
|
|
164
|
+
/** Last time a review notification was requested */
|
|
138
165
|
last_request_notify_at: {
|
|
139
166
|
type: Date,
|
|
140
167
|
index: true
|
|
141
168
|
},
|
|
142
169
|
|
|
170
|
+
/** Number of line items */
|
|
143
171
|
items_count: {
|
|
144
172
|
type: Number
|
|
145
173
|
},
|
|
146
174
|
|
|
175
|
+
/** Product vendors in this order */
|
|
147
176
|
vendors: {
|
|
148
177
|
type: [String],
|
|
149
178
|
trim: true,
|
|
150
179
|
index: true
|
|
151
180
|
},
|
|
152
181
|
|
|
182
|
+
/** Number of distinct vendors */
|
|
153
183
|
vendors_count: {
|
|
154
184
|
type: Number,
|
|
155
185
|
index: true
|
|
156
186
|
},
|
|
157
187
|
|
|
188
|
+
/** Payment gateway, e.g. 'shopify_payments', 'paypal' */
|
|
158
189
|
gateway: {
|
|
159
190
|
type: String,
|
|
160
191
|
trim: true,
|
|
161
192
|
index: true
|
|
162
193
|
},
|
|
163
194
|
|
|
195
|
+
/** Payment method */
|
|
164
196
|
payment_method: {
|
|
165
197
|
type: String,
|
|
166
198
|
trim: true
|
|
167
199
|
},
|
|
168
200
|
|
|
201
|
+
/** Customer's IP address */
|
|
169
202
|
browser_ip: {
|
|
170
203
|
type: String,
|
|
171
204
|
trim: true
|
|
172
205
|
},
|
|
173
206
|
|
|
207
|
+
/** Cancellation reason */
|
|
174
208
|
cancel_reason: {
|
|
175
209
|
type: String,
|
|
176
210
|
trim: true
|
|
177
211
|
},
|
|
178
212
|
|
|
213
|
+
/** When cancelled */
|
|
179
214
|
cancelled_at: {
|
|
180
215
|
type: Date
|
|
181
216
|
},
|
|
182
217
|
|
|
218
|
+
/** Last update timestamp */
|
|
183
219
|
updated_at: {
|
|
184
220
|
type: Date,
|
|
185
221
|
default: Date.now
|
|
186
222
|
},
|
|
187
223
|
|
|
224
|
+
/** Record creation timestamp */
|
|
188
225
|
created_at: {
|
|
189
226
|
type: Date,
|
|
190
227
|
default: Date.now,
|
|
@@ -192,6 +229,7 @@ const Order = new Schema({
|
|
|
192
229
|
}
|
|
193
230
|
})
|
|
194
231
|
|
|
232
|
+
/** Full-text search index */
|
|
195
233
|
Order.index({
|
|
196
234
|
name: 'text',
|
|
197
235
|
id: 'text',
|
|
@@ -201,4 +239,3 @@ Order.index({
|
|
|
201
239
|
})
|
|
202
240
|
|
|
203
241
|
module.exports = Order
|
|
204
|
-
|
package/schemas/OrderItem.js
CHANGED
|
@@ -2,88 +2,105 @@ const {Schema} = require('mongoose')
|
|
|
2
2
|
const MoneyObject = require('./MoneyObject')
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
/** Order line item */
|
|
5
6
|
const OrderItem = new Schema({
|
|
7
|
+
/** @ref Store */
|
|
6
8
|
store: {
|
|
7
9
|
type: Schema.Types.ObjectId,
|
|
8
10
|
index: true,
|
|
9
11
|
required: true,
|
|
10
12
|
},
|
|
11
13
|
|
|
14
|
+
/** @ref Order */
|
|
12
15
|
order: {
|
|
13
16
|
type: Schema.Types.ObjectId,
|
|
14
17
|
index: true,
|
|
15
18
|
required: true,
|
|
16
19
|
},
|
|
17
20
|
|
|
21
|
+
/** Shopify line item ID */
|
|
18
22
|
id: {
|
|
19
23
|
type: String,
|
|
20
24
|
trim: true,
|
|
21
25
|
index: true,
|
|
22
26
|
},
|
|
23
27
|
|
|
28
|
+
/** Cancellation status */
|
|
24
29
|
cancel_status: {
|
|
25
30
|
type: String,
|
|
26
31
|
trim: true,
|
|
27
32
|
index: true,
|
|
28
33
|
},
|
|
29
34
|
|
|
35
|
+
/** @ref Product */
|
|
30
36
|
product: {
|
|
31
37
|
type: Schema.Types.ObjectId,
|
|
32
38
|
index: true,
|
|
33
39
|
},
|
|
34
40
|
|
|
41
|
+
/** Item quantity */
|
|
35
42
|
quantity: {
|
|
36
43
|
type: Number,
|
|
37
44
|
default: 1,
|
|
38
45
|
},
|
|
39
46
|
|
|
47
|
+
/** Line item price */
|
|
40
48
|
price: {
|
|
41
49
|
type: MoneyObject,
|
|
42
50
|
},
|
|
43
51
|
|
|
52
|
+
/** Fulfillment status */
|
|
44
53
|
fulfillment_status: {
|
|
45
54
|
type: String,
|
|
46
55
|
trim: true,
|
|
47
56
|
lowercase: true,
|
|
48
57
|
},
|
|
49
58
|
|
|
59
|
+
/** Shopify product ID (string) */
|
|
50
60
|
product_id: {
|
|
51
61
|
type: String,
|
|
52
62
|
trim: true,
|
|
53
63
|
index: true,
|
|
54
64
|
},
|
|
55
65
|
|
|
66
|
+
/** Shopify variant ID */
|
|
56
67
|
variant_id: {
|
|
57
68
|
type: String,
|
|
58
69
|
trim: true,
|
|
59
70
|
},
|
|
60
71
|
|
|
72
|
+
/** Variant display title, e.g. 'Red / XL' */
|
|
61
73
|
variant_title: {
|
|
62
74
|
type: String,
|
|
63
75
|
trim: true,
|
|
64
76
|
},
|
|
65
77
|
|
|
78
|
+
/** Product type */
|
|
66
79
|
product_type: {
|
|
67
80
|
type: String,
|
|
68
81
|
trim: true,
|
|
69
82
|
index: true,
|
|
70
83
|
},
|
|
71
84
|
|
|
85
|
+
/** Product vendor */
|
|
72
86
|
vendor: {
|
|
73
87
|
type: String,
|
|
74
88
|
trim: true,
|
|
75
89
|
},
|
|
76
90
|
|
|
91
|
+
/** Shopify image ID for this line item */
|
|
77
92
|
image_id: {
|
|
78
93
|
type: String,
|
|
79
94
|
trim: true,
|
|
80
95
|
},
|
|
81
96
|
|
|
97
|
+
/** Last update timestamp */
|
|
82
98
|
updated_at: {
|
|
83
99
|
type: Date,
|
|
84
100
|
default: Date.now
|
|
85
101
|
},
|
|
86
102
|
|
|
103
|
+
/** Record creation timestamp */
|
|
87
104
|
created_at: {
|
|
88
105
|
type: Date,
|
|
89
106
|
default: Date.now,
|
|
@@ -92,4 +109,3 @@ const OrderItem = new Schema({
|
|
|
92
109
|
})
|
|
93
110
|
|
|
94
111
|
module.exports = OrderItem
|
|
95
|
-
|
package/schemas/Payout.js
CHANGED
|
@@ -2,19 +2,23 @@ const {Schema} = require('mongoose')
|
|
|
2
2
|
const MoneyObject = require('./MoneyObject')
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
/** Payment payout synced from Shopify */
|
|
5
6
|
const Payout = new Schema({
|
|
7
|
+
/** @ref Store */
|
|
6
8
|
store: {
|
|
7
9
|
type: Schema.Types.ObjectId,
|
|
8
10
|
index: true,
|
|
9
11
|
required: true,
|
|
10
12
|
},
|
|
11
13
|
|
|
14
|
+
/** Shopify payout ID */
|
|
12
15
|
id: {
|
|
13
16
|
type: String,
|
|
14
17
|
trim: true,
|
|
15
18
|
index: true,
|
|
16
19
|
},
|
|
17
20
|
|
|
21
|
+
/** Payout status, e.g. 'paid', 'pending' */
|
|
18
22
|
status: {
|
|
19
23
|
type: String,
|
|
20
24
|
trim: true,
|
|
@@ -22,31 +26,37 @@ const Payout = new Schema({
|
|
|
22
26
|
lowercase: true,
|
|
23
27
|
},
|
|
24
28
|
|
|
29
|
+
/** Net payout amount */
|
|
25
30
|
net: {
|
|
26
31
|
type: MoneyObject,
|
|
27
32
|
},
|
|
28
33
|
|
|
34
|
+
/** When the payout was issued */
|
|
29
35
|
issued_at: {
|
|
30
36
|
type: Date,
|
|
31
37
|
index: true,
|
|
32
38
|
},
|
|
33
39
|
|
|
40
|
+
/** Payout type, e.g. 'deposit', 'withdrawal' */
|
|
34
41
|
type: {
|
|
35
42
|
type: String,
|
|
36
43
|
trim: true,
|
|
37
44
|
lowercase: true,
|
|
38
45
|
},
|
|
39
46
|
|
|
47
|
+
/** Last sync from Shopify */
|
|
40
48
|
synced_at: {
|
|
41
49
|
type: Date,
|
|
42
50
|
default: Date.now,
|
|
43
51
|
},
|
|
44
52
|
|
|
53
|
+
/** Last update timestamp */
|
|
45
54
|
updated_at: {
|
|
46
55
|
type: Date,
|
|
47
56
|
default: Date.now
|
|
48
57
|
},
|
|
49
58
|
|
|
59
|
+
/** Record creation timestamp */
|
|
50
60
|
created_at: {
|
|
51
61
|
type: Date,
|
|
52
62
|
default: Date.now,
|
|
@@ -56,4 +66,3 @@ const Payout = new Schema({
|
|
|
56
66
|
|
|
57
67
|
|
|
58
68
|
module.exports = Payout
|
|
59
|
-
|
package/schemas/Post.js
CHANGED
|
@@ -2,23 +2,28 @@ const {Schema} = require('mongoose')
|
|
|
2
2
|
const ImageObject = require('./ImageObject')
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
/** Embedded blog post author */
|
|
5
6
|
const AuthorObject = new Schema({
|
|
6
7
|
_id: false,
|
|
7
8
|
|
|
9
|
+
/** Display name */
|
|
8
10
|
name: {
|
|
9
11
|
type: String,
|
|
10
12
|
trim: true,
|
|
11
13
|
},
|
|
12
14
|
})
|
|
13
15
|
|
|
16
|
+
/** Embedded SEO metadata */
|
|
14
17
|
const SEOObject = new Schema({
|
|
15
18
|
_id: false,
|
|
16
19
|
|
|
20
|
+
/** Display title */
|
|
17
21
|
title: {
|
|
18
22
|
type: String,
|
|
19
23
|
trim: true,
|
|
20
24
|
},
|
|
21
25
|
|
|
26
|
+
/** Description */
|
|
22
27
|
description: {
|
|
23
28
|
type: String,
|
|
24
29
|
trim: true,
|
|
@@ -26,68 +31,82 @@ const SEOObject = new Schema({
|
|
|
26
31
|
})
|
|
27
32
|
|
|
28
33
|
|
|
34
|
+
/** Blog post */
|
|
29
35
|
const Post = new Schema({
|
|
36
|
+
/** @ref Store */
|
|
30
37
|
store: {
|
|
31
38
|
type: Schema.Types.ObjectId,
|
|
32
39
|
index: true,
|
|
33
40
|
required: true,
|
|
34
41
|
},
|
|
35
42
|
|
|
43
|
+
/** Shopify post ID */
|
|
36
44
|
id: {
|
|
37
45
|
type: String,
|
|
38
46
|
trim: true,
|
|
39
47
|
index: true,
|
|
40
48
|
},
|
|
41
49
|
|
|
50
|
+
/** URL-friendly slug */
|
|
42
51
|
handle: {
|
|
43
52
|
type: String,
|
|
44
53
|
trim: true,
|
|
45
54
|
index: true,
|
|
46
55
|
},
|
|
47
56
|
|
|
57
|
+
/** Display title */
|
|
48
58
|
title: {
|
|
49
59
|
type: String,
|
|
50
60
|
trim: true,
|
|
51
61
|
},
|
|
52
62
|
|
|
63
|
+
/** Full post content in HTML */
|
|
53
64
|
body_html: {
|
|
54
65
|
type: String,
|
|
55
66
|
trim: true,
|
|
56
67
|
},
|
|
57
68
|
|
|
69
|
+
/** Short excerpt/summary */
|
|
58
70
|
excerpt: {
|
|
59
71
|
type: String,
|
|
60
72
|
trim: true,
|
|
61
73
|
},
|
|
62
74
|
|
|
75
|
+
/** Post author */
|
|
63
76
|
author: {
|
|
64
77
|
type: AuthorObject,
|
|
65
78
|
},
|
|
66
79
|
|
|
80
|
+
/** Tags */
|
|
67
81
|
tags: {
|
|
68
82
|
type: [String],
|
|
69
83
|
index: true,
|
|
70
84
|
trim: true,
|
|
71
85
|
},
|
|
72
86
|
|
|
87
|
+
/** SEO metadata */
|
|
73
88
|
seo: {
|
|
74
89
|
type: SEOObject,
|
|
75
90
|
},
|
|
76
91
|
|
|
92
|
+
/** Featured image */
|
|
77
93
|
featured_image: {
|
|
78
94
|
type: ImageObject,
|
|
79
95
|
},
|
|
80
96
|
|
|
97
|
+
/** Publish date */
|
|
81
98
|
published_at: {
|
|
82
99
|
type: Date,
|
|
83
100
|
index: true,
|
|
84
101
|
},
|
|
85
102
|
|
|
103
|
+
/** Last update timestamp */
|
|
86
104
|
updated_at: {
|
|
87
105
|
type: Date,
|
|
88
106
|
default: Date.now
|
|
89
107
|
},
|
|
90
108
|
|
|
109
|
+
/** Record creation timestamp */
|
|
91
110
|
created_at: {
|
|
92
111
|
type: Date,
|
|
93
112
|
default: Date.now,
|
|
@@ -96,4 +115,3 @@ const Post = new Schema({
|
|
|
96
115
|
})
|
|
97
116
|
|
|
98
117
|
module.exports = Post
|
|
99
|
-
|
package/schemas/PriceRange.js
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
const {Schema} = require('mongoose')
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
/** Embedded price with currency */
|
|
4
5
|
const PriceObject = new Schema({
|
|
5
6
|
_id: false,
|
|
6
7
|
|
|
8
|
+
/** Price amount */
|
|
7
9
|
amount: {
|
|
8
10
|
type: Number,
|
|
9
11
|
},
|
|
10
12
|
|
|
13
|
+
/** ISO 4217 currency code, default 'USD' */
|
|
11
14
|
currencyCode: {
|
|
12
15
|
type: String,
|
|
13
16
|
default: 'USD',
|
|
14
17
|
}
|
|
15
18
|
})
|
|
16
19
|
|
|
20
|
+
/** Embedded product price range (min/max variant prices) */
|
|
17
21
|
const PriceRange = new Schema({
|
|
18
22
|
_id: false,
|
|
19
23
|
|
|
24
|
+
/** Lowest variant price */
|
|
20
25
|
minVariantPrice: {
|
|
21
26
|
type: PriceObject,
|
|
22
27
|
},
|
|
23
28
|
|
|
29
|
+
/** Highest variant price */
|
|
24
30
|
maxVariantPrice: {
|
|
25
31
|
type: PriceObject,
|
|
26
32
|
}
|