payservedb 3.3.7 → 3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "3.3.7",
3
+ "version": "3.3.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,5 +1,4 @@
1
1
  const mongoose = require('mongoose');
2
-
3
2
  const concentratorSchema = new mongoose.Schema({
4
3
  serialNumber: {
5
4
  type: String,
@@ -8,13 +7,11 @@ const concentratorSchema = new mongoose.Schema({
8
7
  unique: true
9
8
  },
10
9
  manufacturer: {
11
- type: String,
12
- required: true,
13
- trim: true
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'MeterManufacturer',
14
12
  },
15
13
  range: {
16
14
  type: Number,
17
- required: true,
18
15
  min: 0
19
16
  },
20
17
  isInstalled: {
@@ -39,10 +36,25 @@ const concentratorSchema = new mongoose.Schema({
39
36
  type: mongoose.Schema.Types.ObjectId,
40
37
  ref: 'Facility',
41
38
  }],
39
+ location: {
40
+ city: {
41
+ type: String,
42
+ trim: true
43
+ },
44
+ latitude: {
45
+ type: Number,
46
+ min: -90,
47
+ max: 90
48
+ },
49
+ longitude: {
50
+ type: Number,
51
+ min: -180,
52
+ max: 180
53
+ }
54
+ }
42
55
  }, {
43
56
  timestamps: true
44
57
  });
45
58
 
46
59
  const Concentrator = mongoose.model('Concentrator', concentratorSchema);
47
-
48
60
  module.exports = Concentrator;