payservedb 4.2.6 → 4.2.8
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
|
@@ -127,7 +127,7 @@ const models = {
|
|
|
127
127
|
FacilityPaymentDetails: require('./src/models/facility_payment_details'),
|
|
128
128
|
DefaultPaymentDetails: require('./src/models/default_payment_details'),
|
|
129
129
|
Currency: require('./src/models/currency_settings'),
|
|
130
|
-
UserAccount: require('./src/models/
|
|
130
|
+
UserAccount: require('./src/models/water_meter_account'),
|
|
131
131
|
CashPayment: require('./src/models/cashpayment'),
|
|
132
132
|
VasPayment: require('./src/models/vas_payments'),
|
|
133
133
|
VasInvoicesQuickBooks: require('./src/models/vas_invoices_upload'),
|
package/package.json
CHANGED
|
@@ -63,13 +63,7 @@ const userAccountSchema = new mongoose.Schema({
|
|
|
63
63
|
},
|
|
64
64
|
meter_id: {
|
|
65
65
|
type: mongoose.Schema.Types.ObjectId,
|
|
66
|
-
|
|
67
|
-
refPath: 'meterModel'
|
|
68
|
-
},
|
|
69
|
-
meterModel: {
|
|
70
|
-
type: String,
|
|
71
|
-
required: true,
|
|
72
|
-
enum: ['Meter', 'AnalogMeter']
|
|
66
|
+
ref: 'Meter',
|
|
73
67
|
}
|
|
74
68
|
}, {
|
|
75
69
|
timestamps: true
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const analogMeterSchema = new mongoose.Schema({
|
|
4
|
-
meterNumber: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true,
|
|
7
|
-
unique: true,
|
|
8
|
-
trim: true
|
|
9
|
-
},
|
|
10
|
-
accountNumber: {
|
|
11
|
-
type: String,
|
|
12
|
-
required: true,
|
|
13
|
-
trim: true,
|
|
14
|
-
unique: true
|
|
15
|
-
},
|
|
16
|
-
unitId: {
|
|
17
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
-
ref: 'Unit',
|
|
19
|
-
},
|
|
20
|
-
customerId: {
|
|
21
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
22
|
-
ref: 'Customer',
|
|
23
|
-
},
|
|
24
|
-
initialReading: {
|
|
25
|
-
type: Number,
|
|
26
|
-
required: true,
|
|
27
|
-
min: 0,
|
|
28
|
-
default: 0
|
|
29
|
-
},
|
|
30
|
-
previousReading: {
|
|
31
|
-
type: Number,
|
|
32
|
-
min: 0,
|
|
33
|
-
},
|
|
34
|
-
currentReading: {
|
|
35
|
-
type: Number,
|
|
36
|
-
min: 0,
|
|
37
|
-
},
|
|
38
|
-
status: {
|
|
39
|
-
type: String,
|
|
40
|
-
required: true,
|
|
41
|
-
enum: ['open', 'closed', 'maintenance', 'faulty'],
|
|
42
|
-
default: 'open',
|
|
43
|
-
},
|
|
44
|
-
customerType: {
|
|
45
|
-
type: String,
|
|
46
|
-
enum: ['postpaid', 'prepaid'],
|
|
47
|
-
},
|
|
48
|
-
lastReadingDate: {
|
|
49
|
-
type: Date,
|
|
50
|
-
default: Date.now
|
|
51
|
-
},
|
|
52
|
-
readingHistory: [{
|
|
53
|
-
previousReading: Number,
|
|
54
|
-
currentReading: Number,
|
|
55
|
-
readingDate: {
|
|
56
|
-
type: Date,
|
|
57
|
-
default: Date.now
|
|
58
|
-
},
|
|
59
|
-
readBy: String,
|
|
60
|
-
consumption: Number
|
|
61
|
-
}]
|
|
62
|
-
}, {
|
|
63
|
-
timestamps: true
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const AnalogMeter = mongoose.model('AnalogMeter', analogMeterSchema);
|
|
67
|
-
|
|
68
|
-
module.exports = AnalogMeter;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const meterSchema = new mongoose.Schema({
|
|
4
|
-
facilityId: {
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: 'Facility',
|
|
7
|
-
},
|
|
8
|
-
unitId: {
|
|
9
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
10
|
-
ref: 'Unit',
|
|
11
|
-
},
|
|
12
|
-
customerId: {
|
|
13
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
14
|
-
ref: 'Customer',
|
|
15
|
-
},
|
|
16
|
-
serialNumber: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
trim: true,
|
|
20
|
-
unique: true,
|
|
21
|
-
index: true
|
|
22
|
-
},
|
|
23
|
-
accountNumber: {
|
|
24
|
-
type: String,
|
|
25
|
-
required: true,
|
|
26
|
-
trim: true,
|
|
27
|
-
unique: true
|
|
28
|
-
},
|
|
29
|
-
accountBalance: {
|
|
30
|
-
type: Number,
|
|
31
|
-
trim: true,
|
|
32
|
-
},
|
|
33
|
-
negativeBalance: {
|
|
34
|
-
type: Number,
|
|
35
|
-
trim: true,
|
|
36
|
-
},
|
|
37
|
-
userType: {
|
|
38
|
-
type: String,
|
|
39
|
-
enum: ['postpaid', 'prepaid'],
|
|
40
|
-
},
|
|
41
|
-
valveType: {
|
|
42
|
-
type: String,
|
|
43
|
-
enum: ['automatic', 'manual'],
|
|
44
|
-
default: 'automatic'
|
|
45
|
-
},
|
|
46
|
-
isInstalled: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: false
|
|
49
|
-
},
|
|
50
|
-
manufacturer: {
|
|
51
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
52
|
-
ref: 'MeterManufacturer',
|
|
53
|
-
},
|
|
54
|
-
protocol: {
|
|
55
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
56
|
-
ref: 'MeterProtocol',
|
|
57
|
-
},
|
|
58
|
-
size: {
|
|
59
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
60
|
-
ref: 'MeterSize',
|
|
61
|
-
},
|
|
62
|
-
status: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: true,
|
|
65
|
-
enum: ['open', 'closed', 'maintenance', 'faulty'],
|
|
66
|
-
default: 'closed',
|
|
67
|
-
},
|
|
68
|
-
initialReading: {
|
|
69
|
-
type: Number,
|
|
70
|
-
min: 0,
|
|
71
|
-
default: 0,
|
|
72
|
-
},
|
|
73
|
-
currentReading: {
|
|
74
|
-
type: Number,
|
|
75
|
-
min: 0,
|
|
76
|
-
default: 0,
|
|
77
|
-
},
|
|
78
|
-
}, {
|
|
79
|
-
timestamps: true,
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
meterSchema.index({ serialNumber: 1, status: 1 });
|
|
83
|
-
|
|
84
|
-
const Meter = mongoose.model('Meter', meterSchema);
|
|
85
|
-
|
|
86
|
-
module.exports = Meter;
|