payservedb 4.6.5 → 4.6.7

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
@@ -137,7 +137,10 @@ const models = {
137
137
  Supplier: require('./src/models/suppliers'),
138
138
  PurchaseRequest: require('./src/models/purchase_request'),
139
139
  PurchaseOrder: require('./src/models/purchase_order'),
140
- RFQ: require('./src/models/quotation')
140
+ RFQ: require('./src/models/quotation'),
141
+ CommonAreaElectricityReading: require('./src/models/common_area_electricity'),
142
+ CommonAreaWaterReading: require('./src/models/common_area_water'),
143
+ CommonAreaGeneratorReading: require('./src/models/common_area_generator')
141
144
 
142
145
  };
143
146
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "4.6.5",
3
+ "version": "4.6.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,41 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const commonAreaElectricityReadingSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ required: true,
8
+ index: true
9
+ },
10
+ date: {
11
+ type: Date,
12
+ required: true,
13
+ default: Date.now
14
+ },
15
+ location: {
16
+ type: String,
17
+ enum: ['Common Area', 'Lift', 'Pumps'],
18
+ required: true,
19
+ trim: true
20
+ },
21
+ openingReadingKWh: {
22
+ type: Number,
23
+ required: true
24
+ },
25
+ closingReadingKWh: {
26
+ type: Number,
27
+ required: true
28
+ },
29
+ consumptionKWh: {
30
+ type: Number,
31
+ required: true
32
+ },
33
+ total: {
34
+ type: Number
35
+ }
36
+ }, {
37
+ timestamps: true
38
+ });
39
+
40
+ const CommonAreaElectricityReading = mongoose.model('CommonAreaElectricityReading', commonAreaElectricityReadingSchema);
41
+ module.exports = CommonAreaElectricityReading;
@@ -0,0 +1,38 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const commonAreaGeneratorReadingSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ required: true,
8
+ index: true
9
+ },
10
+ date: {
11
+ type: Date,
12
+ required: true
13
+ },
14
+ openingReadingHrs: {
15
+ type: Number,
16
+ required: true
17
+ },
18
+ closingReadingHrs: {
19
+ type: Number,
20
+ required: true
21
+ },
22
+ totalHrsRun: {
23
+ type: Number,
24
+ required: true
25
+ },
26
+ fuelLevel: {
27
+ type: String,
28
+ trim: true
29
+ },
30
+ refillAmountLiters: {
31
+ type: Number
32
+ }
33
+ }, {
34
+ timestamps: true
35
+ });
36
+
37
+ const CommonAreaGeneratorReading = mongoose.model('CommonAreaGeneratorReading', commonAreaGeneratorReadingSchema);
38
+ module.exports = CommonAreaGeneratorReading;
@@ -0,0 +1,39 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const commonAreaWaterReadingSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ required: true,
8
+ index: true
9
+ },
10
+ date: {
11
+ type: Date,
12
+ required: true,
13
+ default: Date.now
14
+ },
15
+ sourceType: {
16
+ type: String,
17
+ enum: ['City Council', 'Borehole'],
18
+ required: true,
19
+ trim: true
20
+ },
21
+ openingReadingM3: {
22
+ type: Number,
23
+ required: true
24
+ },
25
+ closingReadingM3: {
26
+ type: Number,
27
+ required: true
28
+ },
29
+ consumptionM3: {
30
+ type: Number,
31
+ required: true
32
+ }
33
+ }, {
34
+ timestamps: true
35
+ });
36
+
37
+ const CommonAreaWaterReading = mongoose.model('CommonAreaWaterReading', commonAreaWaterReadingSchema);
38
+ module.exports = CommonAreaWaterReading;
39
+
@@ -29,7 +29,6 @@ const purchaseRequestSchema = new mongoose.Schema({
29
29
  }],
30
30
  from: {
31
31
  type: String,
32
- ref: 'User',
33
32
  trim: true
34
33
  },
35
34
  date: {