payservedb 4.3.7 → 4.3.9

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.
Files changed (82) hide show
  1. package/.env +2 -2
  2. package/index.js +152 -152
  3. package/package.json +17 -17
  4. package/src/models/account.js +36 -36
  5. package/src/models/analog_water_billing.js +58 -58
  6. package/src/models/apilog.js +18 -18
  7. package/src/models/archivedapilog.js +18 -18
  8. package/src/models/archivedauditlog.js +83 -83
  9. package/src/models/asset.js +34 -34
  10. package/src/models/auditlog.js +83 -83
  11. package/src/models/bankdetails.js +40 -40
  12. package/src/models/budget.js +33 -33
  13. package/src/models/budgetCategory.js +19 -19
  14. package/src/models/campaigns.js +72 -72
  15. package/src/models/cashpayment.js +185 -185
  16. package/src/models/combinedUnits.js +62 -62
  17. package/src/models/company.js +53 -53
  18. package/src/models/country_tax.js +42 -42
  19. package/src/models/currency_settings.js +39 -39
  20. package/src/models/customer.js +178 -178
  21. package/src/models/default_payment_details.js +17 -17
  22. package/src/models/dutyroster.js +39 -39
  23. package/src/models/email.js +24 -24
  24. package/src/models/entry_exit.js +53 -53
  25. package/src/models/expense.js +55 -55
  26. package/src/models/facility.js +58 -58
  27. package/src/models/facility_payment_details.js +20 -20
  28. package/src/models/facilityasset.js +25 -25
  29. package/src/models/faq.js +18 -18
  30. package/src/models/guard.js +47 -47
  31. package/src/models/handover.js +241 -241
  32. package/src/models/invoice.js +210 -252
  33. package/src/models/item_inspection.js +67 -67
  34. package/src/models/leaseagreement.js +156 -156
  35. package/src/models/leasetemplate.js +17 -17
  36. package/src/models/levy.js +72 -72
  37. package/src/models/levy_invoice_settings.js +26 -26
  38. package/src/models/levycontract.js +65 -65
  39. package/src/models/levytype.js +23 -23
  40. package/src/models/maintenance_service_vendor.js +38 -38
  41. package/src/models/maintenance_services.js +17 -17
  42. package/src/models/maintenancerequisition.js +31 -31
  43. package/src/models/message.js +38 -38
  44. package/src/models/module.js +21 -21
  45. package/src/models/notification.js +24 -24
  46. package/src/models/penalty.js +76 -76
  47. package/src/models/refresh_token.js +23 -23
  48. package/src/models/reminder.js +161 -161
  49. package/src/models/report.js +13 -13
  50. package/src/models/resident.js +121 -121
  51. package/src/models/service_charge_invoice_upload.js +42 -42
  52. package/src/models/service_charge_payments.js +27 -27
  53. package/src/models/servicerequest.js +55 -55
  54. package/src/models/settings.js +62 -62
  55. package/src/models/smart_meter_daily_consumption.js +44 -44
  56. package/src/models/sms_africastalking.js +20 -20
  57. package/src/models/sms_meliora.js +16 -16
  58. package/src/models/staff.js +36 -36
  59. package/src/models/stocksandspare.js +34 -34
  60. package/src/models/tickets.js +109 -109
  61. package/src/models/unitasset.js +25 -25
  62. package/src/models/units.js +70 -70
  63. package/src/models/user.js +94 -94
  64. package/src/models/valueaddedservices.js +36 -36
  65. package/src/models/vas_invoices_upload.js +50 -50
  66. package/src/models/vas_payments.js +24 -24
  67. package/src/models/vasinvoice.js +159 -159
  68. package/src/models/vasvendor.js +57 -57
  69. package/src/models/visitLog.js +86 -86
  70. package/src/models/visitor.js +63 -63
  71. package/src/models/waitlist.js +45 -45
  72. package/src/models/water_invoice.js +192 -192
  73. package/src/models/water_meter_account.js +74 -73
  74. package/src/models/water_meter_communication.js +17 -17
  75. package/src/models/water_meter_concentrator.js +59 -59
  76. package/src/models/water_meter_iot_cards.js +34 -34
  77. package/src/models/water_meter_manufacturer.js +35 -35
  78. package/src/models/water_meter_settings.js +88 -101
  79. package/src/models/water_meter_size.js +15 -15
  80. package/src/models/water_meters.js +110 -110
  81. package/src/models/water_meters_delivery.js +76 -76
  82. package/src/models/workorder.js +49 -49
@@ -1,40 +1,40 @@
1
- const mongoose = require('mongoose');
2
-
3
- const dutyRosterSchema = new mongoose.Schema({
4
- facilityId: {
5
- type: mongoose.Schema.Types.ObjectId,
6
- ref: 'Facility',
7
- required: true,
8
- },
9
- name: {
10
- type: String,
11
- required: true,
12
- },
13
- phone: {
14
- type: String,
15
- required: true,
16
- },
17
- activity: {
18
- type: String,
19
- required: true,
20
- },
21
- time: {
22
- type: String,
23
- required: true
24
- },
25
- schedule: [{
26
- date: {
27
- type: Date,
28
- required: true
29
- },
30
- status: {
31
- type: String,
32
- enum: ['pending', 'completed', 'missed', 'rescheduled'],
33
- default: 'pending'
34
- }
35
- }]
36
- }, {
37
- timestamps: true
38
- });
39
-
1
+ const mongoose = require('mongoose');
2
+
3
+ const dutyRosterSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ required: true,
8
+ },
9
+ name: {
10
+ type: String,
11
+ required: true,
12
+ },
13
+ phone: {
14
+ type: String,
15
+ required: true,
16
+ },
17
+ activity: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+ time: {
22
+ type: String,
23
+ required: true
24
+ },
25
+ schedule: [{
26
+ date: {
27
+ type: Date,
28
+ required: true
29
+ },
30
+ status: {
31
+ type: String,
32
+ enum: ['pending', 'completed', 'missed', 'rescheduled'],
33
+ default: 'pending'
34
+ }
35
+ }]
36
+ }, {
37
+ timestamps: true
38
+ });
39
+
40
40
  module.exports = mongoose.model('DutyRoster', dutyRosterSchema);
@@ -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
@@ -1,53 +1,53 @@
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
- type: {
14
- type: String,
15
- enum: ['Point'],
16
- required: true
17
- },
18
- coordinates: {
19
- type: [Number], // [longitude, latitude] format
20
- required: true,
21
- validate: {
22
- validator: function (value) {
23
- return value.length === 2;
24
- },
25
- message: 'Coordinates must have longitude and latitude'
26
- }
27
- }
28
- },
29
- range: {
30
- type: Number,
31
- required: true
32
- },
33
- disabled: {
34
- type: Boolean,
35
- required: true
36
- },
37
- purpose: {
38
- type: String,
39
- required: true,
40
- enum: ['entry/exit', 'entry', 'exit', 'emergency exit']
41
- },
42
- facilityId: {
43
- type: mongoose.Schema.Types.ObjectId,
44
- ref: 'Facility',
45
- }
46
- });
47
-
48
- // Create a 2dsphere index on the gps field to support geospatial queries
49
- EntryExitSchema.index({ gps: '2dsphere' });
50
-
51
- const EntryExit = mongoose.model('EntryExit', EntryExitSchema);
52
-
53
- module.exports = EntryExit;
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
+ type: {
14
+ type: String,
15
+ enum: ['Point'],
16
+ required: true
17
+ },
18
+ coordinates: {
19
+ type: [Number], // [longitude, latitude] format
20
+ required: true,
21
+ validate: {
22
+ validator: function (value) {
23
+ return value.length === 2;
24
+ },
25
+ message: 'Coordinates must have longitude and latitude'
26
+ }
27
+ }
28
+ },
29
+ range: {
30
+ type: Number,
31
+ required: true
32
+ },
33
+ disabled: {
34
+ type: Boolean,
35
+ required: true
36
+ },
37
+ purpose: {
38
+ type: String,
39
+ required: true,
40
+ enum: ['entry/exit', 'entry', 'exit', 'emergency exit']
41
+ },
42
+ facilityId: {
43
+ type: mongoose.Schema.Types.ObjectId,
44
+ ref: 'Facility',
45
+ }
46
+ });
47
+
48
+ // Create a 2dsphere index on the gps field to support geospatial queries
49
+ EntryExitSchema.index({ gps: '2dsphere' });
50
+
51
+ const EntryExit = mongoose.model('EntryExit', EntryExitSchema);
52
+
53
+ module.exports = EntryExit;
@@ -1,56 +1,56 @@
1
- const mongoose = require('mongoose');
2
-
3
- const expenseSchema = new mongoose.Schema({
4
- facilityId: {
5
- type: mongoose.Schema.Types.ObjectId,
6
- ref: 'Facility',
7
- required: true
8
- },
9
- categoryId: {
10
- type: mongoose.Schema.Types.ObjectId,
11
- ref: 'BudgetCategory',
12
- required: true
13
- },
14
- name: {
15
- type: String,
16
- required: true,
17
- trim: true
18
- },
19
- amount: {
20
- type: Number,
21
- required: true
22
- },
23
- type: {
24
- type: String,
25
- enum: ['RECURRING', 'ONE_TIME'],
26
- required: true
27
- },
28
- date: {
29
- type: Date,
30
- required: true,
31
- default: Date.now
32
- },
33
- status: {
34
- type: String,
35
- enum: ['PAID', 'UNPAID'],
36
- default: 'UNPAID'
37
- },
38
- approval: {
39
- type: Boolean,
40
- default: false
41
- },
42
- description: {
43
- type: String,
44
- trim: true
45
- },
46
- receiptUrl: {
47
- type: String,
48
- trim: true
49
- }
50
- }, {
51
- timestamps: true
52
- });
53
-
54
- const Expense = mongoose.model('Expense', expenseSchema);
55
-
1
+ const mongoose = require('mongoose');
2
+
3
+ const expenseSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ required: true
8
+ },
9
+ categoryId: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'BudgetCategory',
12
+ required: true
13
+ },
14
+ name: {
15
+ type: String,
16
+ required: true,
17
+ trim: true
18
+ },
19
+ amount: {
20
+ type: Number,
21
+ required: true
22
+ },
23
+ type: {
24
+ type: String,
25
+ enum: ['RECURRING', 'ONE_TIME'],
26
+ required: true
27
+ },
28
+ date: {
29
+ type: Date,
30
+ required: true,
31
+ default: Date.now
32
+ },
33
+ status: {
34
+ type: String,
35
+ enum: ['PAID', 'UNPAID'],
36
+ default: 'UNPAID'
37
+ },
38
+ approval: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ description: {
43
+ type: String,
44
+ trim: true
45
+ },
46
+ receiptUrl: {
47
+ type: String,
48
+ trim: true
49
+ }
50
+ }, {
51
+ timestamps: true
52
+ });
53
+
54
+ const Expense = mongoose.model('Expense', expenseSchema);
55
+
56
56
  module.exports = Expense;
@@ -1,58 +1,58 @@
1
- const mongoose = require('mongoose');
2
-
3
- // Define the schema for facilities
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
- modules: {
23
- visitor: { type: Boolean, },
24
- levy: { type: Boolean, },
25
- maintenance: { type: Boolean, },
26
- lease: { type: Boolean, },
27
- vas: { type: Boolean, },
28
- tickets: { type: Boolean, },
29
- utility: { type: Boolean, },
30
- booking: { type: Boolean, },
31
- handover: { type: Boolean, },
32
- expense: { type: Boolean, },
33
- },
34
-
35
- logo: {
36
- type: String,
37
- trim: false,
38
- default: null
39
- },
40
- dbName: {
41
- type: String,
42
- required: [true, 'Database name is required'],
43
- unique: true,
44
- trim: true
45
- }
46
-
47
- }, {
48
- timestamps: true // Automatically add createdAt and updatedAt fields
49
- });
50
-
51
- // Indexes for improved performance
52
- facilitySchema.index({ name: 1 });
53
- facilitySchema.index({ dbName: 1 });
54
-
55
- // Compile the model from the schema
56
- const Facility = mongoose.model('Facility', facilitySchema);
57
-
58
- module.exports = Facility;
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for facilities
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
+ modules: {
23
+ visitor: { type: Boolean, },
24
+ levy: { type: Boolean, },
25
+ maintenance: { type: Boolean, },
26
+ lease: { type: Boolean, },
27
+ vas: { type: Boolean, },
28
+ tickets: { type: Boolean, },
29
+ utility: { type: Boolean, },
30
+ booking: { type: Boolean, },
31
+ handover: { type: Boolean, },
32
+ expense: { type: Boolean, },
33
+ },
34
+
35
+ logo: {
36
+ type: String,
37
+ trim: false,
38
+ default: null
39
+ },
40
+ dbName: {
41
+ type: String,
42
+ required: [true, 'Database name is required'],
43
+ unique: true,
44
+ trim: true
45
+ }
46
+
47
+ }, {
48
+ timestamps: true // Automatically add createdAt and updatedAt fields
49
+ });
50
+
51
+ // Indexes for improved performance
52
+ facilitySchema.index({ name: 1 });
53
+ facilitySchema.index({ dbName: 1 });
54
+
55
+ // Compile the model from the schema
56
+ const Facility = mongoose.model('Facility', facilitySchema);
57
+
58
+ module.exports = Facility;
@@ -1,21 +1,21 @@
1
- const mongoose = require("mongoose");
2
-
3
- const facilityPaymentDetailsSchema = new mongoose.Schema({
4
- facility: {
5
- type: mongoose.Schema.Types.ObjectId,
6
- },
7
- shortCode: { type: String },
8
- passkey: { type: String },
9
- authorizationKey: {
10
- type: String,
11
- },
12
- module: {
13
- type: String,
14
- enum: ["All", "Water", "Electricity", "Levy","Lease"],
15
- default: "All"
16
- },
17
- });
18
-
19
- const FacilityPaymentDetails = mongoose.model('FacilityPaymentDetails', facilityPaymentDetailsSchema);
20
-
1
+ const mongoose = require("mongoose");
2
+
3
+ const facilityPaymentDetailsSchema = new mongoose.Schema({
4
+ facility: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ },
7
+ shortCode: { type: String },
8
+ passkey: { type: String },
9
+ authorizationKey: {
10
+ type: String,
11
+ },
12
+ module: {
13
+ type: String,
14
+ enum: ["All", "Water", "Electricity", "Levy","Lease"],
15
+ default: "All"
16
+ },
17
+ });
18
+
19
+ const FacilityPaymentDetails = mongoose.model('FacilityPaymentDetails', facilityPaymentDetailsSchema);
20
+
21
21
  module.exports = FacilityPaymentDetails;
@@ -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;
package/src/models/faq.js CHANGED
@@ -1,18 +1,18 @@
1
- // models/apiLog.js
2
- const mongoose = require('mongoose');
3
- const { Schema } = mongoose;
4
-
5
- const faqSchema = new Schema({
6
- question:{type:String,required:true},
7
- answer:{type:String,required:true},
8
- facilityId: {
9
- type: mongoose.Schema.Types.ObjectId,
10
- ref: 'Facility'
11
- },
12
- });
13
-
14
-
15
-
16
- const FAQ = mongoose.model('FAQ', faqSchema);
17
-
18
- module.exports = FAQ;
1
+ // models/apiLog.js
2
+ const mongoose = require('mongoose');
3
+ const { Schema } = mongoose;
4
+
5
+ const faqSchema = new Schema({
6
+ question:{type:String,required:true},
7
+ answer:{type:String,required:true},
8
+ facilityId: {
9
+ type: mongoose.Schema.Types.ObjectId,
10
+ ref: 'Facility'
11
+ },
12
+ });
13
+
14
+
15
+
16
+ const FAQ = mongoose.model('FAQ', faqSchema);
17
+
18
+ module.exports = FAQ;