-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient-schema.js
109 lines (90 loc) · 2.06 KB
/
client-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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* Schema for the user (i.e. the customer) accounts */
/* Mongoose is used for database functions */
const mongoose = require('mongoose');
const clientSchema = new mongoose.Schema({
/* Account username */
username: {
type: String,
required: true
},
/* Account password */
password : {
type: String,
required: true
},
/* First name of the account owner */
firstName: {
type: String,
required: true
},
/* Middle name of the account owner (optional) */
middleName: {
type: String,
required: false
},
/* Last name of the account owner */
lastName: {
type: String,
required: true
},
/* Account email address */
emailAddress: {
type: String,
required: true
},
/* Account contact number */
contactNumber: {
type: String,
required: true
},
/* Region of the delivery address */
region: {
type: String,
required: true
},
/* Province of the delivery address */
province: {
type: String,
required: true
},
/* City of the delivery address */
city: {
type: String,
required: true
},
/* Barangay of the delivery address */
barangay: {
type: String,
required: true
},
/* ZIP code of the delivery address */
zipCode: {
type: String,
required: true
},
/* Address proper (i.e., unit name/building name) of the delivery address */
address: {
type: String,
required: true
},
/* ObjectIDs of orders made by the user */
orderIds: {
type: [String],
required: false
},
currentOrder: {
type: String,
required: false
},
/* ObjectID of the user's message thread with the business owner */
threadId: {
type: String,
required: false
},
/* Account profile picture */
picture: {
type: String,
required: false
}
});
module.exports = mongoose.model('Client', clientSchema);