payservedb 1.4.1 → 1.4.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 +1 -0
- package/package.json +1 -1
- package/src/models/apilog.js +1 -1
- package/src/models/contract.js +2 -1
- package/src/models/levy.js +4 -0
- package/src/models/settings.js +19 -0
- package/src/models/waterMeterSetting.js +12 -8
package/index.js
CHANGED
|
@@ -69,6 +69,7 @@ const models = {
|
|
|
69
69
|
Guard:require('./src/models/guard'),
|
|
70
70
|
Visitor:require('./src/models/visitor'),
|
|
71
71
|
VisitLog:require('./src/models/visitLog'),
|
|
72
|
+
Settings:require('./src/models/settings'),
|
|
72
73
|
Contract:require('./src/models/contract'),
|
|
73
74
|
Levy:require('./src/models/levy'),
|
|
74
75
|
LevyType:require('./src/models/levytype')
|
package/package.json
CHANGED
package/src/models/apilog.js
CHANGED
|
@@ -4,7 +4,7 @@ const { Schema } = mongoose;
|
|
|
4
4
|
|
|
5
5
|
const apiLogSchema = new Schema({
|
|
6
6
|
url: { type: String, required: true, index: true },
|
|
7
|
-
method: { type: String, required: true,
|
|
7
|
+
method: { type: String, required: true, index: true },
|
|
8
8
|
duration: { type: Number, required: true },
|
|
9
9
|
time: { type: Date, default: Date.now, required: true, index: true },
|
|
10
10
|
date: { type: String, required: true, index: true },
|
package/src/models/contract.js
CHANGED
package/src/models/levy.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const SettingsSchema = new mongoose.Schema({
|
|
4
|
+
name: {
|
|
5
|
+
type: String,
|
|
6
|
+
required:true
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
type: String,
|
|
10
|
+
required:true
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
}, {
|
|
14
|
+
timestamps: true, // Automatically add createdAt and updatedAt fields
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const Settings = mongoose.model('Settings', SettingsSchema);
|
|
18
|
+
|
|
19
|
+
module.exports = Settings;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
|
|
3
3
|
const waterMeterSettingsSchema = mongoose.Schema({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
meterSettings: [
|
|
5
|
+
{
|
|
6
|
+
manufacturers: {
|
|
7
|
+
type: [String],
|
|
8
|
+
required: false
|
|
9
|
+
},
|
|
10
|
+
meterSizes: {
|
|
11
|
+
type: [String],
|
|
12
|
+
required: false
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
]
|
|
12
16
|
});
|
|
13
17
|
|
|
14
18
|
// Middleware to ensure only one record exists
|