@mseva/digit-ui-module-ndc 1.0.26 → 1.0.27
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/dist/index.js +14636 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +96 -86
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -547,7 +547,7 @@ const Response = props => {
|
|
|
547
547
|
label: t("CORE_COMMON_GO_TO_NDC"),
|
|
548
548
|
onSubmit: onGoToNDC
|
|
549
549
|
}), /*#__PURE__*/React.createElement(SubmitBar$1, {
|
|
550
|
-
label: t("
|
|
550
|
+
label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
|
|
551
551
|
onSubmit: handlePayment
|
|
552
552
|
}))));
|
|
553
553
|
};
|
|
@@ -1117,6 +1117,24 @@ const ApplicationOverview = () => {
|
|
|
1117
1117
|
const [errorOne, setErrorOne] = useState(null);
|
|
1118
1118
|
const [displayData, setDisplayData] = useState({});
|
|
1119
1119
|
const [isDetailsLoading, setIsDetailsLoading] = useState(false);
|
|
1120
|
+
const [markedPending, setMarkedPending] = useState({});
|
|
1121
|
+
const handleMarkPending = consumerCode => {
|
|
1122
|
+
setMarkedPending(prev => {
|
|
1123
|
+
const updated = {
|
|
1124
|
+
...prev,
|
|
1125
|
+
[consumerCode]: !prev[consumerCode]
|
|
1126
|
+
};
|
|
1127
|
+
if (updated[consumerCode]) {
|
|
1128
|
+
console.log("✅ Marked dues pending for", consumerCode);
|
|
1129
|
+
} else {
|
|
1130
|
+
console.log("↩️ Undo marking dues pending for", consumerCode);
|
|
1131
|
+
}
|
|
1132
|
+
return updated;
|
|
1133
|
+
});
|
|
1134
|
+
};
|
|
1135
|
+
useEffect(() => {
|
|
1136
|
+
console.log("markedPending", markedPending);
|
|
1137
|
+
}, [markedPending]);
|
|
1120
1138
|
const {
|
|
1121
1139
|
isLoading,
|
|
1122
1140
|
data: applicationDetails
|
|
@@ -1263,8 +1281,13 @@ const ApplicationOverview = () => {
|
|
|
1263
1281
|
const payloadData = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications[0];
|
|
1264
1282
|
const updatedApplicant = {
|
|
1265
1283
|
...payloadData,
|
|
1284
|
+
NdcDetails: payloadData.NdcDetails.map(detail => ({
|
|
1285
|
+
...detail,
|
|
1286
|
+
isDuePending: markedPending[detail.consumerCode] || false
|
|
1287
|
+
})),
|
|
1266
1288
|
workflow: {}
|
|
1267
1289
|
};
|
|
1290
|
+
console.log("updatedApplicant", updatedApplicant);
|
|
1268
1291
|
const filtData = data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : _data$Licenses[0];
|
|
1269
1292
|
updatedApplicant.workflow = {
|
|
1270
1293
|
action: filtData.action,
|
|
@@ -1272,42 +1295,17 @@ const ApplicationOverview = () => {
|
|
|
1272
1295
|
comment: filtData === null || filtData === void 0 ? void 0 : filtData.comment,
|
|
1273
1296
|
documents: filtData === null || filtData === void 0 ? void 0 : filtData.wfDocuments
|
|
1274
1297
|
};
|
|
1275
|
-
|
|
1298
|
+
console.log("filtData action", filtData.action);
|
|
1299
|
+
if (!(filtData !== null && filtData !== void 0 && filtData.assignee) && filtData.action !== "SENDBACKTOCITIZEN" && filtData.action !== "APPROVE" && filtData.action !== "REJECT" && filtData.action !== "SENDBACK") {
|
|
1276
1300
|
setErrorOne("Assignee is Mandatory");
|
|
1277
1301
|
setShowErrorToastt(true);
|
|
1278
1302
|
return;
|
|
1279
|
-
} else if (!(filtData !== null && filtData !== void 0 && filtData.comment)
|
|
1303
|
+
} else if (!(filtData !== null && filtData !== void 0 && filtData.comment)) {
|
|
1280
1304
|
setErrorOne("Comment is Mandatory");
|
|
1281
1305
|
setShowErrorToastt(true);
|
|
1282
1306
|
return;
|
|
1283
1307
|
}
|
|
1284
|
-
|
|
1285
|
-
Applications: [updatedApplicant]
|
|
1286
|
-
};
|
|
1287
|
-
try {
|
|
1288
|
-
const response = await Digit.NDCService.NDCUpdate({
|
|
1289
|
-
tenantId,
|
|
1290
|
-
details: finalPayload
|
|
1291
|
-
});
|
|
1292
|
-
setShowToast({
|
|
1293
|
-
key: "success",
|
|
1294
|
-
message: "Successfully updated the status"
|
|
1295
|
-
});
|
|
1296
|
-
setError("Successfully updated the status");
|
|
1297
|
-
workflowDetails.revalidate();
|
|
1298
|
-
setTimeout(() => {
|
|
1299
|
-
history.push("/digit-ui/employee/ndc/inbox");
|
|
1300
|
-
window.location.reload();
|
|
1301
|
-
}, 2000);
|
|
1302
|
-
setSelectedAction(null);
|
|
1303
|
-
setShowModal(false);
|
|
1304
|
-
} catch (err) {
|
|
1305
|
-
setShowToast({
|
|
1306
|
-
key: "error",
|
|
1307
|
-
message: "Something went wrong"
|
|
1308
|
-
});
|
|
1309
|
-
setError("Something went wrong");
|
|
1310
|
-
}
|
|
1308
|
+
return;
|
|
1311
1309
|
};
|
|
1312
1310
|
const closeModal = () => {
|
|
1313
1311
|
setSelectedAction(null);
|
|
@@ -1317,9 +1315,7 @@ const ApplicationOverview = () => {
|
|
|
1317
1315
|
useEffect(() => {
|
|
1318
1316
|
if (displayData) {
|
|
1319
1317
|
var _displayData$NdcDetai, _checkProperty$;
|
|
1320
|
-
console.log("here");
|
|
1321
1318
|
const checkProperty = displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai = displayData.NdcDetails) === null || _displayData$NdcDetai === void 0 ? void 0 : _displayData$NdcDetai.filter(item => (item === null || item === void 0 ? void 0 : item.businessService) == "NDC_PROPERTY_TAX");
|
|
1322
|
-
console.log("checkProperty", checkProperty);
|
|
1323
1319
|
setPropertyId(checkProperty === null || checkProperty === void 0 ? void 0 : (_checkProperty$ = checkProperty[0]) === null || _checkProperty$ === void 0 ? void 0 : _checkProperty$.consumerCode);
|
|
1324
1320
|
}
|
|
1325
1321
|
}, [displayData]);
|
|
@@ -1352,6 +1348,11 @@ const ApplicationOverview = () => {
|
|
|
1352
1348
|
text: Array.isArray(value) ? value.map(item => typeof item === "object" ? t((item === null || item === void 0 ? void 0 : item.code) || "N/A") : t(item || "N/A")).join(", ") : typeof value === "object" ? t((value === null || value === void 0 ? void 0 : value.code) || "N/A") : t(value || "N/A")
|
|
1353
1349
|
}))))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai2 = displayData.NdcDetails) === null || _displayData$NdcDetai2 === void 0 ? void 0 : _displayData$NdcDetai2.map((detail, index) => {
|
|
1354
1350
|
var _detail$dueAmount, _propertyDetailsFetch, _propertyDetailsFetch2, _propertyDetailsFetch3, _propertyDetailsFetch4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18;
|
|
1351
|
+
const isPT = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_PROPERTY_TAX";
|
|
1352
|
+
const isSW = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_SEWERAGE_SERVICE_CONNECTION";
|
|
1353
|
+
const isWS = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_WATER_SERVICE_CONNECTION";
|
|
1354
|
+
const canRaiseFlag = isPT && (userRoles === null || userRoles === void 0 ? void 0 : userRoles.includes("NDC_PT_VERIFIER")) || (isSW || isWS) && (userRoles === null || userRoles === void 0 ? void 0 : userRoles.includes("NDC_WS_SW_VERIFIER"));
|
|
1355
|
+
const isMarked = markedPending[detail.consumerCode];
|
|
1355
1356
|
return /*#__PURE__*/React.createElement("div", {
|
|
1356
1357
|
key: index,
|
|
1357
1358
|
style: {
|
|
@@ -1372,7 +1373,7 @@ const ApplicationOverview = () => {
|
|
|
1372
1373
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
1373
1374
|
label: t("NDC_PROPERTY_TYPE"),
|
|
1374
1375
|
text: t(detail.propertyType) || detail.propertyType
|
|
1375
|
-
}),
|
|
1376
|
+
}), isPT && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Row, {
|
|
1376
1377
|
label: t("City"),
|
|
1377
1378
|
text: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch2 = _propertyDetailsFetch[0]) === null || _propertyDetailsFetch2 === void 0 ? void 0 : (_propertyDetailsFetch3 = _propertyDetailsFetch2.address) === null || _propertyDetailsFetch3 === void 0 ? void 0 : _propertyDetailsFetch3.city
|
|
1378
1379
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
@@ -1393,7 +1394,16 @@ const ApplicationOverview = () => {
|
|
|
1393
1394
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
1394
1395
|
label: t("Year of creation of Property"),
|
|
1395
1396
|
text: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch16 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch16 === void 0 ? void 0 : (_propertyDetailsFetch17 = _propertyDetailsFetch16[0]) === null || _propertyDetailsFetch17 === void 0 ? void 0 : (_propertyDetailsFetch18 = _propertyDetailsFetch17.additionalDetails) === null || _propertyDetailsFetch18 === void 0 ? void 0 : _propertyDetailsFetch18.yearConstruction
|
|
1396
|
-
})))
|
|
1397
|
+
}))), canRaiseFlag && /*#__PURE__*/React.createElement("div", {
|
|
1398
|
+
style: {
|
|
1399
|
+
marginTop: "16px",
|
|
1400
|
+
display: "flex",
|
|
1401
|
+
justifyContent: "right"
|
|
1402
|
+
}
|
|
1403
|
+
}, /*#__PURE__*/React.createElement(SubmitBar$1, {
|
|
1404
|
+
label: isMarked ? "Undo Mark Pending" : "Mark Dues Pending",
|
|
1405
|
+
onSubmit: () => handleMarkPending(detail === null || detail === void 0 ? void 0 : detail.consumerCode)
|
|
1406
|
+
})));
|
|
1397
1407
|
})), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
|
|
1398
1408
|
style: {
|
|
1399
1409
|
display: "flex",
|
|
@@ -11771,17 +11781,17 @@ const NewNDCStepFormOne = ({
|
|
|
11771
11781
|
}
|
|
11772
11782
|
};
|
|
11773
11783
|
function validateStepData(data) {
|
|
11774
|
-
var _data$cpt6, _data$
|
|
11784
|
+
var _data$cpt6, _data$cpt7, _data$cpt7$dues, _propertyDetails$wate, _propertyDetails$sewe;
|
|
11775
11785
|
const missingFields = [];
|
|
11776
11786
|
const invalidFields = [];
|
|
11777
11787
|
const cpt = (data === null || data === void 0 ? void 0 : data.cpt) || {};
|
|
11778
11788
|
const cptDetails = (cpt === null || cpt === void 0 ? void 0 : cpt.details) || {};
|
|
11779
11789
|
const propertyDetails = (data === null || data === void 0 ? void 0 : data.PropertyDetails) || {};
|
|
11780
11790
|
const NDCReason = (data === null || data === void 0 ? void 0 : data.NDCReason) || {};
|
|
11781
|
-
if ((data
|
|
11791
|
+
if (!(data !== null && data !== void 0 && (_data$cpt6 = data.cpt) !== null && _data$cpt6 !== void 0 && _data$cpt6.dues)) {
|
|
11782
11792
|
missingFields.push(`${t("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
|
|
11783
11793
|
}
|
|
11784
|
-
if (data
|
|
11794
|
+
if ((data === null || data === void 0 ? void 0 : (_data$cpt7 = data.cpt) === null || _data$cpt7 === void 0 ? void 0 : (_data$cpt7$dues = _data$cpt7.dues) === null || _data$cpt7$dues === void 0 ? void 0 : _data$cpt7$dues.totalAmount) > 0) {
|
|
11785
11795
|
missingFields.push(`${t("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
|
|
11786
11796
|
}
|
|
11787
11797
|
if ((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.length) > 0) {
|
|
@@ -11814,7 +11824,7 @@ const NewNDCStepFormOne = ({
|
|
|
11814
11824
|
if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
|
|
11815
11825
|
if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
|
|
11816
11826
|
const nameRegex = /^[A-Za-z\s]+$/;
|
|
11817
|
-
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]
|
|
11827
|
+
const emailRegex = /^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/;
|
|
11818
11828
|
const mobileRegex = /^[6-9]\d{9}$/;
|
|
11819
11829
|
if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
|
|
11820
11830
|
invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
|
|
@@ -11966,7 +11976,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
11966
11976
|
formState,
|
|
11967
11977
|
clearErrors
|
|
11968
11978
|
}) => {
|
|
11969
|
-
var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$
|
|
11979
|
+
var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _apiDataCheck$5, _propertyDetails$wate, _propertyDetails$sewe;
|
|
11970
11980
|
const {
|
|
11971
11981
|
control,
|
|
11972
11982
|
formState: localFormState,
|
|
@@ -12022,21 +12032,23 @@ const PropertyDetailsForm$1 = ({
|
|
|
12022
12032
|
t
|
|
12023
12033
|
});
|
|
12024
12034
|
useEffect(() => {
|
|
12025
|
-
var _formData$cpt2, _formData$cpt2$detail, _formData$cpt2$detail2, _owner$name, _formData$PropertyDet, _formData$PropertyDet2;
|
|
12035
|
+
var _formData$cpt2, _formData$cpt2$detail, _formData$cpt2$detail2, _owner$name, _formData$PropertyDet, _formData$PropertyDet2, _formData$PropertyDet3;
|
|
12036
|
+
console.log("coming here everytime", formData);
|
|
12026
12037
|
const owner = formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : (_formData$cpt2$detail = _formData$cpt2.details) === null || _formData$cpt2$detail === void 0 ? void 0 : (_formData$cpt2$detail2 = _formData$cpt2$detail.owners) === null || _formData$cpt2$detail2 === void 0 ? void 0 : _formData$cpt2$detail2[0];
|
|
12027
12038
|
const fullName = owner === null || owner === void 0 ? void 0 : (_owner$name = owner.name) === null || _owner$name === void 0 ? void 0 : _owner$name.split(" ");
|
|
12028
12039
|
const firstName = owner === null || owner === void 0 ? void 0 : owner.name;
|
|
12029
|
-
|
|
12040
|
+
console.log("ikiki email", owner === null || owner === void 0 ? void 0 : owner.emailId);
|
|
12041
|
+
const email = (owner === null || owner === void 0 ? void 0 : owner.emailId) || (formData === null || formData === void 0 ? void 0 : (_formData$PropertyDet = formData.PropertyDetails) === null || _formData$PropertyDet === void 0 ? void 0 : _formData$PropertyDet.email) || "";
|
|
12030
12042
|
const mobileNumber = owner === null || owner === void 0 ? void 0 : owner.mobileNumber;
|
|
12031
12043
|
const address = owner === null || owner === void 0 ? void 0 : owner.permanentAddress;
|
|
12032
12044
|
const combinedObject = {};
|
|
12033
12045
|
if (firstName) combinedObject.firstName = firstName;
|
|
12034
|
-
|
|
12046
|
+
combinedObject.email = email;
|
|
12035
12047
|
if (mobileNumber) combinedObject.mobileNumber = mobileNumber;
|
|
12036
12048
|
if (address) combinedObject.address = address;
|
|
12037
12049
|
combinedObject.propertyBillData = {
|
|
12038
12050
|
isLoading: false,
|
|
12039
|
-
billData: (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12051
|
+
billData: (formData === null || formData === void 0 ? void 0 : (_formData$PropertyDet2 = formData.PropertyDetails) === null || _formData$PropertyDet2 === void 0 ? void 0 : (_formData$PropertyDet3 = _formData$PropertyDet2.propertyBillData) === null || _formData$PropertyDet3 === void 0 ? void 0 : _formData$PropertyDet3.billData) || {}
|
|
12040
12052
|
};
|
|
12041
12053
|
setPropertyDetails(prev => {
|
|
12042
12054
|
return {
|
|
@@ -12045,6 +12057,9 @@ const PropertyDetailsForm$1 = ({
|
|
|
12045
12057
|
};
|
|
12046
12058
|
});
|
|
12047
12059
|
}, [formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : _formData$cpt3.details]);
|
|
12060
|
+
useEffect(() => {
|
|
12061
|
+
console.log("updated propertyDetails", propertyDetails);
|
|
12062
|
+
}, [propertyDetails]);
|
|
12048
12063
|
useEffect(() => {
|
|
12049
12064
|
var _apiDataCheck$;
|
|
12050
12065
|
let waterConnection;
|
|
@@ -12361,35 +12376,11 @@ const PropertyDetailsForm$1 = ({
|
|
|
12361
12376
|
return () => clearTimeout(timer);
|
|
12362
12377
|
}
|
|
12363
12378
|
}, [showToast]);
|
|
12364
|
-
useEffect(() => {
|
|
12365
|
-
if (apiDataCheck) {
|
|
12366
|
-
var _apiDataCheck$5, _apiDataCheck$5$owner, _apiDataCheck$5$owner2;
|
|
12367
|
-
const apiEmail = (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$owner = _apiDataCheck$5.owners) === null || _apiDataCheck$5$owner === void 0 ? void 0 : (_apiDataCheck$5$owner2 = _apiDataCheck$5$owner[0]) === null || _apiDataCheck$5$owner2 === void 0 ? void 0 : _apiDataCheck$5$owner2.emailId) || "";
|
|
12368
|
-
setValue("email", apiEmail);
|
|
12369
|
-
setPropertyDetails(prev => ({
|
|
12370
|
-
...prev,
|
|
12371
|
-
email: apiEmail
|
|
12372
|
-
}));
|
|
12373
|
-
}
|
|
12374
|
-
}, [apiDataCheck]);
|
|
12375
|
-
useEffect(() => {
|
|
12376
|
-
var _formData$cpt4, _formData$cpt4$detail;
|
|
12377
|
-
if (formData !== null && formData !== void 0 && (_formData$cpt4 = formData.cpt) !== null && _formData$cpt4 !== void 0 && (_formData$cpt4$detail = _formData$cpt4.details) !== null && _formData$cpt4$detail !== void 0 && _formData$cpt4$detail.owners) {
|
|
12378
|
-
var _formData$cpt5, _formData$cpt5$detail, _formData$cpt5$detail2, _formData$cpt5$detail3;
|
|
12379
|
-
const formDataEmail = formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : (_formData$cpt5$detail = _formData$cpt5.details) === null || _formData$cpt5$detail === void 0 ? void 0 : (_formData$cpt5$detail2 = _formData$cpt5$detail.owners) === null || _formData$cpt5$detail2 === void 0 ? void 0 : (_formData$cpt5$detail3 = _formData$cpt5$detail2[0]) === null || _formData$cpt5$detail3 === void 0 ? void 0 : _formData$cpt5$detail3.emailId;
|
|
12380
|
-
setValue("email", formDataEmail);
|
|
12381
|
-
setPropertyDetails(prev => ({
|
|
12382
|
-
...prev,
|
|
12383
|
-
email: formDataEmail
|
|
12384
|
-
}));
|
|
12385
|
-
}
|
|
12386
|
-
}, [formData === null || formData === void 0 ? void 0 : (_formData$cpt6 = formData.cpt) === null || _formData$cpt6 === void 0 ? void 0 : (_formData$cpt6$detail = _formData$cpt6.details) === null || _formData$cpt6$detail === void 0 ? void 0 : _formData$cpt6$detail.owners]);
|
|
12387
|
-
console.log("propertyDetails====", propertyDetails, formData);
|
|
12388
12379
|
return /*#__PURE__*/React.createElement("div", {
|
|
12389
12380
|
style: {
|
|
12390
12381
|
marginBottom: "16px"
|
|
12391
12382
|
}
|
|
12392
|
-
}, ((formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12383
|
+
}, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : _formData$cpt4.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : _apiDataCheck$5.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
12393
12384
|
style: {
|
|
12394
12385
|
marginTop: "40px"
|
|
12395
12386
|
}
|
|
@@ -12404,7 +12395,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12404
12395
|
width: "100%"
|
|
12405
12396
|
}
|
|
12406
12397
|
}, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.map((item, index) => {
|
|
12407
|
-
var _apiDataCheck$
|
|
12398
|
+
var _apiDataCheck$6, _item$billData, _item$billData2, _item$billData3, _item$billData4;
|
|
12408
12399
|
return /*#__PURE__*/React.createElement("div", {
|
|
12409
12400
|
className: "ndc_property_search",
|
|
12410
12401
|
key: index,
|
|
@@ -12445,7 +12436,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12445
12436
|
alignItems: "center",
|
|
12446
12437
|
gap: "12px"
|
|
12447
12438
|
}
|
|
12448
|
-
}, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$
|
|
12439
|
+
}, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$6 = apiDataCheck[0]) !== null && _apiDataCheck$6 !== void 0 && _apiDataCheck$6.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData = item.billData) !== null && _item$billData !== void 0 && _item$billData.id) && (item === null || item === void 0 ? void 0 : (_item$billData2 = item.billData) === null || _item$billData2 === void 0 ? void 0 : _item$billData2.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
|
|
12449
12440
|
className: "submit-bar",
|
|
12450
12441
|
type: "button",
|
|
12451
12442
|
style: {
|
|
@@ -12512,7 +12503,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12512
12503
|
width: "100%"
|
|
12513
12504
|
}
|
|
12514
12505
|
}, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$sewe = propertyDetails.sewerageConnection) === null || _propertyDetails$sewe === void 0 ? void 0 : _propertyDetails$sewe.map((item, index) => {
|
|
12515
|
-
var _apiDataCheck$
|
|
12506
|
+
var _apiDataCheck$7, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
|
|
12516
12507
|
return /*#__PURE__*/React.createElement("div", {
|
|
12517
12508
|
className: "ndc_property_search",
|
|
12518
12509
|
key: index,
|
|
@@ -12553,7 +12544,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12553
12544
|
alignItems: "center",
|
|
12554
12545
|
gap: "12px"
|
|
12555
12546
|
}
|
|
12556
|
-
}, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$
|
|
12547
|
+
}, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$7 = apiDataCheck[0]) !== null && _apiDataCheck$7 !== void 0 && _apiDataCheck$7.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData5 = item.billData) !== null && _item$billData5 !== void 0 && _item$billData5.id) && (item === null || item === void 0 ? void 0 : (_item$billData6 = item.billData) === null || _item$billData6 === void 0 ? void 0 : _item$billData6.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
|
|
12557
12548
|
className: "submit-bar",
|
|
12558
12549
|
type: "button",
|
|
12559
12550
|
style: {
|
|
@@ -12624,7 +12615,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12624
12615
|
}
|
|
12625
12616
|
},
|
|
12626
12617
|
render: props => {
|
|
12627
|
-
var _formData$
|
|
12618
|
+
var _formData$cpt5, _formData$cpt5$detail, _formData$cpt5$detail2, _formData$cpt5$detail3, _formData$cpt5$detail4, _formData$cpt5$detail5, _formData$cpt5$detail6;
|
|
12628
12619
|
return /*#__PURE__*/React.createElement(TextInput, {
|
|
12629
12620
|
value: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.firstName) || "",
|
|
12630
12621
|
onChange: e => {
|
|
@@ -12637,7 +12628,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12637
12628
|
onBlur: e => {
|
|
12638
12629
|
props.onBlur(e);
|
|
12639
12630
|
},
|
|
12640
|
-
disabled: (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12631
|
+
disabled: (formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : (_formData$cpt5$detail = _formData$cpt5.details) === null || _formData$cpt5$detail === void 0 ? void 0 : (_formData$cpt5$detail2 = _formData$cpt5$detail.owners) === null || _formData$cpt5$detail2 === void 0 ? void 0 : (_formData$cpt5$detail3 = _formData$cpt5$detail2[0]) === null || _formData$cpt5$detail3 === void 0 ? void 0 : (_formData$cpt5$detail4 = _formData$cpt5$detail3.name) === null || _formData$cpt5$detail4 === void 0 ? void 0 : (_formData$cpt5$detail5 = _formData$cpt5$detail4.split(" ")) === null || _formData$cpt5$detail5 === void 0 ? void 0 : (_formData$cpt5$detail6 = _formData$cpt5$detail5[0]) === null || _formData$cpt5$detail6 === void 0 ? void 0 : _formData$cpt5$detail6.length) > 0
|
|
12641
12632
|
});
|
|
12642
12633
|
}
|
|
12643
12634
|
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
@@ -12691,7 +12682,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12691
12682
|
name: "address",
|
|
12692
12683
|
defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address) || "",
|
|
12693
12684
|
render: props => {
|
|
12694
|
-
var _formData$
|
|
12685
|
+
var _formData$cpt6, _formData$cpt6$detail, _formData$cpt6$detail2, _formData$cpt6$detail3, _formData$cpt6$detail4;
|
|
12695
12686
|
return /*#__PURE__*/React.createElement(TextInput, {
|
|
12696
12687
|
value: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address,
|
|
12697
12688
|
onChange: e => {
|
|
@@ -12704,7 +12695,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12704
12695
|
onBlur: e => {
|
|
12705
12696
|
props.onBlur(e);
|
|
12706
12697
|
},
|
|
12707
|
-
disabled: (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12698
|
+
disabled: (formData === null || formData === void 0 ? void 0 : (_formData$cpt6 = formData.cpt) === null || _formData$cpt6 === void 0 ? void 0 : (_formData$cpt6$detail = _formData$cpt6.details) === null || _formData$cpt6$detail === void 0 ? void 0 : (_formData$cpt6$detail2 = _formData$cpt6$detail.owners) === null || _formData$cpt6$detail2 === void 0 ? void 0 : (_formData$cpt6$detail3 = _formData$cpt6$detail2[0]) === null || _formData$cpt6$detail3 === void 0 ? void 0 : (_formData$cpt6$detail4 = _formData$cpt6$detail3.permanentAddress) === null || _formData$cpt6$detail4 === void 0 ? void 0 : _formData$cpt6$detail4.length) > 0
|
|
12708
12699
|
});
|
|
12709
12700
|
}
|
|
12710
12701
|
})))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
@@ -12750,7 +12741,7 @@ const PropertySearchNSummary = ({
|
|
|
12750
12741
|
onSelect,
|
|
12751
12742
|
formData
|
|
12752
12743
|
}) => {
|
|
12753
|
-
var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$
|
|
12744
|
+
var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$cpt12, _formData$cpt12$dues;
|
|
12754
12745
|
const {
|
|
12755
12746
|
t
|
|
12756
12747
|
} = useTranslation();
|
|
@@ -12771,7 +12762,6 @@ const PropertySearchNSummary = ({
|
|
|
12771
12762
|
const urlPropertyId = new URLSearchParams(search).get("propertyId");
|
|
12772
12763
|
const isfirstRender = useRef(true);
|
|
12773
12764
|
const ptFromApi = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : (_apiDataCheck$$NdcDet = _apiDataCheck$.NdcDetails) === null || _apiDataCheck$$NdcDet === void 0 ? void 0 : _apiDataCheck$$NdcDet.find(item => item.businessService == "PT");
|
|
12774
|
-
console.log("ptFromApi", ptFromApi);
|
|
12775
12765
|
const [propertyId, setPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cpt = formData.cpt) === null || _formData$cpt === void 0 ? void 0 : _formData$cpt.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || (ptFromApi === null || ptFromApi === void 0 ? void 0 : ptFromApi.consumerCode) || "");
|
|
12776
12766
|
const [searchPropertyId, setSearchPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || (ptFromApi === null || ptFromApi === void 0 ? void 0 : ptFromApi.consumerCode) || "");
|
|
12777
12767
|
const [showToast, setShowToast] = useState(null);
|
|
@@ -12827,7 +12817,6 @@ const PropertySearchNSummary = ({
|
|
|
12827
12817
|
enabled: searchPropertyId ? true : false,
|
|
12828
12818
|
privacy: Digit.Utils.getPrivacyObject()
|
|
12829
12819
|
});
|
|
12830
|
-
console.log("apiDataCheck", apiDataCheck);
|
|
12831
12820
|
useEffect(() => {
|
|
12832
12821
|
if (ptFromApi !== null && ptFromApi !== void 0 && ptFromApi.consumerCode) {
|
|
12833
12822
|
setIsSearchClicked(true);
|
|
@@ -12900,6 +12889,21 @@ const PropertySearchNSummary = ({
|
|
|
12900
12889
|
});
|
|
12901
12890
|
setSearchPropertyId(propertyId);
|
|
12902
12891
|
setIsSearchClicked(true);
|
|
12892
|
+
setPropertyDues({
|
|
12893
|
+
dues: null
|
|
12894
|
+
});
|
|
12895
|
+
onSelect("PropertyDetails", {
|
|
12896
|
+
email: "",
|
|
12897
|
+
propertyBillData: {
|
|
12898
|
+
isLoading: false,
|
|
12899
|
+
billData: {}
|
|
12900
|
+
},
|
|
12901
|
+
waterConnection: [],
|
|
12902
|
+
sewerageConnection: [],
|
|
12903
|
+
firstName: "",
|
|
12904
|
+
mobileNumber: "",
|
|
12905
|
+
address: ""
|
|
12906
|
+
});
|
|
12903
12907
|
dispatch(resetNDCForm());
|
|
12904
12908
|
}
|
|
12905
12909
|
};
|
|
@@ -13056,19 +13060,25 @@ const PropertySearchNSummary = ({
|
|
|
13056
13060
|
onClick: () => {
|
|
13057
13061
|
fetchBill();
|
|
13058
13062
|
}
|
|
13059
|
-
}, `${t("CHECK_STATUS_PROPERTY")}`), getPayDuesButton && /*#__PURE__*/React.createElement("
|
|
13063
|
+
}, `${t("CHECK_STATUS_PROPERTY")}`), getPayDuesButton && /*#__PURE__*/React.createElement("div", {
|
|
13064
|
+
style: {
|
|
13065
|
+
color: "red",
|
|
13066
|
+
width: "100%",
|
|
13067
|
+
maxWidth: "70px"
|
|
13068
|
+
}
|
|
13069
|
+
}, "Rs. ", formData === null || formData === void 0 ? void 0 : (_formData$cpt12 = formData.cpt) === null || _formData$cpt12 === void 0 ? void 0 : (_formData$cpt12$dues = _formData$cpt12.dues) === null || _formData$cpt12$dues === void 0 ? void 0 : _formData$cpt12$dues.totalAmount, " "), getPayDuesButton && /*#__PURE__*/React.createElement("button", {
|
|
13060
13070
|
className: "submit-bar",
|
|
13061
13071
|
type: "button",
|
|
13062
13072
|
style: {
|
|
13063
13073
|
color: "white",
|
|
13064
13074
|
width: "100%",
|
|
13065
|
-
maxWidth: "
|
|
13075
|
+
maxWidth: "115px"
|
|
13066
13076
|
},
|
|
13067
13077
|
onClick: () => {
|
|
13068
13078
|
redirectToPayBill();
|
|
13069
13079
|
setPayDuesButton(false);
|
|
13070
13080
|
}
|
|
13071
|
-
}, `${t("PAY_DUES")}
|
|
13081
|
+
}, `${t("PAY_DUES")} `), getNoDue && /*#__PURE__*/React.createElement("div", {
|
|
13072
13082
|
style: {
|
|
13073
13083
|
color: "green",
|
|
13074
13084
|
width: "100%",
|
|
@@ -14008,7 +14018,7 @@ const NewNDCStepFormOne$1 = ({
|
|
|
14008
14018
|
}
|
|
14009
14019
|
};
|
|
14010
14020
|
function validateStepData(data) {
|
|
14011
|
-
var _data$cpt6, _data$
|
|
14021
|
+
var _data$cpt6, _data$cpt7, _data$cpt7$dues, _propertyDetails$wate, _propertyDetails$sewe;
|
|
14012
14022
|
console.log("data", data);
|
|
14013
14023
|
const missingFields = [];
|
|
14014
14024
|
const invalidFields = [];
|
|
@@ -14016,10 +14026,10 @@ const NewNDCStepFormOne$1 = ({
|
|
|
14016
14026
|
const cptDetails = (cpt === null || cpt === void 0 ? void 0 : cpt.details) || {};
|
|
14017
14027
|
const propertyDetails = (data === null || data === void 0 ? void 0 : data.PropertyDetails) || {};
|
|
14018
14028
|
const NDCReason = (data === null || data === void 0 ? void 0 : data.NDCReason) || {};
|
|
14019
|
-
if ((data
|
|
14029
|
+
if (!(data !== null && data !== void 0 && (_data$cpt6 = data.cpt) !== null && _data$cpt6 !== void 0 && _data$cpt6.dues)) {
|
|
14020
14030
|
invalidFields.push(`${t("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
|
|
14021
14031
|
}
|
|
14022
|
-
if (data
|
|
14032
|
+
if ((data === null || data === void 0 ? void 0 : (_data$cpt7 = data.cpt) === null || _data$cpt7 === void 0 ? void 0 : (_data$cpt7$dues = _data$cpt7.dues) === null || _data$cpt7$dues === void 0 ? void 0 : _data$cpt7$dues.totalAmount) > 0) {
|
|
14023
14033
|
invalidFields.push(`${t("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
|
|
14024
14034
|
}
|
|
14025
14035
|
if ((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.length) > 0) {
|
|
@@ -14052,7 +14062,7 @@ const NewNDCStepFormOne$1 = ({
|
|
|
14052
14062
|
if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
|
|
14053
14063
|
if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
|
|
14054
14064
|
const nameRegex = /^[A-Za-z\s]+$/;
|
|
14055
|
-
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]
|
|
14065
|
+
const emailRegex = /^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/;
|
|
14056
14066
|
const mobileRegex = /^[6-9]\d{9}$/;
|
|
14057
14067
|
if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
|
|
14058
14068
|
invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
|