electric-coop-api 0.1.27 → 0.1.29
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/README.md +2 -2
- package/dist/esm/models/Bill.d.ts +4 -4
- package/dist/esm/models/Bill.js +7 -5
- package/dist/esm/models/BillBreakdownChargeDto.d.ts +7 -1
- package/dist/esm/models/BillBreakdownChargeDto.js +4 -0
- package/dist/esm/models/LastReadingDto.d.ts +2 -2
- package/dist/esm/models/LastReadingDto.js +3 -3
- package/dist/esm/models/RateChargeDto.d.ts +6 -0
- package/dist/esm/models/RateChargeDto.js +4 -0
- package/dist/esm/models/ReadingHistoryItemDto.d.ts +2 -2
- package/dist/esm/models/ReadingHistoryItemDto.js +3 -3
- package/dist/models/Bill.d.ts +4 -4
- package/dist/models/Bill.js +7 -5
- package/dist/models/BillBreakdownChargeDto.d.ts +7 -1
- package/dist/models/BillBreakdownChargeDto.js +4 -0
- package/dist/models/LastReadingDto.d.ts +2 -2
- package/dist/models/LastReadingDto.js +3 -3
- package/dist/models/RateChargeDto.d.ts +6 -0
- package/dist/models/RateChargeDto.js +4 -0
- package/dist/models/ReadingHistoryItemDto.d.ts +2 -2
- package/dist/models/ReadingHistoryItemDto.js +3 -3
- package/package.json +1 -1
- package/src/models/Bill.ts +10 -9
- package/src/models/BillBreakdownChargeDto.ts +10 -1
- package/src/models/LastReadingDto.ts +5 -5
- package/src/models/RateChargeDto.ts +9 -0
- package/src/models/ReadingHistoryItemDto.ts +5 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## electric-coop-api@0.1.
|
|
1
|
+
## electric-coop-api@0.1.29
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install electric-coop-api@0.1.
|
|
39
|
+
npm install electric-coop-api@0.1.29 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -141,17 +141,17 @@ export interface Bill {
|
|
|
141
141
|
*/
|
|
142
142
|
generationCredit: number;
|
|
143
143
|
/**
|
|
144
|
-
*
|
|
144
|
+
* Sum of all charge base amounts before discounts.
|
|
145
145
|
* @type {number}
|
|
146
146
|
* @memberof Bill
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
grossDue: number;
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* Net amount the consumer owes after discounts and VAT.
|
|
151
151
|
* @type {number}
|
|
152
152
|
* @memberof Bill
|
|
153
153
|
*/
|
|
154
|
-
|
|
154
|
+
netDue: number;
|
|
155
155
|
/**
|
|
156
156
|
*
|
|
157
157
|
* @type {number}
|
package/dist/esm/models/Bill.js
CHANGED
|
@@ -48,7 +48,9 @@ export function instanceOfBill(value) {
|
|
|
48
48
|
return false;
|
|
49
49
|
if (!('generationCredit' in value) || value['generationCredit'] === undefined)
|
|
50
50
|
return false;
|
|
51
|
-
if (!('
|
|
51
|
+
if (!('grossDue' in value) || value['grossDue'] === undefined)
|
|
52
|
+
return false;
|
|
53
|
+
if (!('netDue' in value) || value['netDue'] === undefined)
|
|
52
54
|
return false;
|
|
53
55
|
if (!('amountPaid' in value) || value['amountPaid'] === undefined)
|
|
54
56
|
return false;
|
|
@@ -84,8 +86,8 @@ export function BillFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
84
86
|
'generationCurrentReading': json['generationCurrentReading'],
|
|
85
87
|
'generationProduced': json['generationProduced'],
|
|
86
88
|
'generationCredit': json['generationCredit'],
|
|
87
|
-
'
|
|
88
|
-
'
|
|
89
|
+
'grossDue': json['grossDue'],
|
|
90
|
+
'netDue': json['netDue'],
|
|
89
91
|
'amountPaid': json['amountPaid'],
|
|
90
92
|
'paymentDate': json['paymentDate'] == null ? undefined : (new Date(json['paymentDate'])),
|
|
91
93
|
'status': BillStatusEnumFromJSON(json['status']),
|
|
@@ -121,8 +123,8 @@ export function BillToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
121
123
|
'generationCurrentReading': value['generationCurrentReading'],
|
|
122
124
|
'generationProduced': value['generationProduced'],
|
|
123
125
|
'generationCredit': value['generationCredit'],
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
+
'grossDue': value['grossDue'],
|
|
127
|
+
'netDue': value['netDue'],
|
|
126
128
|
'amountPaid': value['amountPaid'],
|
|
127
129
|
'paymentDate': value['paymentDate'] == null ? undefined : ((value['paymentDate']).toISOString()),
|
|
128
130
|
'status': BillStatusEnumToJSON(value['status']),
|
|
@@ -39,6 +39,12 @@ export interface BillBreakdownChargeDto {
|
|
|
39
39
|
* @memberof BillBreakdownChargeDto
|
|
40
40
|
*/
|
|
41
41
|
isFixed: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* True if this entry is a subsidy/discount subtracted from the total (e.g. Senior Citizen Subsidy). Amount will be negative.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @memberof BillBreakdownChargeDto
|
|
46
|
+
*/
|
|
47
|
+
isDiscount: boolean;
|
|
42
48
|
/**
|
|
43
49
|
* kWh consumption applied to derive the amount. Null for fixed/flat charges (e.g. meter rental).
|
|
44
50
|
* @type {object}
|
|
@@ -46,7 +52,7 @@ export interface BillBreakdownChargeDto {
|
|
|
46
52
|
*/
|
|
47
53
|
kwh?: object | null;
|
|
48
54
|
/**
|
|
49
|
-
* VAT rate in effect at the time of billing (e.g. 0.12 = 12%).
|
|
55
|
+
* VAT rate in effect at the time of billing (e.g. 0.12 = 12%). Applies to both charges and discounts — a discount with vatRate 0.12 also reduces VAT by rate × vatRate. Use 0 for VAT-exempt entries.
|
|
50
56
|
* @type {number}
|
|
51
57
|
* @memberof BillBreakdownChargeDto
|
|
52
58
|
*/
|
|
@@ -23,6 +23,8 @@ export function instanceOfBillBreakdownChargeDto(value) {
|
|
|
23
23
|
return false;
|
|
24
24
|
if (!('isFixed' in value) || value['isFixed'] === undefined)
|
|
25
25
|
return false;
|
|
26
|
+
if (!('isDiscount' in value) || value['isDiscount'] === undefined)
|
|
27
|
+
return false;
|
|
26
28
|
if (!('vatRate' in value) || value['vatRate'] === undefined)
|
|
27
29
|
return false;
|
|
28
30
|
return true;
|
|
@@ -39,6 +41,7 @@ export function BillBreakdownChargeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
39
41
|
'amount': json['amount'],
|
|
40
42
|
'rate': json['rate'],
|
|
41
43
|
'isFixed': json['isFixed'],
|
|
44
|
+
'isDiscount': json['isDiscount'],
|
|
42
45
|
'kwh': json['kwh'] == null ? undefined : json['kwh'],
|
|
43
46
|
'vatRate': json['vatRate'],
|
|
44
47
|
};
|
|
@@ -55,6 +58,7 @@ export function BillBreakdownChargeDtoToJSONTyped(value, ignoreDiscriminator = f
|
|
|
55
58
|
'amount': value['amount'],
|
|
56
59
|
'rate': value['rate'],
|
|
57
60
|
'isFixed': value['isFixed'],
|
|
61
|
+
'isDiscount': value['isDiscount'],
|
|
58
62
|
'kwh': value['kwh'],
|
|
59
63
|
'vatRate': value['vatRate'],
|
|
60
64
|
};
|
|
@@ -41,11 +41,11 @@ export interface LastReadingDto {
|
|
|
41
41
|
*/
|
|
42
42
|
consumption: number;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Net amount due for this bill after discounts.
|
|
45
45
|
* @type {number}
|
|
46
46
|
* @memberof LastReadingDto
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
netDue: number;
|
|
49
49
|
/**
|
|
50
50
|
* Previous meter reading
|
|
51
51
|
* @type {number}
|
|
@@ -24,7 +24,7 @@ export function instanceOfLastReadingDto(value) {
|
|
|
24
24
|
return false;
|
|
25
25
|
if (!('consumption' in value) || value['consumption'] === undefined)
|
|
26
26
|
return false;
|
|
27
|
-
if (!('
|
|
27
|
+
if (!('netDue' in value) || value['netDue'] === undefined)
|
|
28
28
|
return false;
|
|
29
29
|
if (!('previousReading' in value) || value['previousReading'] === undefined)
|
|
30
30
|
return false;
|
|
@@ -44,7 +44,7 @@ export function LastReadingDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
44
|
'billingPeriod': json['billingPeriod'],
|
|
45
45
|
'readingDate': (new Date(json['readingDate'])),
|
|
46
46
|
'consumption': json['consumption'],
|
|
47
|
-
'
|
|
47
|
+
'netDue': json['netDue'],
|
|
48
48
|
'previousReading': json['previousReading'],
|
|
49
49
|
'breakdown': BillBreakdownDtoFromJSON(json['breakdown']),
|
|
50
50
|
};
|
|
@@ -61,7 +61,7 @@ export function LastReadingDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
61
61
|
'billingPeriod': value['billingPeriod'],
|
|
62
62
|
'readingDate': ((value['readingDate']).toISOString()),
|
|
63
63
|
'consumption': value['consumption'],
|
|
64
|
-
'
|
|
64
|
+
'netDue': value['netDue'],
|
|
65
65
|
'previousReading': value['previousReading'],
|
|
66
66
|
'breakdown': BillBreakdownDtoToJSON(value['breakdown']),
|
|
67
67
|
};
|
|
@@ -33,6 +33,12 @@ export interface RateChargeDto {
|
|
|
33
33
|
* @memberof RateChargeDto
|
|
34
34
|
*/
|
|
35
35
|
isFixed: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* When true this entry is a subsidy or discount that is subtracted from the bill total (e.g. Senior Citizen Subsidy, Lifeline Rate Allowance). The computed amount will be negative in the breakdown.
|
|
38
|
+
* @type {boolean}
|
|
39
|
+
* @memberof RateChargeDto
|
|
40
|
+
*/
|
|
41
|
+
isDiscount: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* VAT rate as decimal (0–0.12), e.g. 0.12 = 12%
|
|
38
44
|
* @type {number}
|
|
@@ -21,6 +21,8 @@ export function instanceOfRateChargeDto(value) {
|
|
|
21
21
|
return false;
|
|
22
22
|
if (!('isFixed' in value) || value['isFixed'] === undefined)
|
|
23
23
|
return false;
|
|
24
|
+
if (!('isDiscount' in value) || value['isDiscount'] === undefined)
|
|
25
|
+
return false;
|
|
24
26
|
if (!('vatRate' in value) || value['vatRate'] === undefined)
|
|
25
27
|
return false;
|
|
26
28
|
return true;
|
|
@@ -36,6 +38,7 @@ export function RateChargeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
36
38
|
'name': json['name'],
|
|
37
39
|
'rate': json['rate'],
|
|
38
40
|
'isFixed': json['isFixed'],
|
|
41
|
+
'isDiscount': json['isDiscount'],
|
|
39
42
|
'vatRate': json['vatRate'],
|
|
40
43
|
};
|
|
41
44
|
}
|
|
@@ -50,6 +53,7 @@ export function RateChargeDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
50
53
|
'name': value['name'],
|
|
51
54
|
'rate': value['rate'],
|
|
52
55
|
'isFixed': value['isFixed'],
|
|
56
|
+
'isDiscount': value['isDiscount'],
|
|
53
57
|
'vatRate': value['vatRate'],
|
|
54
58
|
};
|
|
55
59
|
}
|
|
@@ -46,11 +46,11 @@ export interface ReadingHistoryItemDto {
|
|
|
46
46
|
*/
|
|
47
47
|
consumption: number;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Net amount due after discounts
|
|
50
50
|
* @type {number}
|
|
51
51
|
* @memberof ReadingHistoryItemDto
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
netDue: number;
|
|
54
54
|
/**
|
|
55
55
|
* User ID who took the reading
|
|
56
56
|
* @type {object}
|
|
@@ -25,7 +25,7 @@ export function instanceOfReadingHistoryItemDto(value) {
|
|
|
25
25
|
return false;
|
|
26
26
|
if (!('consumption' in value) || value['consumption'] === undefined)
|
|
27
27
|
return false;
|
|
28
|
-
if (!('
|
|
28
|
+
if (!('netDue' in value) || value['netDue'] === undefined)
|
|
29
29
|
return false;
|
|
30
30
|
if (!('readingByUserId' in value) || value['readingByUserId'] === undefined)
|
|
31
31
|
return false;
|
|
@@ -46,7 +46,7 @@ export function ReadingHistoryItemDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
46
46
|
'previousReading': json['previousReading'],
|
|
47
47
|
'currentReading': json['currentReading'],
|
|
48
48
|
'consumption': json['consumption'],
|
|
49
|
-
'
|
|
49
|
+
'netDue': json['netDue'],
|
|
50
50
|
'readingByUserId': json['readingByUserId'],
|
|
51
51
|
'readingByName': json['readingByName'],
|
|
52
52
|
};
|
|
@@ -64,7 +64,7 @@ export function ReadingHistoryItemDtoToJSONTyped(value, ignoreDiscriminator = fa
|
|
|
64
64
|
'previousReading': value['previousReading'],
|
|
65
65
|
'currentReading': value['currentReading'],
|
|
66
66
|
'consumption': value['consumption'],
|
|
67
|
-
'
|
|
67
|
+
'netDue': value['netDue'],
|
|
68
68
|
'readingByUserId': value['readingByUserId'],
|
|
69
69
|
'readingByName': value['readingByName'],
|
|
70
70
|
};
|
package/dist/models/Bill.d.ts
CHANGED
|
@@ -141,17 +141,17 @@ export interface Bill {
|
|
|
141
141
|
*/
|
|
142
142
|
generationCredit: number;
|
|
143
143
|
/**
|
|
144
|
-
*
|
|
144
|
+
* Sum of all charge base amounts before discounts.
|
|
145
145
|
* @type {number}
|
|
146
146
|
* @memberof Bill
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
grossDue: number;
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* Net amount the consumer owes after discounts and VAT.
|
|
151
151
|
* @type {number}
|
|
152
152
|
* @memberof Bill
|
|
153
153
|
*/
|
|
154
|
-
|
|
154
|
+
netDue: number;
|
|
155
155
|
/**
|
|
156
156
|
*
|
|
157
157
|
* @type {number}
|
package/dist/models/Bill.js
CHANGED
|
@@ -55,7 +55,9 @@ function instanceOfBill(value) {
|
|
|
55
55
|
return false;
|
|
56
56
|
if (!('generationCredit' in value) || value['generationCredit'] === undefined)
|
|
57
57
|
return false;
|
|
58
|
-
if (!('
|
|
58
|
+
if (!('grossDue' in value) || value['grossDue'] === undefined)
|
|
59
|
+
return false;
|
|
60
|
+
if (!('netDue' in value) || value['netDue'] === undefined)
|
|
59
61
|
return false;
|
|
60
62
|
if (!('amountPaid' in value) || value['amountPaid'] === undefined)
|
|
61
63
|
return false;
|
|
@@ -91,8 +93,8 @@ function BillFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
91
93
|
'generationCurrentReading': json['generationCurrentReading'],
|
|
92
94
|
'generationProduced': json['generationProduced'],
|
|
93
95
|
'generationCredit': json['generationCredit'],
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
+
'grossDue': json['grossDue'],
|
|
97
|
+
'netDue': json['netDue'],
|
|
96
98
|
'amountPaid': json['amountPaid'],
|
|
97
99
|
'paymentDate': json['paymentDate'] == null ? undefined : (new Date(json['paymentDate'])),
|
|
98
100
|
'status': (0, BillStatusEnum_1.BillStatusEnumFromJSON)(json['status']),
|
|
@@ -128,8 +130,8 @@ function BillToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
128
130
|
'generationCurrentReading': value['generationCurrentReading'],
|
|
129
131
|
'generationProduced': value['generationProduced'],
|
|
130
132
|
'generationCredit': value['generationCredit'],
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
+
'grossDue': value['grossDue'],
|
|
134
|
+
'netDue': value['netDue'],
|
|
133
135
|
'amountPaid': value['amountPaid'],
|
|
134
136
|
'paymentDate': value['paymentDate'] == null ? undefined : ((value['paymentDate']).toISOString()),
|
|
135
137
|
'status': (0, BillStatusEnum_1.BillStatusEnumToJSON)(value['status']),
|
|
@@ -39,6 +39,12 @@ export interface BillBreakdownChargeDto {
|
|
|
39
39
|
* @memberof BillBreakdownChargeDto
|
|
40
40
|
*/
|
|
41
41
|
isFixed: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* True if this entry is a subsidy/discount subtracted from the total (e.g. Senior Citizen Subsidy). Amount will be negative.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @memberof BillBreakdownChargeDto
|
|
46
|
+
*/
|
|
47
|
+
isDiscount: boolean;
|
|
42
48
|
/**
|
|
43
49
|
* kWh consumption applied to derive the amount. Null for fixed/flat charges (e.g. meter rental).
|
|
44
50
|
* @type {object}
|
|
@@ -46,7 +52,7 @@ export interface BillBreakdownChargeDto {
|
|
|
46
52
|
*/
|
|
47
53
|
kwh?: object | null;
|
|
48
54
|
/**
|
|
49
|
-
* VAT rate in effect at the time of billing (e.g. 0.12 = 12%).
|
|
55
|
+
* VAT rate in effect at the time of billing (e.g. 0.12 = 12%). Applies to both charges and discounts — a discount with vatRate 0.12 also reduces VAT by rate × vatRate. Use 0 for VAT-exempt entries.
|
|
50
56
|
* @type {number}
|
|
51
57
|
* @memberof BillBreakdownChargeDto
|
|
52
58
|
*/
|
|
@@ -30,6 +30,8 @@ function instanceOfBillBreakdownChargeDto(value) {
|
|
|
30
30
|
return false;
|
|
31
31
|
if (!('isFixed' in value) || value['isFixed'] === undefined)
|
|
32
32
|
return false;
|
|
33
|
+
if (!('isDiscount' in value) || value['isDiscount'] === undefined)
|
|
34
|
+
return false;
|
|
33
35
|
if (!('vatRate' in value) || value['vatRate'] === undefined)
|
|
34
36
|
return false;
|
|
35
37
|
return true;
|
|
@@ -46,6 +48,7 @@ function BillBreakdownChargeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
46
48
|
'amount': json['amount'],
|
|
47
49
|
'rate': json['rate'],
|
|
48
50
|
'isFixed': json['isFixed'],
|
|
51
|
+
'isDiscount': json['isDiscount'],
|
|
49
52
|
'kwh': json['kwh'] == null ? undefined : json['kwh'],
|
|
50
53
|
'vatRate': json['vatRate'],
|
|
51
54
|
};
|
|
@@ -62,6 +65,7 @@ function BillBreakdownChargeDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
62
65
|
'amount': value['amount'],
|
|
63
66
|
'rate': value['rate'],
|
|
64
67
|
'isFixed': value['isFixed'],
|
|
68
|
+
'isDiscount': value['isDiscount'],
|
|
65
69
|
'kwh': value['kwh'],
|
|
66
70
|
'vatRate': value['vatRate'],
|
|
67
71
|
};
|
|
@@ -41,11 +41,11 @@ export interface LastReadingDto {
|
|
|
41
41
|
*/
|
|
42
42
|
consumption: number;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Net amount due for this bill after discounts.
|
|
45
45
|
* @type {number}
|
|
46
46
|
* @memberof LastReadingDto
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
netDue: number;
|
|
49
49
|
/**
|
|
50
50
|
* Previous meter reading
|
|
51
51
|
* @type {number}
|
|
@@ -31,7 +31,7 @@ function instanceOfLastReadingDto(value) {
|
|
|
31
31
|
return false;
|
|
32
32
|
if (!('consumption' in value) || value['consumption'] === undefined)
|
|
33
33
|
return false;
|
|
34
|
-
if (!('
|
|
34
|
+
if (!('netDue' in value) || value['netDue'] === undefined)
|
|
35
35
|
return false;
|
|
36
36
|
if (!('previousReading' in value) || value['previousReading'] === undefined)
|
|
37
37
|
return false;
|
|
@@ -51,7 +51,7 @@ function LastReadingDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
51
51
|
'billingPeriod': json['billingPeriod'],
|
|
52
52
|
'readingDate': (new Date(json['readingDate'])),
|
|
53
53
|
'consumption': json['consumption'],
|
|
54
|
-
'
|
|
54
|
+
'netDue': json['netDue'],
|
|
55
55
|
'previousReading': json['previousReading'],
|
|
56
56
|
'breakdown': (0, BillBreakdownDto_1.BillBreakdownDtoFromJSON)(json['breakdown']),
|
|
57
57
|
};
|
|
@@ -68,7 +68,7 @@ function LastReadingDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
68
68
|
'billingPeriod': value['billingPeriod'],
|
|
69
69
|
'readingDate': ((value['readingDate']).toISOString()),
|
|
70
70
|
'consumption': value['consumption'],
|
|
71
|
-
'
|
|
71
|
+
'netDue': value['netDue'],
|
|
72
72
|
'previousReading': value['previousReading'],
|
|
73
73
|
'breakdown': (0, BillBreakdownDto_1.BillBreakdownDtoToJSON)(value['breakdown']),
|
|
74
74
|
};
|
|
@@ -33,6 +33,12 @@ export interface RateChargeDto {
|
|
|
33
33
|
* @memberof RateChargeDto
|
|
34
34
|
*/
|
|
35
35
|
isFixed: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* When true this entry is a subsidy or discount that is subtracted from the bill total (e.g. Senior Citizen Subsidy, Lifeline Rate Allowance). The computed amount will be negative in the breakdown.
|
|
38
|
+
* @type {boolean}
|
|
39
|
+
* @memberof RateChargeDto
|
|
40
|
+
*/
|
|
41
|
+
isDiscount: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* VAT rate as decimal (0–0.12), e.g. 0.12 = 12%
|
|
38
44
|
* @type {number}
|
|
@@ -28,6 +28,8 @@ function instanceOfRateChargeDto(value) {
|
|
|
28
28
|
return false;
|
|
29
29
|
if (!('isFixed' in value) || value['isFixed'] === undefined)
|
|
30
30
|
return false;
|
|
31
|
+
if (!('isDiscount' in value) || value['isDiscount'] === undefined)
|
|
32
|
+
return false;
|
|
31
33
|
if (!('vatRate' in value) || value['vatRate'] === undefined)
|
|
32
34
|
return false;
|
|
33
35
|
return true;
|
|
@@ -43,6 +45,7 @@ function RateChargeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
43
45
|
'name': json['name'],
|
|
44
46
|
'rate': json['rate'],
|
|
45
47
|
'isFixed': json['isFixed'],
|
|
48
|
+
'isDiscount': json['isDiscount'],
|
|
46
49
|
'vatRate': json['vatRate'],
|
|
47
50
|
};
|
|
48
51
|
}
|
|
@@ -57,6 +60,7 @@ function RateChargeDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
57
60
|
'name': value['name'],
|
|
58
61
|
'rate': value['rate'],
|
|
59
62
|
'isFixed': value['isFixed'],
|
|
63
|
+
'isDiscount': value['isDiscount'],
|
|
60
64
|
'vatRate': value['vatRate'],
|
|
61
65
|
};
|
|
62
66
|
}
|
|
@@ -46,11 +46,11 @@ export interface ReadingHistoryItemDto {
|
|
|
46
46
|
*/
|
|
47
47
|
consumption: number;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Net amount due after discounts
|
|
50
50
|
* @type {number}
|
|
51
51
|
* @memberof ReadingHistoryItemDto
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
netDue: number;
|
|
54
54
|
/**
|
|
55
55
|
* User ID who took the reading
|
|
56
56
|
* @type {object}
|
|
@@ -32,7 +32,7 @@ function instanceOfReadingHistoryItemDto(value) {
|
|
|
32
32
|
return false;
|
|
33
33
|
if (!('consumption' in value) || value['consumption'] === undefined)
|
|
34
34
|
return false;
|
|
35
|
-
if (!('
|
|
35
|
+
if (!('netDue' in value) || value['netDue'] === undefined)
|
|
36
36
|
return false;
|
|
37
37
|
if (!('readingByUserId' in value) || value['readingByUserId'] === undefined)
|
|
38
38
|
return false;
|
|
@@ -53,7 +53,7 @@ function ReadingHistoryItemDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
53
53
|
'previousReading': json['previousReading'],
|
|
54
54
|
'currentReading': json['currentReading'],
|
|
55
55
|
'consumption': json['consumption'],
|
|
56
|
-
'
|
|
56
|
+
'netDue': json['netDue'],
|
|
57
57
|
'readingByUserId': json['readingByUserId'],
|
|
58
58
|
'readingByName': json['readingByName'],
|
|
59
59
|
};
|
|
@@ -71,7 +71,7 @@ function ReadingHistoryItemDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
71
71
|
'previousReading': value['previousReading'],
|
|
72
72
|
'currentReading': value['currentReading'],
|
|
73
73
|
'consumption': value['consumption'],
|
|
74
|
-
'
|
|
74
|
+
'netDue': value['netDue'],
|
|
75
75
|
'readingByUserId': value['readingByUserId'],
|
|
76
76
|
'readingByName': value['readingByName'],
|
|
77
77
|
};
|
package/package.json
CHANGED
package/src/models/Bill.ts
CHANGED
|
@@ -176,17 +176,17 @@ export interface Bill {
|
|
|
176
176
|
*/
|
|
177
177
|
generationCredit: number;
|
|
178
178
|
/**
|
|
179
|
-
*
|
|
179
|
+
* Sum of all charge base amounts before discounts.
|
|
180
180
|
* @type {number}
|
|
181
181
|
* @memberof Bill
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
grossDue: number;
|
|
184
184
|
/**
|
|
185
|
-
*
|
|
185
|
+
* Net amount the consumer owes after discounts and VAT.
|
|
186
186
|
* @type {number}
|
|
187
187
|
* @memberof Bill
|
|
188
188
|
*/
|
|
189
|
-
|
|
189
|
+
netDue: number;
|
|
190
190
|
/**
|
|
191
191
|
*
|
|
192
192
|
* @type {number}
|
|
@@ -239,7 +239,8 @@ export function instanceOfBill(value: object): value is Bill {
|
|
|
239
239
|
if (!('generationCurrentReading' in value) || value['generationCurrentReading'] === undefined) return false;
|
|
240
240
|
if (!('generationProduced' in value) || value['generationProduced'] === undefined) return false;
|
|
241
241
|
if (!('generationCredit' in value) || value['generationCredit'] === undefined) return false;
|
|
242
|
-
if (!('
|
|
242
|
+
if (!('grossDue' in value) || value['grossDue'] === undefined) return false;
|
|
243
|
+
if (!('netDue' in value) || value['netDue'] === undefined) return false;
|
|
243
244
|
if (!('amountPaid' in value) || value['amountPaid'] === undefined) return false;
|
|
244
245
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
245
246
|
return true;
|
|
@@ -275,8 +276,8 @@ export function BillFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bill
|
|
|
275
276
|
'generationCurrentReading': json['generationCurrentReading'],
|
|
276
277
|
'generationProduced': json['generationProduced'],
|
|
277
278
|
'generationCredit': json['generationCredit'],
|
|
278
|
-
'
|
|
279
|
-
'
|
|
279
|
+
'grossDue': json['grossDue'],
|
|
280
|
+
'netDue': json['netDue'],
|
|
280
281
|
'amountPaid': json['amountPaid'],
|
|
281
282
|
'paymentDate': json['paymentDate'] == null ? undefined : (new Date(json['paymentDate'])),
|
|
282
283
|
'status': BillStatusEnumFromJSON(json['status']),
|
|
@@ -316,8 +317,8 @@ export function BillToJSONTyped(value?: Bill | null, ignoreDiscriminator: boolea
|
|
|
316
317
|
'generationCurrentReading': value['generationCurrentReading'],
|
|
317
318
|
'generationProduced': value['generationProduced'],
|
|
318
319
|
'generationCredit': value['generationCredit'],
|
|
319
|
-
'
|
|
320
|
-
'
|
|
320
|
+
'grossDue': value['grossDue'],
|
|
321
|
+
'netDue': value['netDue'],
|
|
321
322
|
'amountPaid': value['amountPaid'],
|
|
322
323
|
'paymentDate': value['paymentDate'] == null ? undefined : ((value['paymentDate']).toISOString()),
|
|
323
324
|
'status': BillStatusEnumToJSON(value['status']),
|
|
@@ -43,6 +43,12 @@ export interface BillBreakdownChargeDto {
|
|
|
43
43
|
* @memberof BillBreakdownChargeDto
|
|
44
44
|
*/
|
|
45
45
|
isFixed: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* True if this entry is a subsidy/discount subtracted from the total (e.g. Senior Citizen Subsidy). Amount will be negative.
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
* @memberof BillBreakdownChargeDto
|
|
50
|
+
*/
|
|
51
|
+
isDiscount: boolean;
|
|
46
52
|
/**
|
|
47
53
|
* kWh consumption applied to derive the amount. Null for fixed/flat charges (e.g. meter rental).
|
|
48
54
|
* @type {object}
|
|
@@ -50,7 +56,7 @@ export interface BillBreakdownChargeDto {
|
|
|
50
56
|
*/
|
|
51
57
|
kwh?: object | null;
|
|
52
58
|
/**
|
|
53
|
-
* VAT rate in effect at the time of billing (e.g. 0.12 = 12%).
|
|
59
|
+
* VAT rate in effect at the time of billing (e.g. 0.12 = 12%). Applies to both charges and discounts — a discount with vatRate 0.12 also reduces VAT by rate × vatRate. Use 0 for VAT-exempt entries.
|
|
54
60
|
* @type {number}
|
|
55
61
|
* @memberof BillBreakdownChargeDto
|
|
56
62
|
*/
|
|
@@ -65,6 +71,7 @@ export function instanceOfBillBreakdownChargeDto(value: object): value is BillBr
|
|
|
65
71
|
if (!('amount' in value) || value['amount'] === undefined) return false;
|
|
66
72
|
if (!('rate' in value) || value['rate'] === undefined) return false;
|
|
67
73
|
if (!('isFixed' in value) || value['isFixed'] === undefined) return false;
|
|
74
|
+
if (!('isDiscount' in value) || value['isDiscount'] === undefined) return false;
|
|
68
75
|
if (!('vatRate' in value) || value['vatRate'] === undefined) return false;
|
|
69
76
|
return true;
|
|
70
77
|
}
|
|
@@ -83,6 +90,7 @@ export function BillBreakdownChargeDtoFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
83
90
|
'amount': json['amount'],
|
|
84
91
|
'rate': json['rate'],
|
|
85
92
|
'isFixed': json['isFixed'],
|
|
93
|
+
'isDiscount': json['isDiscount'],
|
|
86
94
|
'kwh': json['kwh'] == null ? undefined : json['kwh'],
|
|
87
95
|
'vatRate': json['vatRate'],
|
|
88
96
|
};
|
|
@@ -103,6 +111,7 @@ export function BillBreakdownChargeDtoToJSONTyped(value?: BillBreakdownChargeDto
|
|
|
103
111
|
'amount': value['amount'],
|
|
104
112
|
'rate': value['rate'],
|
|
105
113
|
'isFixed': value['isFixed'],
|
|
114
|
+
'isDiscount': value['isDiscount'],
|
|
106
115
|
'kwh': value['kwh'],
|
|
107
116
|
'vatRate': value['vatRate'],
|
|
108
117
|
};
|
|
@@ -52,11 +52,11 @@ export interface LastReadingDto {
|
|
|
52
52
|
*/
|
|
53
53
|
consumption: number;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Net amount due for this bill after discounts.
|
|
56
56
|
* @type {number}
|
|
57
57
|
* @memberof LastReadingDto
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
netDue: number;
|
|
60
60
|
/**
|
|
61
61
|
* Previous meter reading
|
|
62
62
|
* @type {number}
|
|
@@ -79,7 +79,7 @@ export function instanceOfLastReadingDto(value: object): value is LastReadingDto
|
|
|
79
79
|
if (!('billingPeriod' in value) || value['billingPeriod'] === undefined) return false;
|
|
80
80
|
if (!('readingDate' in value) || value['readingDate'] === undefined) return false;
|
|
81
81
|
if (!('consumption' in value) || value['consumption'] === undefined) return false;
|
|
82
|
-
if (!('
|
|
82
|
+
if (!('netDue' in value) || value['netDue'] === undefined) return false;
|
|
83
83
|
if (!('previousReading' in value) || value['previousReading'] === undefined) return false;
|
|
84
84
|
if (!('breakdown' in value) || value['breakdown'] === undefined) return false;
|
|
85
85
|
return true;
|
|
@@ -99,7 +99,7 @@ export function LastReadingDtoFromJSONTyped(json: any, ignoreDiscriminator: bool
|
|
|
99
99
|
'billingPeriod': json['billingPeriod'],
|
|
100
100
|
'readingDate': (new Date(json['readingDate'])),
|
|
101
101
|
'consumption': json['consumption'],
|
|
102
|
-
'
|
|
102
|
+
'netDue': json['netDue'],
|
|
103
103
|
'previousReading': json['previousReading'],
|
|
104
104
|
'breakdown': BillBreakdownDtoFromJSON(json['breakdown']),
|
|
105
105
|
};
|
|
@@ -120,7 +120,7 @@ export function LastReadingDtoToJSONTyped(value?: LastReadingDto | null, ignoreD
|
|
|
120
120
|
'billingPeriod': value['billingPeriod'],
|
|
121
121
|
'readingDate': ((value['readingDate']).toISOString()),
|
|
122
122
|
'consumption': value['consumption'],
|
|
123
|
-
'
|
|
123
|
+
'netDue': value['netDue'],
|
|
124
124
|
'previousReading': value['previousReading'],
|
|
125
125
|
'breakdown': BillBreakdownDtoToJSON(value['breakdown']),
|
|
126
126
|
};
|
|
@@ -37,6 +37,12 @@ export interface RateChargeDto {
|
|
|
37
37
|
* @memberof RateChargeDto
|
|
38
38
|
*/
|
|
39
39
|
isFixed: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* When true this entry is a subsidy or discount that is subtracted from the bill total (e.g. Senior Citizen Subsidy, Lifeline Rate Allowance). The computed amount will be negative in the breakdown.
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @memberof RateChargeDto
|
|
44
|
+
*/
|
|
45
|
+
isDiscount: boolean;
|
|
40
46
|
/**
|
|
41
47
|
* VAT rate as decimal (0–0.12), e.g. 0.12 = 12%
|
|
42
48
|
* @type {number}
|
|
@@ -52,6 +58,7 @@ export function instanceOfRateChargeDto(value: object): value is RateChargeDto {
|
|
|
52
58
|
if (!('name' in value) || value['name'] === undefined) return false;
|
|
53
59
|
if (!('rate' in value) || value['rate'] === undefined) return false;
|
|
54
60
|
if (!('isFixed' in value) || value['isFixed'] === undefined) return false;
|
|
61
|
+
if (!('isDiscount' in value) || value['isDiscount'] === undefined) return false;
|
|
55
62
|
if (!('vatRate' in value) || value['vatRate'] === undefined) return false;
|
|
56
63
|
return true;
|
|
57
64
|
}
|
|
@@ -69,6 +76,7 @@ export function RateChargeDtoFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
69
76
|
'name': json['name'],
|
|
70
77
|
'rate': json['rate'],
|
|
71
78
|
'isFixed': json['isFixed'],
|
|
79
|
+
'isDiscount': json['isDiscount'],
|
|
72
80
|
'vatRate': json['vatRate'],
|
|
73
81
|
};
|
|
74
82
|
}
|
|
@@ -87,6 +95,7 @@ export function RateChargeDtoToJSONTyped(value?: RateChargeDto | null, ignoreDis
|
|
|
87
95
|
'name': value['name'],
|
|
88
96
|
'rate': value['rate'],
|
|
89
97
|
'isFixed': value['isFixed'],
|
|
98
|
+
'isDiscount': value['isDiscount'],
|
|
90
99
|
'vatRate': value['vatRate'],
|
|
91
100
|
};
|
|
92
101
|
}
|
|
@@ -50,11 +50,11 @@ export interface ReadingHistoryItemDto {
|
|
|
50
50
|
*/
|
|
51
51
|
consumption: number;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Net amount due after discounts
|
|
54
54
|
* @type {number}
|
|
55
55
|
* @memberof ReadingHistoryItemDto
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
netDue: number;
|
|
58
58
|
/**
|
|
59
59
|
* User ID who took the reading
|
|
60
60
|
* @type {object}
|
|
@@ -78,7 +78,7 @@ export function instanceOfReadingHistoryItemDto(value: object): value is Reading
|
|
|
78
78
|
if (!('previousReading' in value) || value['previousReading'] === undefined) return false;
|
|
79
79
|
if (!('currentReading' in value) || value['currentReading'] === undefined) return false;
|
|
80
80
|
if (!('consumption' in value) || value['consumption'] === undefined) return false;
|
|
81
|
-
if (!('
|
|
81
|
+
if (!('netDue' in value) || value['netDue'] === undefined) return false;
|
|
82
82
|
if (!('readingByUserId' in value) || value['readingByUserId'] === undefined) return false;
|
|
83
83
|
if (!('readingByName' in value) || value['readingByName'] === undefined) return false;
|
|
84
84
|
return true;
|
|
@@ -99,7 +99,7 @@ export function ReadingHistoryItemDtoFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
99
99
|
'previousReading': json['previousReading'],
|
|
100
100
|
'currentReading': json['currentReading'],
|
|
101
101
|
'consumption': json['consumption'],
|
|
102
|
-
'
|
|
102
|
+
'netDue': json['netDue'],
|
|
103
103
|
'readingByUserId': json['readingByUserId'],
|
|
104
104
|
'readingByName': json['readingByName'],
|
|
105
105
|
};
|
|
@@ -121,7 +121,7 @@ export function ReadingHistoryItemDtoToJSONTyped(value?: ReadingHistoryItemDto |
|
|
|
121
121
|
'previousReading': value['previousReading'],
|
|
122
122
|
'currentReading': value['currentReading'],
|
|
123
123
|
'consumption': value['consumption'],
|
|
124
|
-
'
|
|
124
|
+
'netDue': value['netDue'],
|
|
125
125
|
'readingByUserId': value['readingByUserId'],
|
|
126
126
|
'readingByName': value['readingByName'],
|
|
127
127
|
};
|