@widergy/utilitygo-smart-bill-web 3.1.0 → 3.3.0
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/CHANGELOG.md +14 -0
- package/dist/components/SmartBillSummary/constants.js +24 -0
- package/dist/components/SmartBillSummary/index.js +95 -0
- package/dist/components/SmartBillSummary/styles.module.scss +48 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/DebtStatusLabel/constants.js +9 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/DebtStatusLabel/index.js +34 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/DebtStatusLabel/styles.module.scss +16 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/components/ProgressBar/constants.js +8 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/components/ProgressBar/index.js +154 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/components/ProgressBar/styles.module.scss +174 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/components/ProgressBar/utils.js +88 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/index.js +165 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/styles.module.scss +60 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/utils.js +14 -0
- package/dist/components/SmartBillSummary/tabs/Billing/index.js +288 -0
- package/dist/components/SmartBillSummary/tabs/Billing/styles.module.scss +132 -0
- package/dist/components/SmartBillSummary/tabs/Billing/utils.js +13 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/Billing/constants.js +9 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/Billing/index.js +90 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/Billing/styles.module.scss +55 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/Billing/utils.js +32 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/BimestralConsumption/constants.js +13 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/BimestralConsumption/index.js +78 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/BimestralConsumption/styles.module.scss +43 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionComparison/constants.js +9 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionComparison/index.js +68 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionComparison/styles.module.scss +43 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionComparison/utils.js +35 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionEvolution/index.js +72 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionEvolution/styles.module.scss +29 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionEvolution/utils.js +71 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/index.js +64 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/styles.module.scss +22 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/utils.js +56 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/index.js +54 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/styles.module.scss +31 -0
- package/dist/components/SmartBillSummary/utils.js +30 -0
- package/dist/index.js +14 -0
- package/dist/shared/constants/tabs.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _energyUi = require("@widergy/energy-ui");
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _utils = require("../../../Consumptions/components/CurrentConsumption/utils");
|
|
11
|
+
var _utils2 = require("./utils");
|
|
12
|
+
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
13
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const RateCard = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
components,
|
|
18
|
+
consumptionLevels,
|
|
19
|
+
currentPeriod,
|
|
20
|
+
formatAmount,
|
|
21
|
+
normalizedRate = '',
|
|
22
|
+
rateCardTranslations = {},
|
|
23
|
+
ratesTableLink,
|
|
24
|
+
smartBill = {},
|
|
25
|
+
subsidy = '',
|
|
26
|
+
subsidyLevels
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
helpText,
|
|
30
|
+
limitRateValueLabel,
|
|
31
|
+
seeRatesTable,
|
|
32
|
+
startRateValueLabel,
|
|
33
|
+
title,
|
|
34
|
+
tooltipContent,
|
|
35
|
+
unit,
|
|
36
|
+
yourConsumption,
|
|
37
|
+
yourRate
|
|
38
|
+
} = rateCardTranslations;
|
|
39
|
+
const {
|
|
40
|
+
client,
|
|
41
|
+
detail,
|
|
42
|
+
periods
|
|
43
|
+
} = smartBill;
|
|
44
|
+
const purchasedRate = client?.rate?.purchased || '';
|
|
45
|
+
const periodsToCompare = (0, _utils.getConsumptionPeriodsToCompare)(periods);
|
|
46
|
+
const {
|
|
47
|
+
totalConsumption
|
|
48
|
+
} = (0, _utils.getConsumptionLabels)(periodsToCompare) || {};
|
|
49
|
+
const {
|
|
50
|
+
levels = []
|
|
51
|
+
} = consumptionLevels.find(_ref2 => {
|
|
52
|
+
let {
|
|
53
|
+
rate
|
|
54
|
+
} = _ref2;
|
|
55
|
+
return rate === normalizedRate;
|
|
56
|
+
}) || consumptionLevels[0] || {};
|
|
57
|
+
const {
|
|
58
|
+
rates = []
|
|
59
|
+
} = levels.find(_ref3 => {
|
|
60
|
+
let {
|
|
61
|
+
name
|
|
62
|
+
} = _ref3;
|
|
63
|
+
return name && name === subsidyLevels[subsidy];
|
|
64
|
+
}) || levels[0] || {};
|
|
65
|
+
const currentIndex = rates.findIndex(_ref4 => {
|
|
66
|
+
let {
|
|
67
|
+
range
|
|
68
|
+
} = _ref4;
|
|
69
|
+
return range[1] >= totalConsumption;
|
|
70
|
+
});
|
|
71
|
+
const currentRate = rates[currentIndex] ?? {};
|
|
72
|
+
const startRateValue = Array.isArray(currentRate?.range) && currentRate.range[0];
|
|
73
|
+
const limitRateValue = Array.isArray(currentRate?.range) && currentRate.range.length > 0 && currentRate.range[currentRate.range.length - 1];
|
|
74
|
+
const concepts = detail?.concepts?.[0]?.lines;
|
|
75
|
+
const fixedCharges = concepts?.[0];
|
|
76
|
+
const variableCharges = concepts?.[1];
|
|
77
|
+
const {
|
|
78
|
+
title: fixedChargeTitle,
|
|
79
|
+
amount: fixedChargeValue
|
|
80
|
+
} = fixedCharges || {};
|
|
81
|
+
const {
|
|
82
|
+
title: variableChargeTitle,
|
|
83
|
+
amount: variableChargeValue
|
|
84
|
+
} = variableCharges || {};
|
|
85
|
+
const isT1 = purchasedRate.includes('T1');
|
|
86
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
+
className: _stylesModule.default.container
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
89
|
+
className: _stylesModule.default.headerTitles
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
91
|
+
variant: "title2",
|
|
92
|
+
weight: "medium"
|
|
93
|
+
}, title), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
94
|
+
colorTheme: "gray"
|
|
95
|
+
}, helpText)), /*#__PURE__*/_react.default.createElement(_ProgressBar.default, {
|
|
96
|
+
components: components,
|
|
97
|
+
currentPeriod: currentPeriod,
|
|
98
|
+
data: rates,
|
|
99
|
+
isT1: isT1,
|
|
100
|
+
limitValue: limitRateValue,
|
|
101
|
+
specificRate: currentRate,
|
|
102
|
+
tooltipContent: tooltipContent,
|
|
103
|
+
translations: rateCardTranslations,
|
|
104
|
+
value: totalConsumption
|
|
105
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
+
className: _stylesModule.default.consumptionDataContainer
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
+
className: _stylesModule.default.consumptionContent
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
110
|
+
variant: "title3",
|
|
111
|
+
weight: "medium"
|
|
112
|
+
}, (0, _utils2.getCurrentRate)(purchasedRate, currentRate)), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
113
|
+
colorTheme: "gray",
|
|
114
|
+
variant: "small"
|
|
115
|
+
}, !isT1 ? yourRate : limitRateValue === 'Infinity' ? startRateValueLabel?.(startRateValue) : limitRateValueLabel?.(limitRateValue))), /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
className: _stylesModule.default.consumptionContent
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
118
|
+
variant: "title3",
|
|
119
|
+
weight: "medium"
|
|
120
|
+
}, totalConsumption, " ", unit), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
121
|
+
colorTheme: "gray",
|
|
122
|
+
variant: "small"
|
|
123
|
+
}, yourConsumption))), /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
className: _stylesModule.default.footer
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
className: _stylesModule.default.detail
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
128
|
+
weight: "medium"
|
|
129
|
+
}, fixedChargeTitle), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
130
|
+
variant: "subtitle1",
|
|
131
|
+
weight: "medium"
|
|
132
|
+
}, formatAmount?.(fixedChargeValue))), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
className: _stylesModule.default.detail
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
135
|
+
weight: "medium"
|
|
136
|
+
}, variableChargeTitle), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
137
|
+
variant: "subtitle1",
|
|
138
|
+
weight: "medium"
|
|
139
|
+
}, formatAmount?.(variableChargeValue))), /*#__PURE__*/_react.default.createElement("a", {
|
|
140
|
+
className: _stylesModule.default.footerAction,
|
|
141
|
+
href: ratesTableLink,
|
|
142
|
+
rel: "noopener noreferrer",
|
|
143
|
+
target: "_blank"
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
145
|
+
colorTheme: "neutral",
|
|
146
|
+
weight: "medium"
|
|
147
|
+
}, seeRatesTable), /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, {
|
|
148
|
+
colorTheme: "neutral",
|
|
149
|
+
name: "IconChevronRight",
|
|
150
|
+
size: 20
|
|
151
|
+
}))));
|
|
152
|
+
};
|
|
153
|
+
RateCard.propTypes = {
|
|
154
|
+
components: _propTypes.object,
|
|
155
|
+
consumptionLevels: _propTypes.array,
|
|
156
|
+
currentPeriod: _propTypes.object,
|
|
157
|
+
formatAmount: _propTypes.func,
|
|
158
|
+
normalizedRate: _propTypes.string,
|
|
159
|
+
rateCardTranslations: _propTypes.object,
|
|
160
|
+
ratesTableLink: _propTypes.string,
|
|
161
|
+
smartBill: _propTypes.object,
|
|
162
|
+
subsidy: _propTypes.string,
|
|
163
|
+
subsidyLevels: (0, _propTypes.objectOf)(_propTypes.string)
|
|
164
|
+
};
|
|
165
|
+
var _default = exports.default = RateCard;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
background-color: var(--light01);
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
box-shadow: var(--shadowGrayBottom1);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
grid-gap: 24px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.headerTitles {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
grid-gap: 8px;
|
|
14
|
+
padding: 24px 24px 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.consumptionDataContainer {
|
|
18
|
+
align-items: center;
|
|
19
|
+
display: flex;
|
|
20
|
+
grid-gap: 24px;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
padding: 24px 24px 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.consumptionContent {
|
|
26
|
+
flex: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.footer {
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.footerAction {
|
|
34
|
+
align-items: center;
|
|
35
|
+
background-color: transparent;
|
|
36
|
+
border-top: 1px solid var(--light04);
|
|
37
|
+
display: flex;
|
|
38
|
+
grid-gap: 8px;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
padding: 16px;
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
transition: all 0.2s ease;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
background-color: var(--light03);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:active {
|
|
49
|
+
background-color: var(--light04);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.detail {
|
|
54
|
+
align-items: center;
|
|
55
|
+
border-top: 1px solid var(--light04);
|
|
56
|
+
display: flex;
|
|
57
|
+
grid-gap: 16px;
|
|
58
|
+
justify-content: space-between;
|
|
59
|
+
padding: 16px;
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCurrentRate = void 0;
|
|
7
|
+
const getCurrentRate = function () {
|
|
8
|
+
let baseRate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9
|
+
let specificRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
10
|
+
const isT1 = baseRate.includes('T1');
|
|
11
|
+
const baseRateParts = baseRate.split('-');
|
|
12
|
+
return isT1 ? `${baseRateParts[0]}-${specificRate?.name || baseRateParts[1]}` : baseRate;
|
|
13
|
+
};
|
|
14
|
+
exports.getCurrentRate = getCurrentRate;
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _energyUi = require("@widergy/energy-ui");
|
|
9
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
var _billDataTypes = require("../../../../shared/types/billDataTypes");
|
|
12
|
+
var _DebtStatusLabel = _interopRequireDefault(require("./components/DebtStatusLabel"));
|
|
13
|
+
var _utils = require("./utils");
|
|
14
|
+
var _RateCard = _interopRequireDefault(require("./components/RateCard"));
|
|
15
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
+
const Billing = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
assets,
|
|
23
|
+
constants = {},
|
|
24
|
+
consumptionLevels = [],
|
|
25
|
+
components,
|
|
26
|
+
currentAccount = {},
|
|
27
|
+
handlers = {},
|
|
28
|
+
isDesktopSize,
|
|
29
|
+
smartBill = {},
|
|
30
|
+
translations,
|
|
31
|
+
utils = {}
|
|
32
|
+
} = _ref;
|
|
33
|
+
const {
|
|
34
|
+
formatters = {}
|
|
35
|
+
} = utils;
|
|
36
|
+
const {
|
|
37
|
+
clientNumberFormatter,
|
|
38
|
+
formatAmount
|
|
39
|
+
} = formatters;
|
|
40
|
+
const {
|
|
41
|
+
adherenceStatus,
|
|
42
|
+
subsidyLevels
|
|
43
|
+
} = constants;
|
|
44
|
+
const {
|
|
45
|
+
UtilityLogo
|
|
46
|
+
} = assets;
|
|
47
|
+
const {
|
|
48
|
+
handleAutomaticDebitAdherence = () => {},
|
|
49
|
+
handleDownloadBill = () => {},
|
|
50
|
+
handleGoToDigitalBill = () => {},
|
|
51
|
+
getConsumptionLevels = () => {}
|
|
52
|
+
} = handlers;
|
|
53
|
+
const {
|
|
54
|
+
adhered,
|
|
55
|
+
automaticDebit = {},
|
|
56
|
+
digitalBill = {},
|
|
57
|
+
downloadBill = {},
|
|
58
|
+
header = {},
|
|
59
|
+
notAdhered,
|
|
60
|
+
rateCard: rateCardTranslations,
|
|
61
|
+
ratesTableLink,
|
|
62
|
+
titularCard = {},
|
|
63
|
+
totalAmountLabel,
|
|
64
|
+
totalCard = {}
|
|
65
|
+
} = translations;
|
|
66
|
+
const {
|
|
67
|
+
billIssueDate,
|
|
68
|
+
billTypeHelpText
|
|
69
|
+
} = header;
|
|
70
|
+
const {
|
|
71
|
+
title: digitalBillTitle
|
|
72
|
+
} = digitalBill;
|
|
73
|
+
const {
|
|
74
|
+
title: downloadBillTitle
|
|
75
|
+
} = downloadBill;
|
|
76
|
+
const {
|
|
77
|
+
title: automaticDebitTitle
|
|
78
|
+
} = automaticDebit;
|
|
79
|
+
const {
|
|
80
|
+
title: titularCardTitle,
|
|
81
|
+
addressHelpText,
|
|
82
|
+
titularHelpText,
|
|
83
|
+
clientNumberHelpText,
|
|
84
|
+
ivaConditionHelpText
|
|
85
|
+
} = titularCard;
|
|
86
|
+
const {
|
|
87
|
+
firstExpiration
|
|
88
|
+
} = totalCard;
|
|
89
|
+
const {
|
|
90
|
+
bill_number: billNumber,
|
|
91
|
+
client,
|
|
92
|
+
debt_status_label: debtStatusLabel,
|
|
93
|
+
detail,
|
|
94
|
+
expirations
|
|
95
|
+
} = smartBill;
|
|
96
|
+
const debtStatusValidation = debtStatusLabel !== null;
|
|
97
|
+
const currentPeriod = (0, _utils.getCurrentPeriod)(smartBill);
|
|
98
|
+
const issuedOnDate = (0, _utils.getFormattedDate)(currentPeriod?.settlements?.current?.issued_on);
|
|
99
|
+
const isAdheredToDigitalBill = client?.adherence_to_digital_bill;
|
|
100
|
+
const {
|
|
101
|
+
account_address: accountAddress,
|
|
102
|
+
client_number: clientNumber = '',
|
|
103
|
+
holder_name: titularName,
|
|
104
|
+
postal_address: postalAddress,
|
|
105
|
+
iva_condition: ivaCondition
|
|
106
|
+
} = client || {};
|
|
107
|
+
const firstExpirationDate = (0, _utils.getFormattedDate)(expirations?.[0]?.date);
|
|
108
|
+
const {
|
|
109
|
+
total_amount: totalAmount
|
|
110
|
+
} = detail || {};
|
|
111
|
+
const {
|
|
112
|
+
adherence_to_automatic_debit: adherenceToAutomaticDebit,
|
|
113
|
+
normalized_rate: normalizedRate,
|
|
114
|
+
subsidy_level: subsidy
|
|
115
|
+
} = currentAccount;
|
|
116
|
+
const isAdheredToAutomaticDebit = adherenceToAutomaticDebit === adherenceStatus?.subscribed;
|
|
117
|
+
const actionCards = [{
|
|
118
|
+
isAdhered: isAdheredToDigitalBill,
|
|
119
|
+
leftIcon: 'IconReceipt',
|
|
120
|
+
onClick: !isAdheredToDigitalBill && handleGoToDigitalBill,
|
|
121
|
+
showStatus: true,
|
|
122
|
+
title: digitalBillTitle
|
|
123
|
+
}, {
|
|
124
|
+
isAdhered: isAdheredToAutomaticDebit,
|
|
125
|
+
leftIcon: 'IconCreditCard',
|
|
126
|
+
onClick: !isAdheredToAutomaticDebit && handleAutomaticDebitAdherence,
|
|
127
|
+
showStatus: true,
|
|
128
|
+
title: automaticDebitTitle
|
|
129
|
+
}, {
|
|
130
|
+
leftIcon: 'IconInfoCircle',
|
|
131
|
+
leftIconProps: {
|
|
132
|
+
area: true,
|
|
133
|
+
size: 28
|
|
134
|
+
},
|
|
135
|
+
onClick: handleDownloadBill,
|
|
136
|
+
rightIcon: 'IconDownload',
|
|
137
|
+
title: downloadBillTitle
|
|
138
|
+
}];
|
|
139
|
+
(0, _react.useEffect)(() => {
|
|
140
|
+
if ((0, _isEmpty.default)(consumptionLevels)) getConsumptionLevels();
|
|
141
|
+
}, []);
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
143
|
+
className: _stylesModule.default.generalContainer
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
+
className: _stylesModule.default.billHeader
|
|
146
|
+
}, UtilityLogo && /*#__PURE__*/_react.default.createElement(UtilityLogo, {
|
|
147
|
+
className: _stylesModule.default.logo
|
|
148
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
className: _stylesModule.default.billHeaderLabels
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
151
|
+
className: _stylesModule.default.valueAndHelpText
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
153
|
+
variant: "small"
|
|
154
|
+
}, billNumber), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
155
|
+
colorTheme: "gray",
|
|
156
|
+
variant: "small"
|
|
157
|
+
}, billTypeHelpText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
158
|
+
className: _stylesModule.default.valueAndHelpText
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
160
|
+
variant: "small"
|
|
161
|
+
}, issuedOnDate), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
162
|
+
colorTheme: "gray",
|
|
163
|
+
variant: "small"
|
|
164
|
+
}, billIssueDate)), debtStatusValidation && /*#__PURE__*/_react.default.createElement(_DebtStatusLabel.default, {
|
|
165
|
+
debtStatusLabel: debtStatusLabel,
|
|
166
|
+
isWarning: smartBill?.warning
|
|
167
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: _stylesModule.default.detailColumns
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
className: _stylesModule.default.column
|
|
171
|
+
}, actionCards?.map(_ref2 => {
|
|
172
|
+
let {
|
|
173
|
+
isAdhered,
|
|
174
|
+
leftIcon,
|
|
175
|
+
leftIconProps = {},
|
|
176
|
+
onClick,
|
|
177
|
+
rightIcon,
|
|
178
|
+
showStatus,
|
|
179
|
+
title
|
|
180
|
+
} = _ref2;
|
|
181
|
+
return /*#__PURE__*/_react.default.createElement(_energyUi.UTTouchableWithoutFeedback, {
|
|
182
|
+
className: `${_stylesModule.default.cardContainer} ${!onClick && _stylesModule.default.unclickableCardContainer}`,
|
|
183
|
+
disabled: !onClick,
|
|
184
|
+
key: title,
|
|
185
|
+
onClick: onClick,
|
|
186
|
+
withRipple: true
|
|
187
|
+
}, isDesktopSize && /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, _extends({
|
|
188
|
+
colorTheme: "gray",
|
|
189
|
+
name: leftIcon
|
|
190
|
+
}, leftIconProps)), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
191
|
+
className: _stylesModule.default.cardTitle,
|
|
192
|
+
variant: "subtitle1",
|
|
193
|
+
weight: "medium"
|
|
194
|
+
}, title), showStatus && /*#__PURE__*/_react.default.createElement(_energyUi.UTStatus, {
|
|
195
|
+
type: "light",
|
|
196
|
+
variant: isAdhered ? 'success' : 'unassigned',
|
|
197
|
+
withoutIcon: !isAdhered
|
|
198
|
+
}, isAdhered ? adhered : notAdhered), onClick && /*#__PURE__*/_react.default.createElement("div", {
|
|
199
|
+
className: _stylesModule.default.cardIconContainer
|
|
200
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, {
|
|
201
|
+
colorTheme: "accent",
|
|
202
|
+
name: rightIcon || 'IconChevronRight'
|
|
203
|
+
})));
|
|
204
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
205
|
+
className: _stylesModule.default.titularCard
|
|
206
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
207
|
+
variant: "title2",
|
|
208
|
+
weight: "medium"
|
|
209
|
+
}, titularCardTitle), /*#__PURE__*/_react.default.createElement("div", {
|
|
210
|
+
className: _stylesModule.default.titularDataContainer
|
|
211
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
+
className: _stylesModule.default.titularData
|
|
213
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
214
|
+
className: _stylesModule.default.titularDataTitle,
|
|
215
|
+
weight: "bold"
|
|
216
|
+
}, accountAddress), accountAddress !== postalAddress && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, null, postalAddress), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
217
|
+
colorTheme: "gray"
|
|
218
|
+
}, addressHelpText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
className: _stylesModule.default.titularData
|
|
220
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
221
|
+
className: _stylesModule.default.titularDataTitle,
|
|
222
|
+
weight: "bold"
|
|
223
|
+
}, titularName), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
224
|
+
colorTheme: "gray"
|
|
225
|
+
}, titularHelpText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
+
className: _stylesModule.default.titularFooter
|
|
227
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
+
className: _stylesModule.default.titularData
|
|
229
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
230
|
+
className: _stylesModule.default.titularDataTitle,
|
|
231
|
+
weight: "bold"
|
|
232
|
+
}, clientNumberFormatter?.(clientNumber)), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
233
|
+
colorTheme: "gray"
|
|
234
|
+
}, clientNumberHelpText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
235
|
+
className: _stylesModule.default.titularData
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
237
|
+
className: _stylesModule.default.titularDataTitle,
|
|
238
|
+
weight: "bold"
|
|
239
|
+
}, ivaCondition), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
240
|
+
colorTheme: "gray"
|
|
241
|
+
}, ivaConditionHelpText)))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
242
|
+
className: _stylesModule.default.column
|
|
243
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
244
|
+
className: _stylesModule.default.totalCard
|
|
245
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
246
|
+
className: _stylesModule.default.total
|
|
247
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
248
|
+
variant: "subtitle1",
|
|
249
|
+
weight: "medium"
|
|
250
|
+
}, totalAmountLabel), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
251
|
+
colorTheme: "accent",
|
|
252
|
+
variant: "title2",
|
|
253
|
+
weight: "medium"
|
|
254
|
+
}, formatAmount?.(totalAmount))), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
255
|
+
colorTheme: "gray",
|
|
256
|
+
variant: "small",
|
|
257
|
+
weight: "medium"
|
|
258
|
+
}, firstExpiration?.(firstExpirationDate))), /*#__PURE__*/_react.default.createElement(_RateCard.default, {
|
|
259
|
+
consumptionLevels,
|
|
260
|
+
components,
|
|
261
|
+
currentPeriod,
|
|
262
|
+
formatAmount,
|
|
263
|
+
normalizedRate,
|
|
264
|
+
rateCardTranslations,
|
|
265
|
+
ratesTableLink,
|
|
266
|
+
smartBill,
|
|
267
|
+
subsidy,
|
|
268
|
+
subsidyLevels,
|
|
269
|
+
translations
|
|
270
|
+
}))));
|
|
271
|
+
};
|
|
272
|
+
Billing.propTypes = {
|
|
273
|
+
assets: _propTypes.object,
|
|
274
|
+
constants: _propTypes.object,
|
|
275
|
+
consumptionLevels: _propTypes.array,
|
|
276
|
+
components: (0, _propTypes.shape)({
|
|
277
|
+
[_propTypes.string]: _propTypes.elementType
|
|
278
|
+
}),
|
|
279
|
+
currentAccount: _propTypes.object,
|
|
280
|
+
handlers: (0, _propTypes.shape)({
|
|
281
|
+
[_propTypes.string]: _propTypes.func
|
|
282
|
+
}),
|
|
283
|
+
isDesktopSize: _propTypes.bool,
|
|
284
|
+
smartBill: _billDataTypes.billDataTypes,
|
|
285
|
+
translations: _propTypes.object,
|
|
286
|
+
utils: _propTypes.object
|
|
287
|
+
};
|
|
288
|
+
var _default = exports.default = Billing;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
@import '../../../../scss/variables/mediaQueries.module.scss';
|
|
2
|
+
|
|
3
|
+
.generalContainer {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
grid-gap: 32px;
|
|
7
|
+
padding: 24px 32px;
|
|
8
|
+
|
|
9
|
+
@media #{$mobile} {
|
|
10
|
+
padding: 24px 16px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.billHeader {
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: var(--light01);
|
|
17
|
+
box-shadow: var(--shadowGrayBottom1);
|
|
18
|
+
display: flex;
|
|
19
|
+
grid-gap: 16px;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
padding: 12px 16px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.logo {
|
|
25
|
+
height: 35px;
|
|
26
|
+
object-fit: contain;
|
|
27
|
+
width: auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.billHeaderLabels {
|
|
31
|
+
align-items: center;
|
|
32
|
+
display: flex;
|
|
33
|
+
grid-gap: 32px;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
padding: 16px 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.valueAndHelpText {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
grid-gap: 4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.detailColumns {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex: 1;
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
grid-gap: 32px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.column {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex: 1;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
grid-gap: 24px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.cardContainer {
|
|
59
|
+
align-items: center;
|
|
60
|
+
background-color: var(--light01);
|
|
61
|
+
border-radius: 8px;
|
|
62
|
+
box-shadow: var(--shadowGrayBottom1);
|
|
63
|
+
display: flex;
|
|
64
|
+
grid-gap: 16px;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
padding: 16px;
|
|
67
|
+
transition: all 0.2s;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.unclickableCardContainer {
|
|
71
|
+
cursor: default;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cardTitle {
|
|
75
|
+
flex: 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cardIconContainer {
|
|
79
|
+
align-items: center;
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
padding: 8px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.titularCard {
|
|
86
|
+
background-color: var(--light01);
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
box-shadow: var(--shadowGrayBottom1);
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
grid-gap: 24px;
|
|
92
|
+
padding: 24px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.titularDataContainer {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.titularData {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex: 1;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
grid-gap: 8px;
|
|
105
|
+
padding: 12px 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.titularDataTitle {
|
|
109
|
+
padding: 4px 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.titularFooter {
|
|
113
|
+
display: flex;
|
|
114
|
+
grid-gap: 16px;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.totalCard {
|
|
119
|
+
background-color: var(--light01);
|
|
120
|
+
border-radius: 4px;
|
|
121
|
+
box-shadow: var(--shadowGrayBottom1);
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
grid-gap: 24px;
|
|
125
|
+
padding: 16px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.total {
|
|
129
|
+
display: flex;
|
|
130
|
+
grid-gap: 8px;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getFormattedDate = exports.getCurrentPeriod = void 0;
|
|
7
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
8
|
+
var _seamlessImmutable = require("seamless-immutable");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const getCurrentPeriod = billData => (0, _seamlessImmutable.getIn)(billData, ['periods'], []).find(period => period.current) || {};
|
|
11
|
+
exports.getCurrentPeriod = getCurrentPeriod;
|
|
12
|
+
const getFormattedDate = date => (0, _dayjs.default)(date, 'YYYY-MM-DD').format('DD/MM/YYYY');
|
|
13
|
+
exports.getFormattedDate = getFormattedDate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TAG_ICON_SIZE = exports.DEFAULT_TAG_ICON = exports.DEFAULT_TAG_COLOR_THEME = void 0;
|
|
7
|
+
const DEFAULT_TAG_ICON = exports.DEFAULT_TAG_ICON = 'IconCalendarEvent';
|
|
8
|
+
const TAG_ICON_SIZE = exports.TAG_ICON_SIZE = 14;
|
|
9
|
+
const DEFAULT_TAG_COLOR_THEME = exports.DEFAULT_TAG_COLOR_THEME = 'gray';
|