payservedb 1.2.2 → 1.2.4

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.
@@ -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;
@@ -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;
@@ -1,76 +1,114 @@
1
- const mongoose = require('mongoose');
2
-
3
- const CustomerSchema = new mongoose.Schema({
4
- firstName: {
5
- type: String,
6
- required: true,
7
- },
8
- lastName: {
9
- type: String,
10
- required: true,
11
- },
12
- phoneNumber: {
13
- type: String,
14
- required: true,
15
- },
16
- idNumber: {
17
- type: String,
18
- required: true,
19
- },
20
- vehicleRegistration: {
21
- type: String,
22
- required: true,
23
- },
24
- familyMembers: [
25
- {
26
- name: {
27
- type: String,
28
- required: true,
29
- },
30
- phoneNumber: {
31
- type: String,
32
- required: true,
33
- },
34
- relation: {
35
- type: String,
36
- required: true,
37
- },
38
- },
39
- ],
40
- staff: [
41
- {
42
- name: {
43
- type: String,
44
- required: true,
45
- },
46
- phoneNumber: {
47
- type: String,
48
- required: true,
49
- },
50
- jobRole: {
51
- type: String,
52
- required: true,
53
- },
54
- },
55
- ],
56
- vehicles: [
57
- {
58
- name: {
59
- type: String,
60
- required: true,
61
- },
62
- model: {
63
- type: String,
64
- required: true,
65
- },
66
- plateNumber: {
67
- type: String,
68
- required: true,
69
- },
70
- },
71
- ],
72
- });
73
-
74
- const Customer = mongoose.model('Customer', CustomerSchema);
75
-
76
- 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
+ },
73
+ ],
74
+ staff: [
75
+ {
76
+ name: {
77
+ type: String,
78
+ required: false,
79
+ },
80
+ phoneNumber: {
81
+ type: String,
82
+ required: false,
83
+ },
84
+ jobRole: {
85
+ type: String,
86
+ required: false,
87
+ },
88
+ },
89
+ ],
90
+ vehicles: [
91
+ {
92
+ registration: {
93
+ type: String,
94
+ required: false
95
+ },
96
+ name: {
97
+ type: String,
98
+ required: false
99
+ },
100
+ model: {
101
+ type: String,
102
+ required: false
103
+ },
104
+ plateNumber: {
105
+ type: String,
106
+ required: false
107
+ },
108
+ },
109
+ ],
110
+ });
111
+
112
+ const Customer = mongoose.model('Customer', CustomerSchema);
113
+
114
+ module.exports = Customer;
@@ -1,25 +1,25 @@
1
- const mongoose = require('mongoose');
2
- const EmailSchema = mongoose.Schema({
3
- user: {
4
- type: String,
5
- required: true
6
- },
7
- from: {
8
- type: String,
9
- required: true
10
- },
11
- host: {
12
- type: String,
13
- required: true
14
- },
15
- port: {
16
- type: Number,
17
- required: true
18
- },
19
- auth: {
20
- user: String,
21
- pass: String
22
- }
23
- })
24
- const Email = mongoose.model('Email', EmailSchema);
1
+ const mongoose = require('mongoose');
2
+ const EmailSchema = mongoose.Schema({
3
+ user: {
4
+ type: String,
5
+ required: true
6
+ },
7
+ from: {
8
+ type: String,
9
+ required: true
10
+ },
11
+ host: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ port: {
16
+ type: Number,
17
+ required: true
18
+ },
19
+ auth: {
20
+ user: String,
21
+ pass: String
22
+ }
23
+ })
24
+ const Email = mongoose.model('Email', EmailSchema);
25
25
  module.exports = Email
@@ -0,0 +1,35 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const EntryExitSchema = mongoose.Schema({
4
+ name: {
5
+ type: String,
6
+ required: true
7
+ },
8
+ location: {
9
+ type: String,
10
+ required: true,
11
+ },
12
+ gps: {
13
+ lat: {
14
+ type: Number,
15
+ required: true
16
+ },
17
+ lng: {
18
+ type: Number,
19
+ required: true
20
+ }
21
+ },
22
+ purpose: {
23
+ type: String,
24
+ required: true,
25
+ enum: ['entry/exit', 'entry', 'exit', 'emergency exit']
26
+ },
27
+ facilityId: {
28
+ type: mongoose.Schema.Types.ObjectId,
29
+ ref: 'Facility',
30
+ }
31
+ });
32
+
33
+ const EntryExit = mongoose.model('EntryExit', EntryExitSchema);
34
+
35
+ module.exports = EntryExit;
@@ -1,39 +1,39 @@
1
- const mongoose = require('mongoose');
2
-
3
- // Define the schema for companies
4
- const facilitySchema = new mongoose.Schema({
5
- name: {
6
- type: String,
7
- required: [true, 'Facility name is required'],
8
- trim: true,
9
- minlength: [1, 'Facility name must be at least 1 character long']
10
- },
11
- location:{
12
- type:String,
13
- required:true
14
- },
15
- subDivision:{type:String,required:true},
16
- isEnabled:{type:Boolean,required:true},
17
- divisionArray:[],
18
- landReferenceNumbers:[],
19
- defaultMeasurement:{type:String,required:false},
20
- totalCommonArea:{type:String,required:false},
21
- totalLettableArea:{type:String,required:false},
22
-
23
- logo: {
24
- type: String,
25
- trim: false,
26
- default: null
27
- }
28
-
29
- }, {
30
- timestamps: true // Automatically add createdAt and updatedAt fields
31
- });
32
-
33
- // Indexes for improved performance
34
- facilitySchema.index({ name: 1 });
35
-
36
- // Compile the model from the schema
37
- const Facility = mongoose.model('Facility', facilitySchema);
38
-
39
- module.exports = Facility;
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for companies
4
+ const facilitySchema = new mongoose.Schema({
5
+ name: {
6
+ type: String,
7
+ required: [true, 'Facility name is required'],
8
+ trim: true,
9
+ minlength: [1, 'Facility name must be at least 1 character long']
10
+ },
11
+ location:{
12
+ type:String,
13
+ required:true
14
+ },
15
+ subDivision:{type:String,required:true},
16
+ isEnabled:{type:Boolean,required:true},
17
+ divisionArray:[],
18
+ landReferenceNumbers:[],
19
+ defaultMeasurement:{type:String,required:false},
20
+ totalCommonArea:{type:String,required:false},
21
+ totalLettableArea:{type:String,required:false},
22
+
23
+ logo: {
24
+ type: String,
25
+ trim: false,
26
+ default: null
27
+ }
28
+
29
+ }, {
30
+ timestamps: true // Automatically add createdAt and updatedAt fields
31
+ });
32
+
33
+ // Indexes for improved performance
34
+ facilitySchema.index({ name: 1 });
35
+
36
+ // Compile the model from the schema
37
+ const Facility = mongoose.model('Facility', facilitySchema);
38
+
39
+ module.exports = Facility;
@@ -1,25 +1,25 @@
1
- const mongoose = require('mongoose');
2
-
3
- // Define the schema for companies
4
- const facilityassetSchema = new mongoose.Schema({
5
- name: {
6
- type: String,
7
- required:true
8
- },
9
- facilityId:{
10
- type: mongoose.Schema.Types.ObjectId,
11
- ref: 'Facility',
12
- }
13
-
14
-
15
- }, {
16
- timestamps: true // Automatically add createdAt and updatedAt fields
17
- });
18
-
19
- // Indexes for improved performance
20
- facilityassetSchema.index({ name: 1 });
21
-
22
- // Compile the model from the schema
23
- const FacilityAsset = mongoose.model('FacilityAsset', facilityassetSchema);
24
-
25
- module.exports = FacilityAsset;
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for companies
4
+ const facilityassetSchema = new mongoose.Schema({
5
+ name: {
6
+ type: String,
7
+ required:true
8
+ },
9
+ facilityId:{
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'Facility',
12
+ }
13
+
14
+
15
+ }, {
16
+ timestamps: true // Automatically add createdAt and updatedAt fields
17
+ });
18
+
19
+ // Indexes for improved performance
20
+ facilityassetSchema.index({ name: 1 });
21
+
22
+ // Compile the model from the schema
23
+ const FacilityAsset = mongoose.model('FacilityAsset', facilityassetSchema);
24
+
25
+ module.exports = FacilityAsset;