lfra_db 1.0.3 → 1.0.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/src/models/visitLog.js +36 -27
- package/src/models/visitor.js +15 -13
- package/src/models/waitlist.js +1 -2
package/package.json
CHANGED
package/src/models/visitLog.js
CHANGED
|
@@ -17,59 +17,68 @@ const visitLogSchema = new mongoose.Schema({
|
|
|
17
17
|
},
|
|
18
18
|
residentId: {
|
|
19
19
|
type: mongoose.Schema.Types.ObjectId,
|
|
20
|
+
ref: 'Resident',
|
|
21
|
+
required: false
|
|
20
22
|
},
|
|
21
|
-
|
|
22
|
-
type:
|
|
23
|
-
required:false
|
|
23
|
+
userId: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
qrCode: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: false
|
|
24
30
|
},
|
|
25
31
|
houseNumber: {
|
|
26
32
|
type: String,
|
|
27
33
|
required: false
|
|
28
34
|
},
|
|
35
|
+
phoneNumber: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
29
39
|
startTime: {
|
|
30
|
-
type:
|
|
40
|
+
type: Date, // Changed to Date for better handling of time
|
|
31
41
|
required: true
|
|
32
42
|
},
|
|
33
43
|
endTime: {
|
|
34
|
-
type: Date,
|
|
44
|
+
type: Date,
|
|
35
45
|
required: false
|
|
36
46
|
},
|
|
37
|
-
days:{
|
|
38
|
-
type:Number,
|
|
39
|
-
required:false
|
|
47
|
+
days: {
|
|
48
|
+
type: Number,
|
|
49
|
+
required: false
|
|
40
50
|
},
|
|
41
|
-
division:{
|
|
42
|
-
type:String,
|
|
43
|
-
required:false
|
|
51
|
+
division: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false
|
|
44
54
|
},
|
|
45
|
-
entryPoint:{
|
|
46
|
-
type:String,
|
|
47
|
-
required:false
|
|
55
|
+
entryPoint: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: false
|
|
48
58
|
},
|
|
49
|
-
exitPoint:{
|
|
50
|
-
type:String,
|
|
51
|
-
required:false
|
|
59
|
+
exitPoint: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: false
|
|
52
62
|
},
|
|
53
63
|
status: {
|
|
54
64
|
type: String,
|
|
55
65
|
required: true,
|
|
56
|
-
enum: ['Visit Confirmation', 'Scheduled', 'Checked In','Checked Out', 'Cancelled'] // Define valid statuses
|
|
57
|
-
// Define valid statuses
|
|
66
|
+
enum: ['Visit Confirmation', 'Scheduled', 'Checked In', 'Checked Out', 'Cancelled'] // Define valid statuses
|
|
58
67
|
},
|
|
59
68
|
vehicle: {
|
|
60
|
-
registration: String,
|
|
61
|
-
make: String,
|
|
62
|
-
color: String,
|
|
63
|
-
occupants: String,
|
|
69
|
+
registration: { type: String, required: false },
|
|
70
|
+
make: { type: String, required: false },
|
|
71
|
+
color: { type: String, required: false },
|
|
72
|
+
occupants: { type: String, required: false }
|
|
64
73
|
},
|
|
65
74
|
visitationCode: {
|
|
66
75
|
type: Number,
|
|
67
76
|
required: false
|
|
68
77
|
},
|
|
69
|
-
requestedBy:{
|
|
70
|
-
type:mongoose.Schema.Types.ObjectId,
|
|
71
|
-
ref:
|
|
72
|
-
required:false
|
|
78
|
+
requestedBy: {
|
|
79
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
80
|
+
ref: 'User',
|
|
81
|
+
required: false
|
|
73
82
|
},
|
|
74
83
|
facilityId: {
|
|
75
84
|
type: mongoose.Schema.Types.ObjectId,
|
package/src/models/visitor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
|
|
3
|
-
// Define the schema for
|
|
3
|
+
// Define the schema for visitors
|
|
4
4
|
const visitorSchema = new mongoose.Schema({
|
|
5
5
|
firstName: {
|
|
6
6
|
type: String,
|
|
@@ -26,36 +26,38 @@ const visitorSchema = new mongoose.Schema({
|
|
|
26
26
|
type: String,
|
|
27
27
|
required: false
|
|
28
28
|
},
|
|
29
|
-
status:{
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
status: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: false
|
|
32
32
|
},
|
|
33
33
|
type: {
|
|
34
34
|
type: String,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
enum: ["Staff", "Other", "Service Providers", "Government Officials/Agents", "Student", ""],
|
|
36
|
+
required: false
|
|
37
37
|
},
|
|
38
38
|
residentId: {
|
|
39
39
|
type: mongoose.Schema.Types.ObjectId,
|
|
40
40
|
ref: 'Customer',
|
|
41
|
+
required: false
|
|
41
42
|
},
|
|
42
43
|
facilityId: {
|
|
43
44
|
type: mongoose.Schema.Types.ObjectId,
|
|
44
45
|
ref: 'Facility',
|
|
46
|
+
required: false
|
|
45
47
|
},
|
|
46
|
-
invited:{
|
|
47
|
-
type:Boolean,
|
|
48
|
-
required:false
|
|
48
|
+
invited: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false,
|
|
51
|
+
default: false
|
|
49
52
|
},
|
|
50
|
-
invitationDate:{
|
|
51
|
-
type:
|
|
52
|
-
required:false
|
|
53
|
+
invitationDate: {
|
|
54
|
+
type: Date, // Changed to Date for better handling of dates
|
|
55
|
+
required: false
|
|
53
56
|
}
|
|
54
57
|
}, {
|
|
55
58
|
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
56
59
|
});
|
|
57
60
|
|
|
58
|
-
// Indexes for improved performance
|
|
59
61
|
// Compile the model from the schema
|
|
60
62
|
const Visitor = mongoose.model('Visitor', visitorSchema);
|
|
61
63
|
|
package/src/models/waitlist.js
CHANGED
|
@@ -33,8 +33,7 @@ const waitListSchema = new mongoose.Schema({
|
|
|
33
33
|
type: mongoose.Schema.Types.ObjectId,
|
|
34
34
|
ref: 'Facility',
|
|
35
35
|
required: true // Ensures a facilityId is always provided
|
|
36
|
-
}
|
|
37
|
-
|
|
36
|
+
}
|
|
38
37
|
}, {
|
|
39
38
|
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
40
39
|
});
|