@mseva/digit-ui-module-ndc 1.0.26 → 1.0.28

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.
@@ -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("COMMON_MAKE_PAYMENT"),
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,11 +1295,12 @@ 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
- if (!(filtData !== null && filtData !== void 0 && filtData.assignee) && filtData.action == "FORWARD") {
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) && ((filtData === null || filtData === void 0 ? void 0 : filtData.action) == "FORWARD" || (filtData === null || filtData === void 0 ? void 0 : filtData.action) == "REJECT")) {
1303
+ } else if (!(filtData !== null && filtData !== void 0 && filtData.comment)) {
1280
1304
  setErrorOne("Comment is Mandatory");
1281
1305
  setShowErrorToastt(true);
1282
1306
  return;
@@ -1317,9 +1341,7 @@ const ApplicationOverview = () => {
1317
1341
  useEffect(() => {
1318
1342
  if (displayData) {
1319
1343
  var _displayData$NdcDetai, _checkProperty$;
1320
- console.log("here");
1321
1344
  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
1345
  setPropertyId(checkProperty === null || checkProperty === void 0 ? void 0 : (_checkProperty$ = checkProperty[0]) === null || _checkProperty$ === void 0 ? void 0 : _checkProperty$.consumerCode);
1324
1346
  }
1325
1347
  }, [displayData]);
@@ -1352,6 +1374,11 @@ const ApplicationOverview = () => {
1352
1374
  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
1375
  }))))), /*#__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
1376
  var _detail$dueAmount, _propertyDetailsFetch, _propertyDetailsFetch2, _propertyDetailsFetch3, _propertyDetailsFetch4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18;
1377
+ const isPT = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_PROPERTY_TAX";
1378
+ const isSW = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_SEWERAGE_SERVICE_CONNECTION";
1379
+ const isWS = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_WATER_SERVICE_CONNECTION";
1380
+ 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"));
1381
+ const isMarked = markedPending[detail.consumerCode];
1355
1382
  return /*#__PURE__*/React.createElement("div", {
1356
1383
  key: index,
1357
1384
  style: {
@@ -1372,7 +1399,7 @@ const ApplicationOverview = () => {
1372
1399
  }), /*#__PURE__*/React.createElement(Row, {
1373
1400
  label: t("NDC_PROPERTY_TYPE"),
1374
1401
  text: t(detail.propertyType) || detail.propertyType
1375
- }), (detail === null || detail === void 0 ? void 0 : detail.businessService) == "NDC_PROPERTY_TAX" && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Row, {
1402
+ }), isPT && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Row, {
1376
1403
  label: t("City"),
1377
1404
  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
1405
  }), /*#__PURE__*/React.createElement(Row, {
@@ -1393,7 +1420,16 @@ const ApplicationOverview = () => {
1393
1420
  }), /*#__PURE__*/React.createElement(Row, {
1394
1421
  label: t("Year of creation of Property"),
1395
1422
  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
- }))));
1423
+ }))), canRaiseFlag && /*#__PURE__*/React.createElement("div", {
1424
+ style: {
1425
+ marginTop: "16px",
1426
+ display: "flex",
1427
+ justifyContent: "right"
1428
+ }
1429
+ }, /*#__PURE__*/React.createElement(SubmitBar$1, {
1430
+ label: isMarked ? "Undo Mark Pending" : "Mark Dues Pending",
1431
+ onSubmit: () => handleMarkPending(detail === null || detail === void 0 ? void 0 : detail.consumerCode)
1432
+ })));
1397
1433
  })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
1398
1434
  style: {
1399
1435
  display: "flex",
@@ -11771,17 +11807,17 @@ const NewNDCStepFormOne = ({
11771
11807
  }
11772
11808
  };
11773
11809
  function validateStepData(data) {
11774
- var _data$cpt6, _data$cpt6$dues, _data$cpt7, _data$cpt7$dues, _data$dues, _propertyDetails$wate, _propertyDetails$sewe;
11810
+ var _data$cpt6, _data$cpt7, _data$cpt7$dues, _propertyDetails$wate, _propertyDetails$sewe;
11775
11811
  const missingFields = [];
11776
11812
  const invalidFields = [];
11777
11813
  const cpt = (data === null || data === void 0 ? void 0 : data.cpt) || {};
11778
11814
  const cptDetails = (cpt === null || cpt === void 0 ? void 0 : cpt.details) || {};
11779
11815
  const propertyDetails = (data === null || data === void 0 ? void 0 : data.PropertyDetails) || {};
11780
11816
  const NDCReason = (data === null || data === void 0 ? void 0 : data.NDCReason) || {};
11781
- if ((data === null || data === void 0 ? void 0 : (_data$cpt6 = data.cpt) === null || _data$cpt6 === void 0 ? void 0 : (_data$cpt6$dues = _data$cpt6.dues) === null || _data$cpt6$dues === void 0 ? void 0 : _data$cpt6$dues.totalAmount) != 0) {
11817
+ if (!(data !== null && data !== void 0 && (_data$cpt6 = data.cpt) !== null && _data$cpt6 !== void 0 && _data$cpt6.dues)) {
11782
11818
  missingFields.push(`${t("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
11783
11819
  }
11784
- if (data !== null && data !== void 0 && (_data$cpt7 = data.cpt) !== null && _data$cpt7 !== void 0 && (_data$cpt7$dues = _data$cpt7.dues) !== null && _data$cpt7$dues !== void 0 && _data$cpt7$dues.id && (data === null || data === void 0 ? void 0 : (_data$dues = data.dues) === null || _data$dues === void 0 ? void 0 : _data$dues.totalAmount) > 0) {
11820
+ 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
11821
  missingFields.push(`${t("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
11786
11822
  }
11787
11823
  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 +11850,7 @@ const NewNDCStepFormOne = ({
11814
11850
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
11815
11851
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
11816
11852
  const nameRegex = /^[A-Za-z\s]+$/;
11817
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
11853
+ const emailRegex = /^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/;
11818
11854
  const mobileRegex = /^[6-9]\d{9}$/;
11819
11855
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
11820
11856
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
@@ -11966,7 +12002,7 @@ const PropertyDetailsForm$1 = ({
11966
12002
  formState,
11967
12003
  clearErrors
11968
12004
  }) => {
11969
- var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt6, _formData$cpt6$detail, _formData$cpt7, _apiDataCheck$6, _propertyDetails$wate, _propertyDetails$sewe;
12005
+ var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _apiDataCheck$5, _propertyDetails$wate, _propertyDetails$sewe;
11970
12006
  const {
11971
12007
  control,
11972
12008
  formState: localFormState,
@@ -12022,21 +12058,23 @@ const PropertyDetailsForm$1 = ({
12022
12058
  t
12023
12059
  });
12024
12060
  useEffect(() => {
12025
- var _formData$cpt2, _formData$cpt2$detail, _formData$cpt2$detail2, _owner$name, _formData$PropertyDet, _formData$PropertyDet2;
12061
+ var _formData$cpt2, _formData$cpt2$detail, _formData$cpt2$detail2, _owner$name, _formData$PropertyDet, _formData$PropertyDet2, _formData$PropertyDet3;
12062
+ console.log("coming here everytime", formData);
12026
12063
  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
12064
  const fullName = owner === null || owner === void 0 ? void 0 : (_owner$name = owner.name) === null || _owner$name === void 0 ? void 0 : _owner$name.split(" ");
12028
12065
  const firstName = owner === null || owner === void 0 ? void 0 : owner.name;
12029
- const email = owner === null || owner === void 0 ? void 0 : owner.email;
12066
+ console.log("ikiki email", owner === null || owner === void 0 ? void 0 : owner.emailId);
12067
+ 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
12068
  const mobileNumber = owner === null || owner === void 0 ? void 0 : owner.mobileNumber;
12031
12069
  const address = owner === null || owner === void 0 ? void 0 : owner.permanentAddress;
12032
12070
  const combinedObject = {};
12033
12071
  if (firstName) combinedObject.firstName = firstName;
12034
- if (email) combinedObject.email = email;
12072
+ combinedObject.email = email;
12035
12073
  if (mobileNumber) combinedObject.mobileNumber = mobileNumber;
12036
12074
  if (address) combinedObject.address = address;
12037
12075
  combinedObject.propertyBillData = {
12038
12076
  isLoading: false,
12039
- billData: (formData === null || formData === void 0 ? void 0 : (_formData$PropertyDet = formData.PropertyDetails) === null || _formData$PropertyDet === void 0 ? void 0 : (_formData$PropertyDet2 = _formData$PropertyDet.propertyBillData) === null || _formData$PropertyDet2 === void 0 ? void 0 : _formData$PropertyDet2.billData) || {}
12077
+ 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
12078
  };
12041
12079
  setPropertyDetails(prev => {
12042
12080
  return {
@@ -12045,6 +12083,9 @@ const PropertyDetailsForm$1 = ({
12045
12083
  };
12046
12084
  });
12047
12085
  }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : _formData$cpt3.details]);
12086
+ useEffect(() => {
12087
+ console.log("updated propertyDetails", propertyDetails);
12088
+ }, [propertyDetails]);
12048
12089
  useEffect(() => {
12049
12090
  var _apiDataCheck$;
12050
12091
  let waterConnection;
@@ -12361,35 +12402,11 @@ const PropertyDetailsForm$1 = ({
12361
12402
  return () => clearTimeout(timer);
12362
12403
  }
12363
12404
  }, [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
12405
  return /*#__PURE__*/React.createElement("div", {
12389
12406
  style: {
12390
12407
  marginBottom: "16px"
12391
12408
  }
12392
- }, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt7 = formData.cpt) === null || _formData$cpt7 === void 0 ? void 0 : _formData$cpt7.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : _apiDataCheck$6.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
12409
+ }, ((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
12410
  style: {
12394
12411
  marginTop: "40px"
12395
12412
  }
@@ -12404,7 +12421,7 @@ const PropertyDetailsForm$1 = ({
12404
12421
  width: "100%"
12405
12422
  }
12406
12423
  }, 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$7, _item$billData, _item$billData2, _item$billData3, _item$billData4;
12424
+ var _apiDataCheck$6, _item$billData, _item$billData2, _item$billData3, _item$billData4;
12408
12425
  return /*#__PURE__*/React.createElement("div", {
12409
12426
  className: "ndc_property_search",
12410
12427
  key: index,
@@ -12445,7 +12462,7 @@ const PropertyDetailsForm$1 = ({
12445
12462
  alignItems: "center",
12446
12463
  gap: "12px"
12447
12464
  }
12448
- }, !(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$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", {
12465
+ }, !(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
12466
  className: "submit-bar",
12450
12467
  type: "button",
12451
12468
  style: {
@@ -12512,7 +12529,7 @@ const PropertyDetailsForm$1 = ({
12512
12529
  width: "100%"
12513
12530
  }
12514
12531
  }, 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$8, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
12532
+ var _apiDataCheck$7, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
12516
12533
  return /*#__PURE__*/React.createElement("div", {
12517
12534
  className: "ndc_property_search",
12518
12535
  key: index,
@@ -12553,7 +12570,7 @@ const PropertyDetailsForm$1 = ({
12553
12570
  alignItems: "center",
12554
12571
  gap: "12px"
12555
12572
  }
12556
- }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$8 = apiDataCheck[0]) !== null && _apiDataCheck$8 !== void 0 && _apiDataCheck$8.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", {
12573
+ }, !(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
12574
  className: "submit-bar",
12558
12575
  type: "button",
12559
12576
  style: {
@@ -12624,7 +12641,7 @@ const PropertyDetailsForm$1 = ({
12624
12641
  }
12625
12642
  },
12626
12643
  render: props => {
12627
- var _formData$cpt8, _formData$cpt8$detail, _formData$cpt8$detail2, _formData$cpt8$detail3, _formData$cpt8$detail4, _formData$cpt8$detail5, _formData$cpt8$detail6;
12644
+ var _formData$cpt5, _formData$cpt5$detail, _formData$cpt5$detail2, _formData$cpt5$detail3, _formData$cpt5$detail4, _formData$cpt5$detail5, _formData$cpt5$detail6;
12628
12645
  return /*#__PURE__*/React.createElement(TextInput, {
12629
12646
  value: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.firstName) || "",
12630
12647
  onChange: e => {
@@ -12637,7 +12654,7 @@ const PropertyDetailsForm$1 = ({
12637
12654
  onBlur: e => {
12638
12655
  props.onBlur(e);
12639
12656
  },
12640
- disabled: (formData === null || formData === void 0 ? void 0 : (_formData$cpt8 = formData.cpt) === null || _formData$cpt8 === void 0 ? void 0 : (_formData$cpt8$detail = _formData$cpt8.details) === null || _formData$cpt8$detail === void 0 ? void 0 : (_formData$cpt8$detail2 = _formData$cpt8$detail.owners) === null || _formData$cpt8$detail2 === void 0 ? void 0 : (_formData$cpt8$detail3 = _formData$cpt8$detail2[0]) === null || _formData$cpt8$detail3 === void 0 ? void 0 : (_formData$cpt8$detail4 = _formData$cpt8$detail3.name) === null || _formData$cpt8$detail4 === void 0 ? void 0 : (_formData$cpt8$detail5 = _formData$cpt8$detail4.split(" ")) === null || _formData$cpt8$detail5 === void 0 ? void 0 : (_formData$cpt8$detail6 = _formData$cpt8$detail5[0]) === null || _formData$cpt8$detail6 === void 0 ? void 0 : _formData$cpt8$detail6.length) > 0
12657
+ 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
12658
  });
12642
12659
  }
12643
12660
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
@@ -12691,7 +12708,7 @@ const PropertyDetailsForm$1 = ({
12691
12708
  name: "address",
12692
12709
  defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address) || "",
12693
12710
  render: props => {
12694
- var _formData$cpt9, _formData$cpt9$detail, _formData$cpt9$detail2, _formData$cpt9$detail3, _formData$cpt9$detail4;
12711
+ var _formData$cpt6, _formData$cpt6$detail, _formData$cpt6$detail2, _formData$cpt6$detail3, _formData$cpt6$detail4;
12695
12712
  return /*#__PURE__*/React.createElement(TextInput, {
12696
12713
  value: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address,
12697
12714
  onChange: e => {
@@ -12704,7 +12721,7 @@ const PropertyDetailsForm$1 = ({
12704
12721
  onBlur: e => {
12705
12722
  props.onBlur(e);
12706
12723
  },
12707
- disabled: (formData === null || formData === void 0 ? void 0 : (_formData$cpt9 = formData.cpt) === null || _formData$cpt9 === void 0 ? void 0 : (_formData$cpt9$detail = _formData$cpt9.details) === null || _formData$cpt9$detail === void 0 ? void 0 : (_formData$cpt9$detail2 = _formData$cpt9$detail.owners) === null || _formData$cpt9$detail2 === void 0 ? void 0 : (_formData$cpt9$detail3 = _formData$cpt9$detail2[0]) === null || _formData$cpt9$detail3 === void 0 ? void 0 : (_formData$cpt9$detail4 = _formData$cpt9$detail3.permanentAddress) === null || _formData$cpt9$detail4 === void 0 ? void 0 : _formData$cpt9$detail4.length) > 0
12724
+ 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
12725
  });
12709
12726
  }
12710
12727
  })))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
@@ -12750,7 +12767,7 @@ const PropertySearchNSummary = ({
12750
12767
  onSelect,
12751
12768
  formData
12752
12769
  }) => {
12753
- var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$cpt13, _formData$cpt13$dues;
12770
+ var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$cpt12, _formData$cpt12$dues;
12754
12771
  const {
12755
12772
  t
12756
12773
  } = useTranslation();
@@ -12771,7 +12788,6 @@ const PropertySearchNSummary = ({
12771
12788
  const urlPropertyId = new URLSearchParams(search).get("propertyId");
12772
12789
  const isfirstRender = useRef(true);
12773
12790
  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
12791
  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
12792
  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
12793
  const [showToast, setShowToast] = useState(null);
@@ -12827,7 +12843,6 @@ const PropertySearchNSummary = ({
12827
12843
  enabled: searchPropertyId ? true : false,
12828
12844
  privacy: Digit.Utils.getPrivacyObject()
12829
12845
  });
12830
- console.log("apiDataCheck", apiDataCheck);
12831
12846
  useEffect(() => {
12832
12847
  if (ptFromApi !== null && ptFromApi !== void 0 && ptFromApi.consumerCode) {
12833
12848
  setIsSearchClicked(true);
@@ -12900,6 +12915,21 @@ const PropertySearchNSummary = ({
12900
12915
  });
12901
12916
  setSearchPropertyId(propertyId);
12902
12917
  setIsSearchClicked(true);
12918
+ setPropertyDues({
12919
+ dues: null
12920
+ });
12921
+ onSelect("PropertyDetails", {
12922
+ email: "",
12923
+ propertyBillData: {
12924
+ isLoading: false,
12925
+ billData: {}
12926
+ },
12927
+ waterConnection: [],
12928
+ sewerageConnection: [],
12929
+ firstName: "",
12930
+ mobileNumber: "",
12931
+ address: ""
12932
+ });
12903
12933
  dispatch(resetNDCForm());
12904
12934
  }
12905
12935
  };
@@ -13056,19 +13086,25 @@ const PropertySearchNSummary = ({
13056
13086
  onClick: () => {
13057
13087
  fetchBill();
13058
13088
  }
13059
- }, `${t("CHECK_STATUS_PROPERTY")}`), getPayDuesButton && /*#__PURE__*/React.createElement("button", {
13089
+ }, `${t("CHECK_STATUS_PROPERTY")}`), getPayDuesButton && /*#__PURE__*/React.createElement("div", {
13090
+ style: {
13091
+ color: "red",
13092
+ width: "100%",
13093
+ maxWidth: "70px"
13094
+ }
13095
+ }, "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
13096
  className: "submit-bar",
13061
13097
  type: "button",
13062
13098
  style: {
13063
13099
  color: "white",
13064
13100
  width: "100%",
13065
- maxWidth: "190px"
13101
+ maxWidth: "115px"
13066
13102
  },
13067
13103
  onClick: () => {
13068
13104
  redirectToPayBill();
13069
13105
  setPayDuesButton(false);
13070
13106
  }
13071
- }, `${t("PAY_DUES")} (Rs.${formData === null || formData === void 0 ? void 0 : (_formData$cpt13 = formData.cpt) === null || _formData$cpt13 === void 0 ? void 0 : (_formData$cpt13$dues = _formData$cpt13.dues) === null || _formData$cpt13$dues === void 0 ? void 0 : _formData$cpt13$dues.totalAmount})`), getNoDue && /*#__PURE__*/React.createElement("div", {
13107
+ }, `${t("PAY_DUES")} `), getNoDue && /*#__PURE__*/React.createElement("div", {
13072
13108
  style: {
13073
13109
  color: "green",
13074
13110
  width: "100%",
@@ -14008,7 +14044,7 @@ const NewNDCStepFormOne$1 = ({
14008
14044
  }
14009
14045
  };
14010
14046
  function validateStepData(data) {
14011
- var _data$cpt6, _data$cpt6$dues, _data$cpt7, _data$cpt7$dues, _data$dues, _propertyDetails$wate, _propertyDetails$sewe;
14047
+ var _data$cpt6, _data$cpt7, _data$cpt7$dues, _propertyDetails$wate, _propertyDetails$sewe;
14012
14048
  console.log("data", data);
14013
14049
  const missingFields = [];
14014
14050
  const invalidFields = [];
@@ -14016,10 +14052,10 @@ const NewNDCStepFormOne$1 = ({
14016
14052
  const cptDetails = (cpt === null || cpt === void 0 ? void 0 : cpt.details) || {};
14017
14053
  const propertyDetails = (data === null || data === void 0 ? void 0 : data.PropertyDetails) || {};
14018
14054
  const NDCReason = (data === null || data === void 0 ? void 0 : data.NDCReason) || {};
14019
- if ((data === null || data === void 0 ? void 0 : (_data$cpt6 = data.cpt) === null || _data$cpt6 === void 0 ? void 0 : (_data$cpt6$dues = _data$cpt6.dues) === null || _data$cpt6$dues === void 0 ? void 0 : _data$cpt6$dues.totalAmount) != 0) {
14055
+ if (!(data !== null && data !== void 0 && (_data$cpt6 = data.cpt) !== null && _data$cpt6 !== void 0 && _data$cpt6.dues)) {
14020
14056
  invalidFields.push(`${t("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
14021
14057
  }
14022
- if (data !== null && data !== void 0 && (_data$cpt7 = data.cpt) !== null && _data$cpt7 !== void 0 && (_data$cpt7$dues = _data$cpt7.dues) !== null && _data$cpt7$dues !== void 0 && _data$cpt7$dues.id && (data === null || data === void 0 ? void 0 : (_data$dues = data.dues) === null || _data$dues === void 0 ? void 0 : _data$dues.totalAmount) > 0) {
14058
+ 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
14059
  invalidFields.push(`${t("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
14024
14060
  }
14025
14061
  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 +14088,7 @@ const NewNDCStepFormOne$1 = ({
14052
14088
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
14053
14089
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
14054
14090
  const nameRegex = /^[A-Za-z\s]+$/;
14055
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
14091
+ const emailRegex = /^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/;
14056
14092
  const mobileRegex = /^[6-9]\d{9}$/;
14057
14093
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
14058
14094
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));