payservedb 1.8.6 → 1.8.8
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/index.js +98 -97
- package/package.json +15 -15
- package/src/models/apilog.js +18 -18
- package/src/models/archivedapilog.js +18 -18
- package/src/models/archivedauditlog.js +83 -83
- package/src/models/auditlog.js +83 -83
- package/src/models/bankdetails.js +40 -40
- package/src/models/combinedUnits.js +62 -62
- package/src/models/company.js +52 -52
- package/src/models/contract.js +42 -42
- package/src/models/customer.js +126 -126
- package/src/models/email.js +24 -24
- package/src/models/entry_exit.js +39 -43
- package/src/models/facility.js +39 -39
- package/src/models/facilityasset.js +25 -25
- package/src/models/guard.js +43 -47
- package/src/models/invoice.js +105 -105
- package/src/models/invoiceBillingSetting.js +29 -29
- package/src/models/levy.js +49 -49
- package/src/models/levytype.js +19 -19
- package/src/models/message.js +38 -38
- package/src/models/module.js +21 -21
- package/src/models/penalty.js +51 -51
- package/src/models/refresh_token.js +23 -23
- package/src/models/reminder.js +47 -47
- package/src/models/settings.js +19 -19
- package/src/models/sms_africastalking.js +20 -20
- package/src/models/sms_meliora.js +16 -16
- package/src/models/tax.js +35 -35
- package/src/models/unitasset.js +25 -25
- package/src/models/units.js +66 -66
- package/src/models/user.js +81 -81
- package/src/models/visitLog.js +72 -83
- package/src/models/visitor.js +50 -50
- package/src/models/waterConcentrator.js +50 -50
- package/src/models/waterMeter.js +50 -0
- package/src/models/waterMeterSetting.js +29 -29
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const BankDetailsSchema = new mongoose.Schema({
|
|
4
|
-
accountName: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
accountNumber: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true,
|
|
11
|
-
},
|
|
12
|
-
bankName: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
branchName: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
branchCode: {
|
|
21
|
-
type: String,
|
|
22
|
-
required: false,
|
|
23
|
-
},
|
|
24
|
-
bankCode: {
|
|
25
|
-
type: String,
|
|
26
|
-
required: false,
|
|
27
|
-
},
|
|
28
|
-
isDefault: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
facilityId: {
|
|
33
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
34
|
-
ref: 'Facility'
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const BankDetails = mongoose.model('BankDetails', BankDetailsSchema);
|
|
39
|
-
|
|
40
|
-
module.exports = BankDetails;
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const BankDetailsSchema = new mongoose.Schema({
|
|
4
|
+
accountName: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
accountNumber: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
bankName: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
branchName: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
branchCode: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: false,
|
|
23
|
+
},
|
|
24
|
+
bankCode: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
},
|
|
28
|
+
isDefault: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
facilityId: {
|
|
33
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
34
|
+
ref: 'Facility'
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const BankDetails = mongoose.model('BankDetails', BankDetailsSchema);
|
|
39
|
+
|
|
40
|
+
module.exports = BankDetails;
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
// Define the schema for companies
|
|
4
|
-
const combinedUnitSchema = new mongoose.Schema({
|
|
5
|
-
combinedUnitName: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: true
|
|
8
|
-
},
|
|
9
|
-
combinedDivision:{
|
|
10
|
-
type:String,
|
|
11
|
-
required:true
|
|
12
|
-
},
|
|
13
|
-
combinedUnitType:{
|
|
14
|
-
type:String,
|
|
15
|
-
required:true
|
|
16
|
-
},
|
|
17
|
-
combinedFloorUnit:{
|
|
18
|
-
type:String,
|
|
19
|
-
required:true
|
|
20
|
-
},
|
|
21
|
-
combinedLettableFloorArea:{
|
|
22
|
-
type:String,
|
|
23
|
-
required:false
|
|
24
|
-
},
|
|
25
|
-
combinedLRNumber:{
|
|
26
|
-
type:String,
|
|
27
|
-
required:true
|
|
28
|
-
},
|
|
29
|
-
combinedGrossArea:{
|
|
30
|
-
type:Number,
|
|
31
|
-
required:false
|
|
32
|
-
},
|
|
33
|
-
combinedNetLettableArea:{
|
|
34
|
-
type:Number,
|
|
35
|
-
required:false
|
|
36
|
-
},
|
|
37
|
-
combinedReason:{
|
|
38
|
-
type:String,
|
|
39
|
-
required:false
|
|
40
|
-
},
|
|
41
|
-
status:{
|
|
42
|
-
type:String,
|
|
43
|
-
required:true
|
|
44
|
-
},
|
|
45
|
-
selectedCombinedUnits:[],
|
|
46
|
-
facilityId:{
|
|
47
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
48
|
-
ref: 'Facility',
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, {
|
|
53
|
-
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// Indexes for improved performance
|
|
57
|
-
combinedUnitSchema.index({ name: 1 });
|
|
58
|
-
|
|
59
|
-
// Compile the model from the schema
|
|
60
|
-
const CombinedUnit = mongoose.model('CombinedUnit', combinedUnitSchema);
|
|
61
|
-
|
|
62
|
-
module.exports = CombinedUnit;
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for companies
|
|
4
|
+
const combinedUnitSchema = new mongoose.Schema({
|
|
5
|
+
combinedUnitName: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
combinedDivision:{
|
|
10
|
+
type:String,
|
|
11
|
+
required:true
|
|
12
|
+
},
|
|
13
|
+
combinedUnitType:{
|
|
14
|
+
type:String,
|
|
15
|
+
required:true
|
|
16
|
+
},
|
|
17
|
+
combinedFloorUnit:{
|
|
18
|
+
type:String,
|
|
19
|
+
required:true
|
|
20
|
+
},
|
|
21
|
+
combinedLettableFloorArea:{
|
|
22
|
+
type:String,
|
|
23
|
+
required:false
|
|
24
|
+
},
|
|
25
|
+
combinedLRNumber:{
|
|
26
|
+
type:String,
|
|
27
|
+
required:true
|
|
28
|
+
},
|
|
29
|
+
combinedGrossArea:{
|
|
30
|
+
type:Number,
|
|
31
|
+
required:false
|
|
32
|
+
},
|
|
33
|
+
combinedNetLettableArea:{
|
|
34
|
+
type:Number,
|
|
35
|
+
required:false
|
|
36
|
+
},
|
|
37
|
+
combinedReason:{
|
|
38
|
+
type:String,
|
|
39
|
+
required:false
|
|
40
|
+
},
|
|
41
|
+
status:{
|
|
42
|
+
type:String,
|
|
43
|
+
required:true
|
|
44
|
+
},
|
|
45
|
+
selectedCombinedUnits:[],
|
|
46
|
+
facilityId:{
|
|
47
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
48
|
+
ref: 'Facility',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
}, {
|
|
53
|
+
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Indexes for improved performance
|
|
57
|
+
combinedUnitSchema.index({ name: 1 });
|
|
58
|
+
|
|
59
|
+
// Compile the model from the schema
|
|
60
|
+
const CombinedUnit = mongoose.model('CombinedUnit', combinedUnitSchema);
|
|
61
|
+
|
|
62
|
+
module.exports = CombinedUnit;
|
package/src/models/company.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
// Define the schema for companies
|
|
4
|
-
const companySchema = new mongoose.Schema({
|
|
5
|
-
name: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: [true, 'Company name is required'],
|
|
8
|
-
trim: true,
|
|
9
|
-
minlength: [1, 'Company name must be at least 1 character long']
|
|
10
|
-
},
|
|
11
|
-
address: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: false
|
|
14
|
-
},
|
|
15
|
-
country: { type: String, required: false },
|
|
16
|
-
email: { type: String, required: true },
|
|
17
|
-
city: { type: String, required: true },
|
|
18
|
-
registrationNumber:{ type: String, required: true },
|
|
19
|
-
companyTaxNumber:{type:String,required:true},
|
|
20
|
-
logo: {
|
|
21
|
-
type: String,
|
|
22
|
-
trim: false,
|
|
23
|
-
default: null
|
|
24
|
-
},
|
|
25
|
-
isEnabled: { type: Boolean, default: false },
|
|
26
|
-
kyc: {
|
|
27
|
-
taxCertificate: {
|
|
28
|
-
type: String
|
|
29
|
-
},
|
|
30
|
-
Id: {
|
|
31
|
-
type: String
|
|
32
|
-
},
|
|
33
|
-
companyCertificate: {
|
|
34
|
-
type: String
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
facilities: [{
|
|
39
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
40
|
-
ref: 'Facility'
|
|
41
|
-
}]
|
|
42
|
-
}, {
|
|
43
|
-
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// Indexes for improved performance
|
|
47
|
-
companySchema.index({ name: 1 });
|
|
48
|
-
|
|
49
|
-
// Compile the model from the schema
|
|
50
|
-
const Company = mongoose.model('Company', companySchema);
|
|
51
|
-
|
|
52
|
-
module.exports = Company;
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for companies
|
|
4
|
+
const companySchema = new mongoose.Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: [true, 'Company name is required'],
|
|
8
|
+
trim: true,
|
|
9
|
+
minlength: [1, 'Company name must be at least 1 character long']
|
|
10
|
+
},
|
|
11
|
+
address: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
country: { type: String, required: false },
|
|
16
|
+
email: { type: String, required: true },
|
|
17
|
+
city: { type: String, required: true },
|
|
18
|
+
registrationNumber:{ type: String, required: true },
|
|
19
|
+
companyTaxNumber:{type:String,required:true},
|
|
20
|
+
logo: {
|
|
21
|
+
type: String,
|
|
22
|
+
trim: false,
|
|
23
|
+
default: null
|
|
24
|
+
},
|
|
25
|
+
isEnabled: { type: Boolean, default: false },
|
|
26
|
+
kyc: {
|
|
27
|
+
taxCertificate: {
|
|
28
|
+
type: String
|
|
29
|
+
},
|
|
30
|
+
Id: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
companyCertificate: {
|
|
34
|
+
type: String
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
facilities: [{
|
|
39
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'Facility'
|
|
41
|
+
}]
|
|
42
|
+
}, {
|
|
43
|
+
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Indexes for improved performance
|
|
47
|
+
companySchema.index({ name: 1 });
|
|
48
|
+
|
|
49
|
+
// Compile the model from the schema
|
|
50
|
+
const Company = mongoose.model('Company', companySchema);
|
|
51
|
+
|
|
52
|
+
module.exports = Company;
|
package/src/models/contract.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const contractSchema = new mongoose.Schema({
|
|
4
|
-
contractName: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
contractStart: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
contractEnd: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
levy: {
|
|
17
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
-
ref: 'Levy',
|
|
19
|
-
required: [true, 'Levy is required'],
|
|
20
|
-
},
|
|
21
|
-
units:[],
|
|
22
|
-
disabled: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
facilityId: {
|
|
27
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
28
|
-
ref: 'Facility',
|
|
29
|
-
required: true
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
// { timestamps: true }
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
contractSchema.index({ contractName: 1 });
|
|
36
|
-
|
|
37
|
-
const Contract = mongoose.model('Contract', contractSchema);
|
|
38
|
-
|
|
39
|
-
module.exports = Contract;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const contractSchema = new mongoose.Schema({
|
|
4
|
+
contractName: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
contractStart: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
contractEnd: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
levy: {
|
|
17
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
+
ref: 'Levy',
|
|
19
|
+
required: [true, 'Levy is required'],
|
|
20
|
+
},
|
|
21
|
+
units:[],
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
facilityId: {
|
|
27
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
28
|
+
ref: 'Facility',
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
// { timestamps: true }
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
contractSchema.index({ contractName: 1 });
|
|
36
|
+
|
|
37
|
+
const Contract = mongoose.model('Contract', contractSchema);
|
|
38
|
+
|
|
39
|
+
module.exports = Contract;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
package/src/models/customer.js
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const CustomerSchema = new mongoose.Schema({
|
|
4
|
-
customerNumber: {
|
|
5
|
-
type: Number,
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
firstName: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true,
|
|
11
|
-
},
|
|
12
|
-
lastName: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
phoneNumber: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
idNumber: {
|
|
21
|
-
type: String,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
email: {
|
|
25
|
-
type: String,
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
nextOfKinName: {
|
|
29
|
-
type: String,
|
|
30
|
-
required: true
|
|
31
|
-
},
|
|
32
|
-
nextOfKinRelationship: {
|
|
33
|
-
type: String,
|
|
34
|
-
required: true
|
|
35
|
-
},
|
|
36
|
-
nextOfKinContact: {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true
|
|
39
|
-
},
|
|
40
|
-
customerType: {
|
|
41
|
-
type: String,
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
residentType: {
|
|
45
|
-
type: String,
|
|
46
|
-
required: true
|
|
47
|
-
},
|
|
48
|
-
facilityId: {
|
|
49
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
50
|
-
ref: 'Facility'
|
|
51
|
-
},
|
|
52
|
-
status: {
|
|
53
|
-
type: String,
|
|
54
|
-
required: true,
|
|
55
|
-
enum: ['Active', 'Inactive']
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
familyMembers: [
|
|
59
|
-
{
|
|
60
|
-
name: {
|
|
61
|
-
type: String,
|
|
62
|
-
required: false,
|
|
63
|
-
},
|
|
64
|
-
phoneNumber: {
|
|
65
|
-
type: String,
|
|
66
|
-
required: false,
|
|
67
|
-
},
|
|
68
|
-
relation: {
|
|
69
|
-
type: String,
|
|
70
|
-
required: false,
|
|
71
|
-
},
|
|
72
|
-
qrCode: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
required: false
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
staff: [
|
|
79
|
-
{
|
|
80
|
-
name: {
|
|
81
|
-
type: String,
|
|
82
|
-
required: false,
|
|
83
|
-
},
|
|
84
|
-
phoneNumber: {
|
|
85
|
-
type: String,
|
|
86
|
-
required: false,
|
|
87
|
-
},
|
|
88
|
-
jobRole: {
|
|
89
|
-
type: String,
|
|
90
|
-
required: false,
|
|
91
|
-
},
|
|
92
|
-
qrCode: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
required: false
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
vehicles: [
|
|
99
|
-
{
|
|
100
|
-
registration: {
|
|
101
|
-
type: String,
|
|
102
|
-
required: false
|
|
103
|
-
},
|
|
104
|
-
name: {
|
|
105
|
-
type: String,
|
|
106
|
-
required: false
|
|
107
|
-
},
|
|
108
|
-
model: {
|
|
109
|
-
type: String,
|
|
110
|
-
required: false
|
|
111
|
-
},
|
|
112
|
-
plateNumber: {
|
|
113
|
-
type: String,
|
|
114
|
-
required: false
|
|
115
|
-
},
|
|
116
|
-
qrCode: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
required: false
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const Customer = mongoose.model('Customer', CustomerSchema);
|
|
125
|
-
|
|
126
|
-
module.exports = Customer;
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const CustomerSchema = new mongoose.Schema({
|
|
4
|
+
customerNumber: {
|
|
5
|
+
type: Number,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
firstName: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
lastName: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
phoneNumber: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
idNumber: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
email: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
nextOfKinName: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
nextOfKinRelationship: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
nextOfKinContact: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
customerType: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true
|
|
43
|
+
},
|
|
44
|
+
residentType: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
facilityId: {
|
|
49
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
50
|
+
ref: 'Facility'
|
|
51
|
+
},
|
|
52
|
+
status: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: true,
|
|
55
|
+
enum: ['Active', 'Inactive']
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
familyMembers: [
|
|
59
|
+
{
|
|
60
|
+
name: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: false,
|
|
63
|
+
},
|
|
64
|
+
phoneNumber: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: false,
|
|
67
|
+
},
|
|
68
|
+
relation: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: false,
|
|
71
|
+
},
|
|
72
|
+
qrCode: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
required: false
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
staff: [
|
|
79
|
+
{
|
|
80
|
+
name: {
|
|
81
|
+
type: String,
|
|
82
|
+
required: false,
|
|
83
|
+
},
|
|
84
|
+
phoneNumber: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false,
|
|
87
|
+
},
|
|
88
|
+
jobRole: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: false,
|
|
91
|
+
},
|
|
92
|
+
qrCode: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
required: false
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
vehicles: [
|
|
99
|
+
{
|
|
100
|
+
registration: {
|
|
101
|
+
type: String,
|
|
102
|
+
required: false
|
|
103
|
+
},
|
|
104
|
+
name: {
|
|
105
|
+
type: String,
|
|
106
|
+
required: false
|
|
107
|
+
},
|
|
108
|
+
model: {
|
|
109
|
+
type: String,
|
|
110
|
+
required: false
|
|
111
|
+
},
|
|
112
|
+
plateNumber: {
|
|
113
|
+
type: String,
|
|
114
|
+
required: false
|
|
115
|
+
},
|
|
116
|
+
qrCode: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
required: false
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const Customer = mongoose.model('Customer', CustomerSchema);
|
|
125
|
+
|
|
126
|
+
module.exports = Customer;
|