payservedb 10.0.2 → 10.0.3

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,7 @@ 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"),
166
167
  MeterLog: require("./src/models/water_meter_communication_logs"),
167
168
  CashPayment: require("./src/models/cashpayment"),
168
169
  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.3",
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;