-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder-item-schema.js
76 lines (62 loc) · 1.84 KB
/
order-item-schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* Schema for the order items */
/* Mongoose is used for database functions */
const mongoose = require('mongoose');
const orderItemSchema = new mongoose.Schema({
/* Order name (optional) */
/* ObjectID of the product*/
productId: {
type: String,
required: true
},
/* Quantity to be ordered */
quantity: {
type: Number,
required: true
},
/* Type of packaging */
packaging: {
type: String,
required: false
},
/* Color of packaging */
packagingColor: {
type: String,
required: false
},
/* Message to be included on packaging */
packagingMessage: {
type: String,
required: false
},
/* Color of the product */
itemColor: {
type: String,
required: false
},
/* Text to be printed on the product */
itemText: {
type: String,
required: false
},
/* Whether the company logo will be placed on the order item */
includeCompanyLogo: {
type: String,
required: false
},
/* Items on which the company logo is to be placed (i.e. the product itself or the packaging) */
companyLogoLocation: {
type: [String],
required: false
},
/* Additional requests or instructions the customer wishes to include */
additionalInstructions: {
type: String,
required: false
},
/* Total price for the order item (i.e. unit price multiplied by quantity) */
orderItemPrice: {
type: Number,
required: true
}
});
module.exports = mongoose.model('OrderItem', orderItemSchema);