payservedb 10.0.2 → 10.0.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.
package/index.js CHANGED
@@ -163,6 +163,8 @@ const models = {
163
163
  MonthlyWaterMeterHistory: require("./src/models/water_meter_monthly_history"),
164
164
  WaterPrepaidCredit: require("./src/models/water_prepaid_credit"),
165
165
  WaterPrepaidDebit: require("./src/models/water_prepaid_debit"),
166
+ WaterSensorGateway: require("./src/models/water_sensor_gateway"),
167
+ WaterSensorSettings: require("./src/models/water_sensor_settings"),
166
168
  MeterLog: require("./src/models/water_meter_communication_logs"),
167
169
  CashPayment: require("./src/models/cashpayment"),
168
170
  VasPayment: require("./src/models/vas_payments"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "10.0.2",
3
+ "version": "10.0.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,33 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const waterSensorGatewaySchema = new mongoose.Schema({
4
+ gatewayId: {
5
+ type: String,
6
+ required: true,
7
+ trim: true,
8
+ unique: true
9
+ },
10
+ facilityId: {
11
+ type: mongoose.Schema.Types.ObjectId,
12
+ ref: 'Facility',
13
+ required: true,
14
+ index: true
15
+ },
16
+ name: {
17
+ type: String,
18
+ trim: true,
19
+ default: ''
20
+ },
21
+ assignedBy: {
22
+ type: mongoose.Schema.Types.ObjectId,
23
+ ref: 'User',
24
+ default: null
25
+ }
26
+ }, {
27
+ timestamps: true,
28
+ collection: 'water_sensor_gateways'
29
+ });
30
+
31
+ const WaterSensorGateway = mongoose.model('WaterSensorGateway', waterSensorGatewaySchema);
32
+
33
+ module.exports = WaterSensorGateway;
@@ -0,0 +1,23 @@
1
+ const mongoose = require("mongoose");
2
+ const waterSensorSettingsSchema = new mongoose.Schema(
3
+ {
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ required: true,
7
+ unique: true,
8
+ },
9
+ enabled: {
10
+ type: Boolean,
11
+ default: false,
12
+ },
13
+ updatedBy: {
14
+ type: mongoose.Schema.Types.ObjectId,
15
+ default: null,
16
+ },
17
+ },
18
+ { timestamps: true }
19
+ );
20
+
21
+ const WaterSensorSettings = mongoose.model('WaterSensorSettings', waterSensorSettingsSchema);
22
+
23
+ module.exports = WaterSensorSettings;