@mseva/digit-ui-module-ndc 1.0.20 → 1.0.21

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.
@@ -1,4 +1,4 @@
1
- import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, AppContainer, Loader, Dropdown, UploadFile, Modal, FormComposer, Toast, Header, CardSubHeader, StatusTable, Row, CheckPoint, ConnectingCheckPoints, DisplayPhotos, Menu, LinkButton, EmployeeModuleCard, SearchField, TextInput, FilterFormField, RadioButtons, CheckBox, InboxComposer, ComplaintIcon, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, CardLabel, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
1
+ import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, BackButton, AppContainer, Loader, Dropdown, UploadFile, Modal, FormComposer, Toast, CardSubHeader, StatusTable, Row, CheckPoint, ConnectingCheckPoints, DisplayPhotos, Menu, LinkButton, EmployeeModuleCard, SearchField, TextInput, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, Header, InboxComposer, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, CardLabel, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
2
2
  import React, { Fragment as Fragment$1, useState, useEffect, useRef, useMemo, useReducer, useCallback, forwardRef } from 'react';
3
3
  import { useHistory, useLocation, Switch, Route, useRouteMatch, useParams, Link } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
@@ -642,14 +642,16 @@ const App = () => {
642
642
  url,
643
643
  ...match
644
644
  } = useRouteMatch();
645
- console.log("NDC Citizen App Loaded", path);
645
+ const {
646
+ t
647
+ } = useTranslation();
646
648
  const NewNDCStepForm = Digit.ComponentRegistryService.getComponent("NewNDCStepFormCitizen");
647
649
  const MyApplications = Digit.ComponentRegistryService.getComponent("MyApplications");
648
650
  const NDCResponseCitizen = Digit.ComponentRegistryService.getComponent("NDCResponseCitizen");
649
651
  const ApplicationOverview = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("CitizenApplicationOverview");
650
652
  return /*#__PURE__*/React.createElement("span", {
651
653
  className: "tl-citizen"
652
- }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(PrivateRoute, {
654
+ }, /*#__PURE__*/React.createElement(BackButton, null, t("CS_COMMON_BACK")), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(PrivateRoute, {
653
655
  path: `${path}/new-application`,
654
656
  component: NewNDCStepForm
655
657
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
@@ -1025,6 +1027,7 @@ const NDCModal = ({
1025
1027
  Licenses: [applicationData]
1026
1028
  });
1027
1029
  }
1030
+ console.log("config.label.submit", config);
1028
1031
  useEffect(() => {
1029
1032
  if (action) {
1030
1033
  setConfig(ModalConfig({
@@ -1079,7 +1082,6 @@ const getTimelineCaptions = (checkpoint, index, arr, t) => {
1079
1082
  thumbnailsToShow,
1080
1083
  wfDocuments
1081
1084
  } = checkpoint;
1082
- console.log("wfDocuments", wfDocuments);
1083
1085
  const caption = {
1084
1086
  date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
1085
1087
  name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name,
@@ -1112,7 +1114,7 @@ const getTimelineCaptions = (checkpoint, index, arr, t) => {
1112
1114
  }, caption.date && /*#__PURE__*/React.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React.createElement("p", null, caption.name), caption.mobileNumber && /*#__PURE__*/React.createElement("p", null, caption.mobileNumber), caption.source && /*#__PURE__*/React.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
1113
1115
  };
1114
1116
  const ApplicationOverview = () => {
1115
- var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _workflowDetails$data15;
1117
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _applicationDetails$A3, _applicationDetails$A4, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _applicationDetails$A5, _applicationDetails$A6, _workflowDetails$data15;
1116
1118
  const {
1117
1119
  id
1118
1120
  } = useParams();
@@ -1221,7 +1223,6 @@ const ApplicationOverview = () => {
1221
1223
  useEffect(() => {
1222
1224
  var _applicationDetails$A;
1223
1225
  const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
1224
- console.log("ndcObject", ndcObject);
1225
1226
  if (ndcObject) {
1226
1227
  var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
1227
1228
  const applicantData = {
@@ -1250,14 +1251,12 @@ const ApplicationOverview = () => {
1250
1251
  }
1251
1252
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
1252
1253
  useEffect(() => {
1253
- console.log("applicationDetails", applicationDetails);
1254
1254
  if (applicationDetails) {
1255
1255
  setIsDetailsLoading(true);
1256
1256
  setIsDetailsLoading(false);
1257
1257
  }
1258
1258
  }, [applicationDetails]);
1259
1259
  function onActionSelect(action) {
1260
- console.log("action", action);
1261
1260
  const payload = {
1262
1261
  Licenses: [action]
1263
1262
  };
@@ -1275,7 +1274,6 @@ const ApplicationOverview = () => {
1275
1274
  const submitAction = async data => {
1276
1275
  var _data$Licenses;
1277
1276
  const payloadData = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications[0];
1278
- console.log("data", data);
1279
1277
  const updatedApplicant = {
1280
1278
  ...payloadData,
1281
1279
  workflow: {}
@@ -1287,7 +1285,6 @@ const ApplicationOverview = () => {
1287
1285
  comment: filtData === null || filtData === void 0 ? void 0 : filtData.comment,
1288
1286
  documents: filtData === null || filtData === void 0 ? void 0 : filtData.wfDocuments
1289
1287
  };
1290
- console.log("filtData", filtData);
1291
1288
  if (!(filtData !== null && filtData !== void 0 && filtData.assignee) && filtData.action == "FORWARD") {
1292
1289
  setShowToast({
1293
1290
  key: "error"
@@ -1336,11 +1333,7 @@ const ApplicationOverview = () => {
1336
1333
  }
1337
1334
  return /*#__PURE__*/React.createElement("div", {
1338
1335
  className: "employee-main-application-details"
1339
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, {
1340
- styles: {
1341
- fontSize: "32px"
1342
- }
1343
- }, t("NDC_APP_OVER_VIEW_HEADER"))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
1336
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
1344
1337
  key: key,
1345
1338
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
1346
1339
  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")
@@ -1382,10 +1375,10 @@ const ApplicationOverview = () => {
1382
1375
  }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data11 = workflowDetails.data) === null || _workflowDetails$data11 === void 0 ? void 0 : _workflowDetails$data11.timeline.map((checkpoint, index, arr) => /*#__PURE__*/React.createElement(CheckPoint, {
1383
1376
  keyValue: index,
1384
1377
  isCompleted: index === 0,
1385
- label: t("NDC_STATUS_" + checkpoint.status),
1378
+ label: t(checkpoint.status),
1386
1379
  customChild: getTimelineCaptions(checkpoint, index, arr, t)
1387
- })))), actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data12 = workflowDetails.data) !== null && _workflowDetails$data12 !== void 0 && (_workflowDetails$data13 = _workflowDetails$data12.actionState) !== null && _workflowDetails$data13 !== void 0 && _workflowDetails$data13.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data14 = workflowDetails.data) !== null && _workflowDetails$data14 !== void 0 && _workflowDetails$data14.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
1388
- localeKeyPrefix: `WF_EMPLOYEE_${"NDC"}`,
1380
+ })))), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.applicationStatus) !== "INITIATED" && actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data12 = workflowDetails.data) !== null && _workflowDetails$data12 !== void 0 && (_workflowDetails$data13 = _workflowDetails$data12.actionState) !== null && _workflowDetails$data13 !== void 0 && _workflowDetails$data13.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data14 = workflowDetails.data) !== null && _workflowDetails$data14 !== void 0 && _workflowDetails$data14.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
1381
+ localeKeyPrefix: `WF_EDITRENEWAL`,
1389
1382
  options: actions,
1390
1383
  optionKey: "action",
1391
1384
  t: t,
@@ -1394,6 +1387,13 @@ const ApplicationOverview = () => {
1394
1387
  ref: menuRef,
1395
1388
  label: t("WF_TAKE_ACTION"),
1396
1389
  onSubmit: () => setDisplayMenu(!displayMenu)
1390
+ })), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A5 = applicationDetails.Applications) === null || _applicationDetails$A5 === void 0 ? void 0 : (_applicationDetails$A6 = _applicationDetails$A5[0]) === null || _applicationDetails$A6 === void 0 ? void 0 : _applicationDetails$A6.applicationStatus) == "INITIATED" && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
1391
+ label: t("COMMON_EDIT"),
1392
+ onSubmit: () => {
1393
+ var _applicationDetails$A7, _applicationDetails$A8;
1394
+ const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A7 = applicationDetails.Applications) === null || _applicationDetails$A7 === void 0 ? void 0 : (_applicationDetails$A8 = _applicationDetails$A7[0]) === null || _applicationDetails$A8 === void 0 ? void 0 : _applicationDetails$A8.uuid;
1395
+ history.push(`/digit-ui/employee/ndc/create/${id}`);
1396
+ }
1397
1397
  })), showModal ? /*#__PURE__*/React.createElement(NDCModal, {
1398
1398
  t: t,
1399
1399
  action: selectedAction,
@@ -8731,49 +8731,74 @@ function cleanEscapedString(input) {
8731
8731
  const capitalize = text => text.substr(0, 1).toUpperCase() + text.substr(1);
8732
8732
  const ulbCamel = ulb => ulb.toLowerCase().split(" ").map(capitalize).join(" ");
8733
8733
  const getAcknowledgementData = async (application, tenantInfo, t) => {
8734
- var _application$Applicat, _appData$owners, _appData$NdcDetails, _appData$additionalDe, _tenantInfo$city;
8735
- const appData = (application === null || application === void 0 ? void 0 : (_application$Applicat = application.Applications) === null || _application$Applicat === void 0 ? void 0 : _application$Applicat[0]) || {};
8734
+ var _application$Applicat, _appData$owners, _tenantInfo$city, _appData$auditDetails, _appData$NdcDetails, _appData$NdcDetails$, _appData$NdcDetails$$, _appData$NdcDetails2, _appData$NdcDetails2$, _appData$NdcDetails3, _appData$NdcDetails3$, _appData$additionalDe;
8735
+ const appData = application === null || application === void 0 ? void 0 : (_application$Applicat = application.Applications) === null || _application$Applicat === void 0 ? void 0 : _application$Applicat[0];
8736
8736
  const owner = (appData === null || appData === void 0 ? void 0 : (_appData$owners = appData.owners) === null || _appData$owners === void 0 ? void 0 : _appData$owners[0]) || {};
8737
- const ndc = (appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails = appData.NdcDetails) === null || _appData$NdcDetails === void 0 ? void 0 : _appData$NdcDetails[0]) || {};
8738
- const add = (ndc === null || ndc === void 0 ? void 0 : ndc.additionalDetails) || {};
8739
- const applicationNumber = (appData === null || appData === void 0 ? void 0 : appData.uuid) || "NA";
8740
- const propertyId = (ndc === null || ndc === void 0 ? void 0 : ndc.consumerCode) || "NA";
8741
- const propertyType = add !== null && add !== void 0 && add.propertyType ? t(add.propertyType) : "NA";
8742
- const applicantName = (owner === null || owner === void 0 ? void 0 : owner.name) || "NA";
8743
- const address = (owner === null || owner === void 0 ? void 0 : owner.permanentAddress) || (owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress) || "NA";
8744
- const ulbName = (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (appData === null || appData === void 0 ? void 0 : appData.tenantId) || "NA";
8745
- const duesAmount = (add === null || add === void 0 ? void 0 : add.duesAmount) || (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe = appData.additionalDetails) === null || _appData$additionalDe === void 0 ? void 0 : _appData$additionalDe.duesAmount) || "0";
8746
- const certificateBody = `${t("NDC_MSG_INTRO")}
8747
-
8748
- ${t("NDC_MSG_APPLICATION_LABEL")}: ${applicationNumber}
8749
-
8750
- ${t("NDC_MSG_PROPERTY_LABEL")}: ${propertyId} ${t("NDC_MSG_PROPERTY_TYPE_LABEL")} ${propertyType}
8751
-
8752
- ${t("NDC_MSG_APPLICANT_LABEL")}: ${applicantName} ${t("NDC_MSG_FOR_LAND")} ${address}
8753
-
8754
- ${t("NDC_MSG_FALLING_CLAUSE_PART1")} ${t("NDC_MSG_FALLING_CLAUSE_PART2")} ${ulbName} ${t("NDC_MSG_AFTER_RECOVERY")} ${duesAmount} ${t("NDC_MSG_DUES_LIST")}
8755
-
8756
- ${t("NDC_MSG_DECLARATION_TITLE")}
8757
- ${t("NDC_MSG_DECL_A")}
8758
- ${t("NDC_MSG_DECL_B")}
8759
- ${t("NDC_MSG_DECL_C")}
8760
- ${t("NDC_MSG_DECL_D")}
8761
- ${t("NDC_MSG_DECL_E")}
8762
-
8763
- ${t("NDC_MSG_DISCLAIMER_TITLE")}
8764
- ${t("NDC_MSG_DISCLAIMER_BODY")}
8765
-
8766
- ${t("NDC_MSG_NOTE")} ${t("NDC_MSG_VERIFICATION_LINK_LABEL")}`;
8767
8737
  return {
8768
- t,
8738
+ t: t,
8769
8739
  tenantId: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code,
8770
8740
  name: `${t(tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.i18nKey)} ${ulbCamel(t(`ULBGRADE_${tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city = tenantInfo.city) === null || _tenantInfo$city === void 0 ? void 0 : _tenantInfo$city.ulbGrade.toUpperCase().replace(" ", "_").replace(".", "_")}`))}`,
8771
8741
  email: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.emailId,
8772
8742
  phoneNumber: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.contactNumber,
8773
8743
  heading: t("NDC_CERTIFICATE"),
8774
- applicationNumber,
8744
+ applicationNumber: (appData === null || appData === void 0 ? void 0 : appData.uuid) || "NA",
8775
8745
  details: [{
8776
- value: certificateBody
8746
+ title: t("CS_APPLICATION_DETAILS"),
8747
+ values: [{
8748
+ title: t("REGISTRATION_FILED_DATE"),
8749
+ value: Digit.DateUtils.ConvertTimestampToDate(appData === null || appData === void 0 ? void 0 : (_appData$auditDetails = appData.auditDetails) === null || _appData$auditDetails === void 0 ? void 0 : _appData$auditDetails.createdTime, "dd/MM/yyyy") || "NA"
8750
+ }, {
8751
+ title: t("NDC_REASON"),
8752
+ value: (appData === null || appData === void 0 ? void 0 : appData.reason) || "NA"
8753
+ }]
8754
+ }, {
8755
+ title: t("NDC_LICENSE_DETAILS_LABEL"),
8756
+ values: [{
8757
+ title: t("NDC_LICENSE_TYPE"),
8758
+ value: t(appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails = appData.NdcDetails) === null || _appData$NdcDetails === void 0 ? void 0 : (_appData$NdcDetails$ = _appData$NdcDetails[0]) === null || _appData$NdcDetails$ === void 0 ? void 0 : (_appData$NdcDetails$$ = _appData$NdcDetails$.additionalDetails) === null || _appData$NdcDetails$$ === void 0 ? void 0 : _appData$NdcDetails$$.propertyType) || "NA"
8759
+ }, {
8760
+ title: t("NDC_COUNCIL_NUMBER"),
8761
+ value: (appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails2 = appData.NdcDetails) === null || _appData$NdcDetails2 === void 0 ? void 0 : (_appData$NdcDetails2$ = _appData$NdcDetails2[0]) === null || _appData$NdcDetails2$ === void 0 ? void 0 : _appData$NdcDetails2$.consumerCode) || "NA"
8762
+ }, {
8763
+ title: t("NDC_TRADE_TYPE_LABEL"),
8764
+ value: (appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails3 = appData.NdcDetails) === null || _appData$NdcDetails3 === void 0 ? void 0 : (_appData$NdcDetails3$ = _appData$NdcDetails3[0]) === null || _appData$NdcDetails3$ === void 0 ? void 0 : _appData$NdcDetails3$.businessService) || "NA"
8765
+ }, {
8766
+ title: t("NDC_QUALIFICATION_TYPE"),
8767
+ value: (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe = appData.additionalDetails) === null || _appData$additionalDe === void 0 ? void 0 : _appData$additionalDe.qualificationType) || "NA"
8768
+ }]
8769
+ }, {
8770
+ title: t("NDC_LICENSEE_DETAILS_HEADER_OWNER_INFO"),
8771
+ values: [{
8772
+ title: t("NDC_APPLICANT_NAME_LABEL"),
8773
+ value: (owner === null || owner === void 0 ? void 0 : owner.name) || "NA"
8774
+ }, {
8775
+ title: t("NDC_OWNER_MOBILE_NO_LABEL"),
8776
+ value: (owner === null || owner === void 0 ? void 0 : owner.mobileNumber) || "NA"
8777
+ }, {
8778
+ title: t("NDC_APPLICANT_GENDER_LABEL"),
8779
+ value: owner !== null && owner !== void 0 && owner.gender ? t(owner.gender) : "NA"
8780
+ }, {
8781
+ title: t("NDC_APPLICANT_EMAIL_LABEL"),
8782
+ value: (owner === null || owner === void 0 ? void 0 : owner.emailId) || "NA"
8783
+ }, {
8784
+ title: t("NDC_APPLICANT_DOB_LABEL"),
8785
+ value: owner !== null && owner !== void 0 && owner.dob ? Digit.DateUtils.ConvertTimestampToDate(owner.dob, "dd/MM/yyyy") : "NA"
8786
+ }]
8787
+ }, {
8788
+ title: t("NDC_NEW_ADDRESS_HEADER_DETAILS"),
8789
+ values: [{
8790
+ title: t("NDC_PERMANANT_ADDRESS_LABEL"),
8791
+ value: (owner === null || owner === void 0 ? void 0 : owner.permanentAddress) || "NA"
8792
+ }, {
8793
+ title: t("NDC_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL"),
8794
+ value: (owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress) || "NA"
8795
+ }, {
8796
+ title: t("NDC_PINCODE_LABEL"),
8797
+ value: (owner === null || owner === void 0 ? void 0 : owner.permanentPinCode) || (owner === null || owner === void 0 ? void 0 : owner.correspondencePinCode) || "NA"
8798
+ }, {
8799
+ title: t("NDC_SELECT_ULB"),
8800
+ value: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (appData === null || appData === void 0 ? void 0 : appData.tenantId) || "NA"
8801
+ }]
8777
8802
  }]
8778
8803
  };
8779
8804
  };
@@ -8816,13 +8841,14 @@ const getTimelineCaptions$1 = (checkpoint, index, arr, t) => {
8816
8841
  }, caption.date && /*#__PURE__*/React.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React.createElement("p", null, caption.name), caption.mobileNumber , caption.source && /*#__PURE__*/React.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
8817
8842
  };
8818
8843
  const CitizenApplicationOverview = () => {
8819
- var _user, _user$info, _user$info$roles, _applicationDetails$A3, _applicationDetails$A4, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5;
8844
+ var _user, _user$info, _user$info$roles, _applicationDetails$A3, _applicationDetails$A4, _applicationDetails$A5, _applicationDetails$A6, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5;
8820
8845
  const {
8821
8846
  id
8822
8847
  } = useParams();
8823
8848
  const {
8824
8849
  t
8825
8850
  } = useTranslation();
8851
+ const history = useHistory();
8826
8852
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
8827
8853
  const state = tenantId === null || tenantId === void 0 ? void 0 : tenantId.split(".")[0];
8828
8854
  const [appDetails, setAppDetails] = useState({});
@@ -8875,12 +8901,12 @@ const CitizenApplicationOverview = () => {
8875
8901
  var _applicationDetails$A;
8876
8902
  const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
8877
8903
  if (ndcObject) {
8878
- var _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _removeDuplicatesByUU;
8904
+ var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
8879
8905
  const applicantData = {
8880
- address: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$NdcDetails = ndcObject.NdcDetails) === null || _ndcObject$NdcDetails === void 0 ? void 0 : (_ndcObject$NdcDetails2 = _ndcObject$NdcDetails[0]) === null || _ndcObject$NdcDetails2 === void 0 ? void 0 : (_ndcObject$NdcDetails3 = _ndcObject$NdcDetails2.additionalDetails) === null || _ndcObject$NdcDetails3 === void 0 ? void 0 : _ndcObject$NdcDetails3.propertyAddress,
8881
- email: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners = ndcObject.owners) === null || _ndcObject$owners === void 0 ? void 0 : (_ndcObject$owners$ = _ndcObject$owners[0]) === null || _ndcObject$owners$ === void 0 ? void 0 : _ndcObject$owners$.emailId,
8906
+ name: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners = ndcObject.owners) === null || _ndcObject$owners === void 0 ? void 0 : (_ndcObject$owners$ = _ndcObject$owners[0]) === null || _ndcObject$owners$ === void 0 ? void 0 : _ndcObject$owners$.name,
8882
8907
  mobile: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners2 = ndcObject.owners) === null || _ndcObject$owners2 === void 0 ? void 0 : (_ndcObject$owners2$ = _ndcObject$owners2[0]) === null || _ndcObject$owners2$ === void 0 ? void 0 : _ndcObject$owners2$.mobileNumber,
8883
- name: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners3 = ndcObject.owners) === null || _ndcObject$owners3 === void 0 ? void 0 : (_ndcObject$owners3$ = _ndcObject$owners3[0]) === null || _ndcObject$owners3$ === void 0 ? void 0 : _ndcObject$owners3$.name,
8908
+ email: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners3 = ndcObject.owners) === null || _ndcObject$owners3 === void 0 ? void 0 : (_ndcObject$owners3$ = _ndcObject$owners3[0]) === null || _ndcObject$owners3$ === void 0 ? void 0 : _ndcObject$owners3$.emailId,
8909
+ address: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$NdcDetails = ndcObject.NdcDetails) === null || _ndcObject$NdcDetails === void 0 ? void 0 : (_ndcObject$NdcDetails2 = _ndcObject$NdcDetails[0]) === null || _ndcObject$NdcDetails2 === void 0 ? void 0 : (_ndcObject$NdcDetails3 = _ndcObject$NdcDetails2.additionalDetails) === null || _ndcObject$NdcDetails3 === void 0 ? void 0 : _ndcObject$NdcDetails3.propertyAddress,
8884
8910
  applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.uuid
8885
8911
  };
8886
8912
  const Documents = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.Documents) || []);
@@ -8902,7 +8928,6 @@ const CitizenApplicationOverview = () => {
8902
8928
  }
8903
8929
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
8904
8930
  useEffect(() => {
8905
- console.log("applicationDetails", applicationDetails);
8906
8931
  if (applicationDetails) {
8907
8932
  setIsDetailsLoading(true);
8908
8933
  setAppDetails({
@@ -8916,12 +8941,9 @@ const CitizenApplicationOverview = () => {
8916
8941
  }, [applicationDetails]);
8917
8942
  const handleDownloadPdf = async () => {
8918
8943
  const Property = applicationDetails;
8919
- console.log("applicationDetails in StakeholderAck", applicationDetails);
8920
- console.log("tenants", tenants);
8921
- const tenantInfo = tenants.find(tenant => tenant.code === Property.tenantId);
8944
+ const tenantInfo = tenants === null || tenants === void 0 ? void 0 : tenants.find(tenant => (tenant === null || tenant === void 0 ? void 0 : tenant.code) === (Property === null || Property === void 0 ? void 0 : Property.tenantId));
8922
8945
  const acknowledgementData = await getAcknowledgementData(Property, tenantInfo, t);
8923
- console.log("acknowledgementData", acknowledgementData);
8924
- Digit.Utils.pdf.generateNDC(acknowledgementData);
8946
+ Digit.Utils.pdf.generate(acknowledgementData);
8925
8947
  };
8926
8948
  if (isLoading || isDetailsLoading) {
8927
8949
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -8931,25 +8953,34 @@ const CitizenApplicationOverview = () => {
8931
8953
  }, /*#__PURE__*/React.createElement("div", {
8932
8954
  style: {
8933
8955
  display: "flex",
8934
- justifyContent: "space-between",
8956
+ justifyContent: "end",
8935
8957
  alignItems: "center",
8936
8958
  padding: "16px"
8937
8959
  }
8938
- }, /*#__PURE__*/React.createElement(Header, {
8939
- styles: {
8940
- fontSize: "32px"
8941
- }
8942
- }, t("NDC_APP_OVER_VIEW_HEADER")), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.applicationStatus) === "APPROVED" && /*#__PURE__*/React.createElement(LinkButton, {
8960
+ }, (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.applicationStatus) === "APPROVED" && /*#__PURE__*/React.createElement(LinkButton, {
8961
+ className: "downLoadButton",
8943
8962
  label: t("DOWNLOAD_CERTIFICATE"),
8944
- style: {
8945
- color: "#A52A2A"
8946
- },
8947
8963
  onClick: handleDownloadPdf
8948
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, console.log("displayData?.applicantData", displayData === null || displayData === void 0 ? void 0 : displayData.applicantData), (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
8964
+ }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A5 = applicationDetails.Applications) === null || _applicationDetails$A5 === void 0 ? void 0 : (_applicationDetails$A6 = _applicationDetails$A5[0]) === null || _applicationDetails$A6 === void 0 ? void 0 : _applicationDetails$A6.applicationStatus) == "INITIATED" && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
8965
+ label: t("COMMON_EDIT"),
8966
+ onSubmit: () => {
8967
+ var _applicationDetails$A7, _applicationDetails$A8;
8968
+ const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A7 = applicationDetails.Applications) === null || _applicationDetails$A7 === void 0 ? void 0 : (_applicationDetails$A8 = _applicationDetails$A7[0]) === null || _applicationDetails$A8 === void 0 ? void 0 : _applicationDetails$A8.uuid;
8969
+ history.push(`/digit-ui/citizen/ndc/new-application/${id}`);
8970
+ }
8971
+ }))), /*#__PURE__*/React.createElement(Card, {
8972
+ className: "ndc_card_main"
8973
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
8974
+ className: "ndc_label"
8975
+ }, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
8949
8976
  key: key,
8950
8977
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
8951
8978
  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")
8952
- }))))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai = displayData.NdcDetails) === null || _displayData$NdcDetai === void 0 ? void 0 : _displayData$NdcDetai.map((detail, index) => {
8979
+ }))))), /*#__PURE__*/React.createElement(Card, {
8980
+ className: "ndc_card_main"
8981
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
8982
+ className: "ndc_label"
8983
+ }, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai = displayData.NdcDetails) === null || _displayData$NdcDetai === void 0 ? void 0 : _displayData$NdcDetai.map((detail, index) => {
8953
8984
  var _detail$dueAmount;
8954
8985
  return /*#__PURE__*/React.createElement("div", {
8955
8986
  key: index,
@@ -8972,7 +9003,11 @@ const CitizenApplicationOverview = () => {
8972
9003
  label: t("NDC_PROPERTY_TYPE"),
8973
9004
  text: t(detail.propertyType) || detail.propertyType
8974
9005
  })));
8975
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
9006
+ })), /*#__PURE__*/React.createElement(Card, {
9007
+ className: "ndc_card_main"
9008
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
9009
+ className: "ndc_label"
9010
+ }, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
8976
9011
  style: {
8977
9012
  display: "flex",
8978
9013
  gap: "16px"
@@ -8981,13 +9016,17 @@ const CitizenApplicationOverview = () => {
8981
9016
  value: {
8982
9017
  workflowDocs: displayData === null || displayData === void 0 ? void 0 : displayData.Documents
8983
9018
  }
8984
- }) : /*#__PURE__*/React.createElement("div", null, t("TL_NO_DOCUMENTS_MSG")))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) && /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
9019
+ }) : /*#__PURE__*/React.createElement("div", null, t("TL_NO_DOCUMENTS_MSG")))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) && /*#__PURE__*/React.createElement(Card, {
9020
+ className: "ndc_card_main"
9021
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
9022
+ className: "ndc_label"
9023
+ }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
8985
9024
  isCompleted: true,
8986
- label: t("NDC_STATUS_" + (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline[0]) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.status))
9025
+ label: t(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline[0]) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.status)
8987
9026
  }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data5 = workflowDetails.data) === null || _workflowDetails$data5 === void 0 ? void 0 : _workflowDetails$data5.timeline.map((checkpoint, index, arr) => /*#__PURE__*/React.createElement(CheckPoint, {
8988
9027
  keyValue: index,
8989
9028
  isCompleted: index === 0,
8990
- label: t("NDC_STATUS_" + checkpoint.status),
9029
+ label: t(checkpoint.status),
8991
9030
  customChild: getTimelineCaptions$1(checkpoint, index, arr, t)
8992
9031
  })))));
8993
9032
  };
@@ -9518,7 +9557,7 @@ const Inbox = ({
9518
9557
  }, [data]);
9519
9558
  const PropsForInboxLinks = {
9520
9559
  logoIcon: /*#__PURE__*/React.createElement(ComplaintIcon, null),
9521
- headerText: "NDC Module",
9560
+ headerText: `${t("MODULE_NKS_NO_DUE_CERTIFICATE_FEES")}`,
9522
9561
  links: [{
9523
9562
  text: "Create NDC Application",
9524
9563
  link: "/digit-ui/employee/ndc/create"
@@ -11414,6 +11453,12 @@ const config = [{
11414
11453
  head: "",
11415
11454
  stepNumber: 1,
11416
11455
  body: [{
11456
+ name: "NDC_COMMON_NDC_REASON",
11457
+ type: "component",
11458
+ component: "SelectNDCReason",
11459
+ key: "NDCReason",
11460
+ withoutLabel: true
11461
+ }, {
11417
11462
  name: "",
11418
11463
  type: "component",
11419
11464
  component: "NDCPropertySearch",
@@ -11425,12 +11470,6 @@ const config = [{
11425
11470
  component: "PropertyDetailsFormCitizen",
11426
11471
  key: "PropertyDetails",
11427
11472
  withoutLabel: true
11428
- }, {
11429
- name: "NDC_COMMON_NDC_REASON",
11430
- type: "component",
11431
- component: "SelectNDCReason",
11432
- key: "NDCReason",
11433
- withoutLabel: true
11434
11473
  }]
11435
11474
  }, {
11436
11475
  head: "NDC_COMMON_DOCUMENTS_REQUIRED",
@@ -11505,10 +11544,29 @@ const NewNDCStepForm = () => {
11505
11544
  const formState = useSelector(state => state.ndc.NDCForm);
11506
11545
  const step = formState.step;
11507
11546
  const tenantId = Digit.ULBService.getCurrentTenantId();
11547
+ const id = window.location.pathname.split("/").pop();
11548
+ const {
11549
+ isLoading,
11550
+ data: applicationDetails
11551
+ } = Digit.Hooks.ndc.useSearchEmployeeApplication({
11552
+ uuid: id
11553
+ }, tenantId);
11554
+ useEffect(() => {
11555
+ if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
11556
+ dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
11557
+ }
11558
+ }, [applicationDetails]);
11508
11559
  const setStep = updatedStepNumber => {
11509
11560
  dispatch(setNDCStep(updatedStepNumber));
11510
11561
  };
11511
11562
  const handleSubmit = () => {};
11563
+ useEffect(() => {
11564
+ const unlisten = history.listen(() => {
11565
+ console.log("route changes guys");
11566
+ dispatch(resetNDCForm());
11567
+ });
11568
+ return () => unlisten();
11569
+ }, [history, dispatch]);
11512
11570
  return /*#__PURE__*/React.createElement("div", {
11513
11571
  className: "pageCard"
11514
11572
  }, /*#__PURE__*/React.createElement(CardHeader, {
@@ -11695,7 +11753,7 @@ const NewNDCStepFormOne = ({
11695
11753
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
11696
11754
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
11697
11755
  const nameRegex = /^[A-Za-z\s]+$/;
11698
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
11756
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
11699
11757
  const mobileRegex = /^[6-9]\d{9}$/;
11700
11758
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
11701
11759
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
@@ -11768,6 +11826,10 @@ function SelectNDCReason({
11768
11826
  const {
11769
11827
  t
11770
11828
  } = useTranslation();
11829
+ const apiDataCheck = useSelector(state => {
11830
+ var _state$ndc$NDCForm, _state$ndc$NDCForm$fo;
11831
+ return (_state$ndc$NDCForm = state.ndc.NDCForm) === null || _state$ndc$NDCForm === void 0 ? void 0 : (_state$ndc$NDCForm$fo = _state$ndc$NDCForm.formData) === null || _state$ndc$NDCForm$fo === void 0 ? void 0 : _state$ndc$NDCForm$fo.responseData;
11832
+ });
11771
11833
  const {
11772
11834
  data: menuList,
11773
11835
  isLoading
@@ -11791,6 +11853,18 @@ function SelectNDCReason({
11791
11853
  useEffect(() => {
11792
11854
  onSelect("NDCReason", ndcReason, config);
11793
11855
  }, [ndcReason]);
11856
+ useEffect(() => {
11857
+ if (apiDataCheck && (ndcReasonOptions === null || ndcReasonOptions === void 0 ? void 0 : ndcReasonOptions.length) > 0) {
11858
+ const matchedOption = ndcReasonOptions.find(opt => {
11859
+ var _apiDataCheck$;
11860
+ return (opt === null || opt === void 0 ? void 0 : opt.code) === (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : _apiDataCheck$.reason);
11861
+ });
11862
+ if (matchedOption) {
11863
+ setNDCReason(matchedOption);
11864
+ setValue("NDCReason", matchedOption);
11865
+ }
11866
+ }
11867
+ }, [apiDataCheck, ndcReasonOptions]);
11794
11868
  if (isLoading) {
11795
11869
  return /*#__PURE__*/React.createElement(Loader, null);
11796
11870
  }
@@ -11802,10 +11876,10 @@ function SelectNDCReason({
11802
11876
  };
11803
11877
  return /*#__PURE__*/React.createElement("div", {
11804
11878
  style: {
11805
- marginBottom: "16px"
11879
+ paddingBottom: "16px"
11806
11880
  }
11807
11881
  }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
11808
- className: "card-label-smaller"
11882
+ className: "card-label-smaller ndc_card_labels"
11809
11883
  }, `${t("NDC_NEW_NDC_APPLICATION_NDC_REASON")} * `), /*#__PURE__*/React.createElement(Controller, {
11810
11884
  name: "NDCReason",
11811
11885
  rules: {
@@ -11819,6 +11893,7 @@ function SelectNDCReason({
11819
11893
  option: ndcReasonOptions,
11820
11894
  select: e => {
11821
11895
  setNDCReason(e);
11896
+ props.onChange(e);
11822
11897
  },
11823
11898
  optionKey: "i18nKey",
11824
11899
  onBlur: props.onBlur,
@@ -11837,7 +11912,7 @@ const PropertyDetailsForm$1 = ({
11837
11912
  formState,
11838
11913
  clearErrors
11839
11914
  }) => {
11840
- var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _propertyDetails$wate, _propertyDetails$sewe;
11915
+ var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _apiDataCheck$6, _propertyDetails$wate, _propertyDetails$sewe, _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3;
11841
11916
  const {
11842
11917
  control,
11843
11918
  formState: localFormState,
@@ -11850,6 +11925,10 @@ const PropertyDetailsForm$1 = ({
11850
11925
  t
11851
11926
  } = useTranslation();
11852
11927
  const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
11928
+ const apiDataCheck = useSelector(state => {
11929
+ var _state$ndc$NDCForm, _state$ndc$NDCForm$fo;
11930
+ return (_state$ndc$NDCForm = state.ndc.NDCForm) === null || _state$ndc$NDCForm === void 0 ? void 0 : (_state$ndc$NDCForm$fo = _state$ndc$NDCForm.formData) === null || _state$ndc$NDCForm$fo === void 0 ? void 0 : _state$ndc$NDCForm$fo.responseData;
11931
+ });
11853
11932
  const [showToast, setShowToast] = useState(null);
11854
11933
  const [propertyLoader, setPropertyLoader] = useState(false);
11855
11934
  const [showPayModal, setShowPayModal] = useState(false);
@@ -11918,39 +11997,63 @@ const PropertyDetailsForm$1 = ({
11918
11997
  });
11919
11998
  }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : _formData$cpt3.details]);
11920
11999
  useEffect(() => {
11921
- var _formData$PropertyDet3, _formData$PropertyDet4;
11922
- if (!(formData !== null && formData !== void 0 && (_formData$PropertyDet3 = formData.PropertyDetails) !== null && _formData$PropertyDet3 !== void 0 && (_formData$PropertyDet4 = _formData$PropertyDet3.waterConnection) !== null && _formData$PropertyDet4 !== void 0 && _formData$PropertyDet4.length) > 0) {
11923
- setPropertyDetails(prev => {
11924
- const waterConnection = waterConnectionData === null || waterConnectionData === void 0 ? void 0 : waterConnectionData.map(item => ({
11925
- connectionNo: item === null || item === void 0 ? void 0 : item.connectionNo,
11926
- isEdit: false,
11927
- billData: {},
11928
- isLoading: false
11929
- }));
11930
- return {
11931
- ...prev,
11932
- waterConnection: waterConnection
11933
- };
11934
- });
12000
+ var _apiDataCheck$;
12001
+ let waterConnection;
12002
+ if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$ = apiDataCheck[0]) !== null && _apiDataCheck$ !== void 0 && _apiDataCheck$.NdcDetails) {
12003
+ var _apiDataCheck$2;
12004
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : _apiDataCheck$2.NdcDetails.filter(item => {
12005
+ return item.businessService == "WS";
12006
+ });
12007
+ waterConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
12008
+ connectionNo: item === null || item === void 0 ? void 0 : item.consumerCode,
12009
+ isEdit: false,
12010
+ billData: {
12011
+ totalAmount: 0
12012
+ },
12013
+ isLoading: false
12014
+ }))) || [];
12015
+ } else {
12016
+ waterConnection = (waterConnectionData === null || waterConnectionData === void 0 ? void 0 : waterConnectionData.map(item => ({
12017
+ connectionNo: item === null || item === void 0 ? void 0 : item.connectionNo,
12018
+ isEdit: false,
12019
+ billData: {},
12020
+ isLoading: false
12021
+ }))) || [];
11935
12022
  }
11936
- }, [waterConnectionData, waterConnectionLoading]);
12023
+ setPropertyDetails(prev => ({
12024
+ ...prev,
12025
+ waterConnection
12026
+ }));
12027
+ }, [waterConnectionData, apiDataCheck]);
11937
12028
  useEffect(() => {
11938
- var _formData$PropertyDet5, _formData$PropertyDet6;
11939
- if (!(formData !== null && formData !== void 0 && (_formData$PropertyDet5 = formData.PropertyDetails) !== null && _formData$PropertyDet5 !== void 0 && (_formData$PropertyDet6 = _formData$PropertyDet5.sewerageConnection) !== null && _formData$PropertyDet6 !== void 0 && _formData$PropertyDet6.length) > 0) {
11940
- setPropertyDetails(prev => {
11941
- const sewerageConnection = sewerageConnectionData === null || sewerageConnectionData === void 0 ? void 0 : sewerageConnectionData.map(item => ({
11942
- connectionNo: item === null || item === void 0 ? void 0 : item.connectionNo,
11943
- isEdit: false,
11944
- billData: {},
11945
- isLoading: false
11946
- }));
11947
- return {
11948
- ...prev,
11949
- sewerageConnection: sewerageConnection
11950
- };
11951
- });
12029
+ var _apiDataCheck$3;
12030
+ let sewerageConnection;
12031
+ if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$3 = apiDataCheck[0]) !== null && _apiDataCheck$3 !== void 0 && _apiDataCheck$3.NdcDetails) {
12032
+ var _apiDataCheck$4;
12033
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$4 = apiDataCheck[0]) === null || _apiDataCheck$4 === void 0 ? void 0 : _apiDataCheck$4.NdcDetails.filter(item => {
12034
+ return item.businessService == "SW";
12035
+ });
12036
+ sewerageConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
12037
+ connectionNo: item === null || item === void 0 ? void 0 : item.consumerCode,
12038
+ isEdit: false,
12039
+ billData: {
12040
+ totalAmount: 0
12041
+ },
12042
+ isLoading: false
12043
+ }))) || [];
12044
+ } else {
12045
+ sewerageConnection = (sewerageConnectionData === null || sewerageConnectionData === void 0 ? void 0 : sewerageConnectionData.map(item => ({
12046
+ connectionNo: item === null || item === void 0 ? void 0 : item.connectionNo,
12047
+ isEdit: false,
12048
+ billData: {},
12049
+ isLoading: false
12050
+ }))) || [];
11952
12051
  }
11953
- }, [sewerageConnectionData, sewerageConnectionLoading]);
12052
+ setPropertyDetails(prev => ({
12053
+ ...prev,
12054
+ sewerageConnection
12055
+ }));
12056
+ }, [sewerageConnectionData, apiDataCheck]);
11954
12057
  useEffect(() => {
11955
12058
  onSelect("PropertyDetails", propertyDetails, config);
11956
12059
  }, [propertyDetails]);
@@ -12005,7 +12108,6 @@ const PropertyDetailsForm$1 = ({
12005
12108
  consumerCode: consumercodes
12006
12109
  });
12007
12110
  setPropertyLoader(false);
12008
- console.log("result======???????", result);
12009
12111
  if ((result === null || result === void 0 ? void 0 : (_result$Bill = result.Bill) === null || _result$Bill === void 0 ? void 0 : _result$Bill.length) > 0) {
12010
12112
  var _result$Bill$;
12011
12113
  if ((result === null || result === void 0 ? void 0 : (_result$Bill$ = result.Bill[0]) === null || _result$Bill$ === void 0 ? void 0 : _result$Bill$.totalAmount) > 0) {
@@ -12047,10 +12149,6 @@ const PropertyDetailsForm$1 = ({
12047
12149
  }));
12048
12150
  }
12049
12151
  } else if (result !== null && result !== void 0 && result.Bill) {
12050
- setShowToast({
12051
- error: false,
12052
- label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12053
- });
12054
12152
  if (bussinessService === "WS") {
12055
12153
  const updated = [...propertyDetails.waterConnection];
12056
12154
  updated[index].billData = {
@@ -12061,6 +12159,10 @@ const PropertyDetailsForm$1 = ({
12061
12159
  ...prev,
12062
12160
  waterConnection: updated
12063
12161
  }));
12162
+ setShowToast({
12163
+ error: false,
12164
+ label: t("NDC_NO_BILLS_FOUND_WS")
12165
+ });
12064
12166
  } else if (bussinessService === "SW") {
12065
12167
  const updated = [...propertyDetails.sewerageConnection];
12066
12168
  updated[index].billData = {
@@ -12071,6 +12173,10 @@ const PropertyDetailsForm$1 = ({
12071
12173
  ...prev,
12072
12174
  sewerageConnection: updated
12073
12175
  }));
12176
+ setShowToast({
12177
+ error: false,
12178
+ label: t("NDC_NO_BILLS_FOUND_SW")
12179
+ });
12074
12180
  } else if (bussinessService === "PT") {
12075
12181
  let updated = {
12076
12182
  ...propertyDetails.propertyBillData
@@ -12080,12 +12186,12 @@ const PropertyDetailsForm$1 = ({
12080
12186
  ...prev,
12081
12187
  propertyBillData: updated
12082
12188
  }));
12189
+ setShowToast({
12190
+ error: false,
12191
+ label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12192
+ });
12083
12193
  }
12084
12194
  } else {
12085
- setShowToast({
12086
- error: false,
12087
- label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12088
- });
12089
12195
  if (bussinessService === "WS") {
12090
12196
  const updated = [...propertyDetails.waterConnection];
12091
12197
  updated[index].isLoading = false;
@@ -12096,6 +12202,10 @@ const PropertyDetailsForm$1 = ({
12096
12202
  ...prev,
12097
12203
  waterConnection: updated
12098
12204
  }));
12205
+ setShowToast({
12206
+ error: false,
12207
+ label: t("NDC_NO_BILLS_FOUND_WS")
12208
+ });
12099
12209
  } else if (bussinessService === "SW") {
12100
12210
  const updated = [...propertyDetails.sewerageConnection];
12101
12211
  updated[index].isLoading = false;
@@ -12106,6 +12216,10 @@ const PropertyDetailsForm$1 = ({
12106
12216
  ...prev,
12107
12217
  sewerageConnection: updated
12108
12218
  }));
12219
+ setShowToast({
12220
+ error: false,
12221
+ label: t("NDC_NO_BILLS_FOUND_SW")
12222
+ });
12109
12223
  } else if (bussinessService === "PT") {
12110
12224
  let updated = {
12111
12225
  ...propertyDetails.propertyBillData
@@ -12115,6 +12229,10 @@ const PropertyDetailsForm$1 = ({
12115
12229
  ...prev,
12116
12230
  propertyBillData: updated
12117
12231
  }));
12232
+ setShowToast({
12233
+ error: false,
12234
+ label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12235
+ });
12118
12236
  }
12119
12237
  }
12120
12238
  } catch (error) {
@@ -12186,16 +12304,36 @@ const PropertyDetailsForm$1 = ({
12186
12304
  }
12187
12305
  }
12188
12306
  const PayWSBillModal = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("PayWSBillModal");
12307
+ useEffect(() => {
12308
+ if (showToast) {
12309
+ const timer = setTimeout(() => {
12310
+ setShowToast(null);
12311
+ }, 3000);
12312
+ return () => clearTimeout(timer);
12313
+ }
12314
+ }, [showToast]);
12315
+ useEffect(() => {
12316
+ if (apiDataCheck) {
12317
+ var _apiDataCheck$5, _apiDataCheck$5$owner, _apiDataCheck$5$owner2;
12318
+ 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) || "";
12319
+ setValue("email", apiEmail);
12320
+ setPropertyDetails(prev => ({
12321
+ ...prev,
12322
+ email: apiEmail
12323
+ }));
12324
+ }
12325
+ }, [apiDataCheck]);
12326
+ console.log("propertyDetails====", propertyDetails, formData);
12189
12327
  return /*#__PURE__*/React.createElement("div", {
12190
12328
  style: {
12191
12329
  marginBottom: "16px"
12192
12330
  }
12193
- }, (formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : _formData$cpt4.details) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
12331
+ }, ((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$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : _apiDataCheck$6.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
12194
12332
  style: {
12195
12333
  marginTop: "40px"
12196
12334
  }
12197
12335
  }, /*#__PURE__*/React.createElement(CardLabel, {
12198
- className: "card-label-smaller"
12336
+ className: "card-label-smaller ndc_card_labels"
12199
12337
  }, `${t("NDC_WATER_CONNECTION")}`), waterConnectionLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
12200
12338
  className: "field",
12201
12339
  style: {
@@ -12205,7 +12343,7 @@ const PropertyDetailsForm$1 = ({
12205
12343
  width: "100%"
12206
12344
  }
12207
12345
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.map((item, index) => {
12208
- var _item$billData, _item$billData2, _item$billData3, _item$billData4;
12346
+ var _apiDataCheck$7, _item$billData, _item$billData2, _item$billData3, _item$billData4;
12209
12347
  return /*#__PURE__*/React.createElement("div", {
12210
12348
  className: "ndc_property_search",
12211
12349
  key: index,
@@ -12246,7 +12384,7 @@ const PropertyDetailsForm$1 = ({
12246
12384
  alignItems: "center",
12247
12385
  gap: "12px"
12248
12386
  }
12249
- }, (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", {
12387
+ }, !(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", {
12250
12388
  className: "submit-bar",
12251
12389
  type: "button",
12252
12390
  style: {
@@ -12303,7 +12441,7 @@ const PropertyDetailsForm$1 = ({
12303
12441
  marginTop: "40px"
12304
12442
  }
12305
12443
  }, /*#__PURE__*/React.createElement(CardLabel, {
12306
- className: "card-label-smaller"
12444
+ className: "card-label-smaller ndc_card_labels"
12307
12445
  }, `${t("NDC_SEWERAGE_CONNECTION")} `), sewerageConnectionLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
12308
12446
  className: "field",
12309
12447
  style: {
@@ -12313,7 +12451,7 @@ const PropertyDetailsForm$1 = ({
12313
12451
  width: "100%"
12314
12452
  }
12315
12453
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$sewe = propertyDetails.sewerageConnection) === null || _propertyDetails$sewe === void 0 ? void 0 : _propertyDetails$sewe.map((item, index) => {
12316
- var _item$billData5, _item$billData6, _item$billData7, _item$billData8;
12454
+ var _apiDataCheck$8, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
12317
12455
  return /*#__PURE__*/React.createElement("div", {
12318
12456
  className: "ndc_property_search",
12319
12457
  key: index,
@@ -12354,7 +12492,7 @@ const PropertyDetailsForm$1 = ({
12354
12492
  alignItems: "center",
12355
12493
  gap: "12px"
12356
12494
  }
12357
- }, (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", {
12495
+ }, !(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", {
12358
12496
  className: "submit-bar",
12359
12497
  type: "button",
12360
12498
  style: {
@@ -12411,7 +12549,7 @@ const PropertyDetailsForm$1 = ({
12411
12549
  marginTop: "40px"
12412
12550
  }
12413
12551
  }, /*#__PURE__*/React.createElement(CardLabel, {
12414
- className: "card-label-smaller"
12552
+ className: "card-label-smaller ndc_card_labels"
12415
12553
  }, `${t("NDC_FIRST_NAME")} * `), /*#__PURE__*/React.createElement("div", {
12416
12554
  className: "field"
12417
12555
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12442,7 +12580,7 @@ const PropertyDetailsForm$1 = ({
12442
12580
  });
12443
12581
  }
12444
12582
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12445
- className: "card-label-smaller"
12583
+ className: "card-label-smaller ndc_card_labels"
12446
12584
  }, `${t("NDC_LAST_NAME")} * `), /*#__PURE__*/React.createElement("div", {
12447
12585
  className: "field"
12448
12586
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12473,17 +12611,17 @@ const PropertyDetailsForm$1 = ({
12473
12611
  });
12474
12612
  }
12475
12613
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12476
- className: "card-label-smaller"
12614
+ className: "card-label-smaller ndc_card_labels"
12477
12615
  }, `${t("NDC_EMAIL")} * `), /*#__PURE__*/React.createElement("div", {
12478
12616
  className: "field"
12479
12617
  }, /*#__PURE__*/React.createElement(Controller, {
12480
12618
  control: control,
12481
12619
  name: "email",
12482
- defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email) || "",
12620
+ defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email) || (formData === null || formData === void 0 ? void 0 : (_formData$cpt7 = formData.cpt) === null || _formData$cpt7 === void 0 ? void 0 : (_formData$cpt7$detail = _formData$cpt7.details) === null || _formData$cpt7$detail === void 0 ? void 0 : (_formData$cpt7$detail2 = _formData$cpt7$detail.owners) === null || _formData$cpt7$detail2 === void 0 ? void 0 : (_formData$cpt7$detail3 = _formData$cpt7$detail2[0]) === null || _formData$cpt7$detail3 === void 0 ? void 0 : _formData$cpt7$detail3.emailId),
12483
12621
  render: props => {
12484
- var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3, _formData$cpt7$detail4;
12622
+ var _formData$cpt8, _formData$cpt8$detail, _formData$cpt8$detail2, _formData$cpt8$detail3;
12485
12623
  return /*#__PURE__*/React.createElement(TextInput, {
12486
- value: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email,
12624
+ value: props === null || props === void 0 ? void 0 : props.value,
12487
12625
  onChange: e => {
12488
12626
  setPropertyDetails(prev => ({
12489
12627
  ...prev,
@@ -12494,11 +12632,11 @@ const PropertyDetailsForm$1 = ({
12494
12632
  onBlur: e => {
12495
12633
  props.onBlur(e);
12496
12634
  },
12497
- disabled: (formData === null || formData === void 0 ? void 0 : (_formData$cpt7 = formData.cpt) === null || _formData$cpt7 === void 0 ? void 0 : (_formData$cpt7$detail = _formData$cpt7.details) === null || _formData$cpt7$detail === void 0 ? void 0 : (_formData$cpt7$detail2 = _formData$cpt7$detail.owners) === null || _formData$cpt7$detail2 === void 0 ? void 0 : (_formData$cpt7$detail3 = _formData$cpt7$detail2[0]) === null || _formData$cpt7$detail3 === void 0 ? void 0 : (_formData$cpt7$detail4 = _formData$cpt7$detail3.email) === null || _formData$cpt7$detail4 === void 0 ? void 0 : _formData$cpt7$detail4.length) > 0
12635
+ 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$detail3.emailId
12498
12636
  });
12499
12637
  }
12500
12638
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12501
- className: "card-label-smaller"
12639
+ className: "card-label-smaller ndc_card_labels"
12502
12640
  }, `${t("NDC_MOBILE_NUMBER")} * `), /*#__PURE__*/React.createElement("div", {
12503
12641
  className: "field"
12504
12642
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12519,7 +12657,7 @@ const PropertyDetailsForm$1 = ({
12519
12657
  }
12520
12658
  })
12521
12659
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12522
- className: "card-label-smaller"
12660
+ className: "card-label-smaller ndc_card_labels"
12523
12661
  }, `${t("NDC_ADDRESS")} * `), /*#__PURE__*/React.createElement("div", {
12524
12662
  className: "field"
12525
12663
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12527,7 +12665,7 @@ const PropertyDetailsForm$1 = ({
12527
12665
  name: "address",
12528
12666
  defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address) || "",
12529
12667
  render: props => {
12530
- var _formData$cpt8, _formData$cpt8$detail, _formData$cpt8$detail2, _formData$cpt8$detail3, _formData$cpt8$detail4;
12668
+ var _formData$cpt9, _formData$cpt9$detail, _formData$cpt9$detail2, _formData$cpt9$detail3, _formData$cpt9$detail4;
12531
12669
  return /*#__PURE__*/React.createElement(TextInput, {
12532
12670
  value: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.address,
12533
12671
  onChange: e => {
@@ -12540,11 +12678,11 @@ const PropertyDetailsForm$1 = ({
12540
12678
  onBlur: e => {
12541
12679
  props.onBlur(e);
12542
12680
  },
12543
- 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.permanentAddress) === null || _formData$cpt8$detail4 === void 0 ? void 0 : _formData$cpt8$detail4.length) > 0
12681
+ 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
12544
12682
  });
12545
12683
  }
12546
12684
  })))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12547
- className: "card-label-smaller"
12685
+ className: "card-label-smaller ndc_card_labels"
12548
12686
  }, `${t("NDC_TL_NUMBER")}`), /*#__PURE__*/React.createElement("div", {
12549
12687
  className: "field"
12550
12688
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12586,23 +12724,30 @@ const PropertySearchNSummary = ({
12586
12724
  onSelect,
12587
12725
  formData
12588
12726
  }) => {
12589
- var _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _formData$cpt11, _formData$cpt12, _formData$cpt14, _formData$cpt15, _formData$cpt15$dues, _formData$cpt17, _formData$cpt18, _formData$cpt18$dues;
12727
+ var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2;
12590
12728
  const {
12591
12729
  t
12592
12730
  } = useTranslation();
12593
12731
  const myElementRef = useRef(null);
12732
+ const dispatch = useDispatch();
12594
12733
  let {
12595
12734
  pathname,
12596
12735
  state
12597
12736
  } = useLocation();
12598
12737
  state = state && (typeof state === "string" || state instanceof String) ? JSON.parse(state) : state;
12738
+ const apiDataCheck = useSelector(state => {
12739
+ var _state$ndc$NDCForm, _state$ndc$NDCForm$fo;
12740
+ return (_state$ndc$NDCForm = state.ndc.NDCForm) === null || _state$ndc$NDCForm === void 0 ? void 0 : (_state$ndc$NDCForm$fo = _state$ndc$NDCForm.formData) === null || _state$ndc$NDCForm$fo === void 0 ? void 0 : _state$ndc$NDCForm$fo.responseData;
12741
+ });
12599
12742
  const isEditScreen = pathname.includes("/modify-application/");
12600
12743
  const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
12601
12744
  const search = useLocation().search;
12602
12745
  const urlPropertyId = new URLSearchParams(search).get("propertyId");
12603
12746
  const isfirstRender = useRef(true);
12604
- 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 : "") || "");
12605
- const [searchPropertyId, setSearchPropertyId] = useState(formData !== null && formData !== void 0 && (_formData$cpt2 = formData.cpt) !== null && _formData$cpt2 !== void 0 && _formData$cpt2.id || urlPropertyId !== "null" ? urlPropertyId : "");
12747
+ 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");
12748
+ console.log("ptFromApi", ptFromApi);
12749
+ 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) || "");
12750
+ 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) || "");
12606
12751
  const [showToast, setShowToast] = useState(null);
12607
12752
  const [propertyDetails, setPropertyDetails] = useState(() => {
12608
12753
  var _formData$cpt3, _formData$cpt4;
@@ -12635,6 +12780,9 @@ const PropertySearchNSummary = ({
12635
12780
  }
12636
12781
  });
12637
12782
  const [isSearchClicked, setIsSearchClicked] = useState(false);
12783
+ const [getNoDue, setNoDue] = useState(false);
12784
+ const [getCheckStatus, setCheckStats] = useState(false);
12785
+ const [getPayDuesButton, setPayDuesButton] = useState(false);
12638
12786
  const {
12639
12787
  isLoading,
12640
12788
  isError,
@@ -12653,11 +12801,25 @@ const PropertySearchNSummary = ({
12653
12801
  enabled: searchPropertyId ? true : false,
12654
12802
  privacy: Digit.Utils.getPrivacyObject()
12655
12803
  });
12804
+ console.log("apiDataCheck", apiDataCheck);
12805
+ useEffect(() => {
12806
+ if (ptFromApi !== null && ptFromApi !== void 0 && ptFromApi.consumerCode) {
12807
+ setIsSearchClicked(true);
12808
+ setPropertyId(ptFromApi.consumerCode);
12809
+ setSearchPropertyId(ptFromApi.consumerCode);
12810
+ setNoDue(true);
12811
+ onSelect(config.key, {
12812
+ ...formData[config.key],
12813
+ id: ptFromApi.consumerCode
12814
+ });
12815
+ }
12816
+ }, [ptFromApi]);
12656
12817
  useEffect(() => {
12657
12818
  var _propertyDetailsFetch;
12658
12819
  if (propertyDetailsFetch && propertyDetailsFetch !== null && propertyDetailsFetch !== void 0 && propertyDetailsFetch.Properties && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch === void 0 ? void 0 : _propertyDetailsFetch.length) > 0) {
12659
12820
  setPropertyDetails(propertyDetailsFetch);
12660
12821
  setShowToast(null);
12822
+ setCheckStats(true);
12661
12823
  } else {
12662
12824
  var _formData$cpt9;
12663
12825
  if (isfirstRender.current) {
@@ -12665,7 +12827,6 @@ const PropertySearchNSummary = ({
12665
12827
  return;
12666
12828
  }
12667
12829
  if (!(formData !== null && formData !== void 0 && (_formData$cpt9 = formData.cpt) !== null && _formData$cpt9 !== void 0 && _formData$cpt9.details)) {
12668
- console.log("Property Id not found in response", propertyId);
12669
12830
  setPropertyDetails({});
12670
12831
  setShowToast({
12671
12832
  error: true,
@@ -12680,7 +12841,6 @@ const PropertySearchNSummary = ({
12680
12841
  useEffect(() => {
12681
12842
  var _propertyDetails$Prop;
12682
12843
  if (isLoading == false && error && error == true && (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.length) == 0) {
12683
- console.log("Error Caught", error, propertyDetails);
12684
12844
  setShowToast({
12685
12845
  error: true,
12686
12846
  label: "PT_ENTER_VALID_PROPERTY_ID"
@@ -12720,6 +12880,9 @@ const PropertySearchNSummary = ({
12720
12880
  setPropertyId(e.target.value);
12721
12881
  setValue(e.target.value, propertyIdInput.name);
12722
12882
  setIsSearchClicked(false);
12883
+ setNoDue(false);
12884
+ setCheckStats(false);
12885
+ setPayDuesButton(false);
12723
12886
  };
12724
12887
  if (isEditScreen) {
12725
12888
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -12748,9 +12911,6 @@ const PropertySearchNSummary = ({
12748
12911
  [input]: value
12749
12912
  });
12750
12913
  }
12751
- function getValue(input) {
12752
- return formData && formData[config.key] ? formData[config.key][input] : undefined;
12753
- }
12754
12914
  async function fetchBill() {
12755
12915
  try {
12756
12916
  var _formData$cpt0, _result$Bill;
@@ -12765,11 +12925,14 @@ const PropertySearchNSummary = ({
12765
12925
  error: true,
12766
12926
  label: t("NDC_MESSAGE_DUES_FOUND_PLEASE_PAY")
12767
12927
  });
12928
+ setPayDuesButton(true);
12768
12929
  } else {
12769
12930
  setShowToast({
12770
12931
  error: false,
12771
- label: t("NDC_MESSAGE_NO_DUES_FOUND")
12932
+ label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12772
12933
  });
12934
+ setNoDue(true);
12935
+ setCheckStats(false);
12773
12936
  }
12774
12937
  setPropertyDues({
12775
12938
  dues: result === null || result === void 0 ? void 0 : result.Bill[0]
@@ -12777,23 +12940,27 @@ const PropertySearchNSummary = ({
12777
12940
  } else if (result !== null && result !== void 0 && result.Bill) {
12778
12941
  setShowToast({
12779
12942
  error: false,
12780
- label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12943
+ label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12781
12944
  });
12782
12945
  setPropertyDues({
12783
12946
  dues: {
12784
12947
  totalAmount: 0
12785
12948
  }
12786
12949
  });
12950
+ setNoDue(true);
12951
+ setCheckStats(false);
12787
12952
  } else {
12788
12953
  setShowToast({
12789
12954
  error: false,
12790
- label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12955
+ label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12791
12956
  });
12792
12957
  setPropertyDues({
12793
12958
  dues: {
12794
12959
  totalAmount: 0
12795
12960
  }
12796
12961
  });
12962
+ setNoDue(true);
12963
+ setCheckStats(false);
12797
12964
  }
12798
12965
  } catch (error) {
12799
12966
  setShowToast({
@@ -12809,12 +12976,20 @@ const PropertySearchNSummary = ({
12809
12976
  window.open(payUrl, "_blank");
12810
12977
  setPropertyDues({});
12811
12978
  }
12979
+ useEffect(() => {
12980
+ if (showToast) {
12981
+ const timer = setTimeout(() => {
12982
+ setShowToast(null);
12983
+ }, 3000);
12984
+ return () => clearTimeout(timer);
12985
+ }
12986
+ }, [showToast]);
12812
12987
  return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading && /*#__PURE__*/React.createElement(Loader, null), /*#__PURE__*/React.createElement("div", {
12813
12988
  style: {
12814
12989
  marginBottom: "16px"
12815
12990
  }
12816
12991
  }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12817
- className: "card-label-smaller",
12992
+ className: "card-label-smaller ndc_card_labels",
12818
12993
  style: getInputStyles()
12819
12994
  }, `${t(propertyIdInput.label)}`, null), /*#__PURE__*/React.createElement("div", {
12820
12995
  className: "field ndc_property_search",
@@ -12829,7 +13004,7 @@ const PropertySearchNSummary = ({
12829
13004
  id: "search-property-field"
12830
13005
  }, /*#__PURE__*/React.createElement(TextInput, Object.assign({
12831
13006
  key: propertyIdInput.name,
12832
- value: getValue(propertyIdInput.name),
13007
+ value: propertyId,
12833
13008
  onChange: handlePropertyChange,
12834
13009
  disable: false,
12835
13010
  maxlength: 16,
@@ -12843,7 +13018,7 @@ const PropertySearchNSummary = ({
12843
13018
  maxWidth: "100px"
12844
13019
  },
12845
13020
  onClick: searchProperty
12846
- }, `${t("PT_SEARCH")}`), (formData === null || formData === void 0 ? void 0 : (_formData$cpt11 = formData.cpt) === null || _formData$cpt11 === void 0 ? void 0 : _formData$cpt11.details) && !(formData !== null && formData !== void 0 && (_formData$cpt12 = formData.cpt) !== null && _formData$cpt12 !== void 0 && _formData$cpt12.dues) && /*#__PURE__*/React.createElement("button", {
13021
+ }, `${t("PT_SEARCH")}`), !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && _apiDataCheck$2.NdcDetails) && getCheckStatus && !getPayDuesButton && /*#__PURE__*/React.createElement("button", {
12847
13022
  className: "submit-bar",
12848
13023
  type: "button",
12849
13024
  style: {
@@ -12855,7 +13030,7 @@ const PropertySearchNSummary = ({
12855
13030
  onClick: () => {
12856
13031
  fetchBill();
12857
13032
  }
12858
- }, `${t("CHECK_STATUS_PROPERTY")}`), (formData === null || formData === void 0 ? void 0 : (_formData$cpt14 = formData.cpt) === null || _formData$cpt14 === void 0 ? void 0 : _formData$cpt14.id) && (formData === null || formData === void 0 ? void 0 : (_formData$cpt15 = formData.cpt) === null || _formData$cpt15 === void 0 ? void 0 : (_formData$cpt15$dues = _formData$cpt15.dues) === null || _formData$cpt15$dues === void 0 ? void 0 : _formData$cpt15$dues.totalAmount) > 0 && /*#__PURE__*/React.createElement("button", {
13033
+ }, `${t("CHECK_STATUS_PROPERTY")}`), getPayDuesButton && /*#__PURE__*/React.createElement("button", {
12859
13034
  className: "submit-bar",
12860
13035
  type: "button",
12861
13036
  style: {
@@ -12865,8 +13040,9 @@ const PropertySearchNSummary = ({
12865
13040
  },
12866
13041
  onClick: () => {
12867
13042
  redirectToPayBill();
13043
+ setPayDuesButton(false);
12868
13044
  }
12869
- }, `${t("PAY_DUES")}`), (formData === null || formData === void 0 ? void 0 : (_formData$cpt17 = formData.cpt) === null || _formData$cpt17 === void 0 ? void 0 : _formData$cpt17.id) && (formData === null || formData === void 0 ? void 0 : (_formData$cpt18 = formData.cpt) === null || _formData$cpt18 === void 0 ? void 0 : (_formData$cpt18$dues = _formData$cpt18.dues) === null || _formData$cpt18$dues === void 0 ? void 0 : _formData$cpt18$dues.totalAmount) == 0 && /*#__PURE__*/React.createElement("div", {
13045
+ }, `${t("PAY_DUES")}`), getNoDue && /*#__PURE__*/React.createElement("div", {
12870
13046
  style: {
12871
13047
  color: "green",
12872
13048
  width: "100%",
@@ -12938,6 +13114,7 @@ const SelectNDCDocuments = ({
12938
13114
  formState: formState
12939
13115
  });
12940
13116
  }), error && /*#__PURE__*/React.createElement(Toast, {
13117
+ isDleteBtn: true,
12941
13118
  label: error,
12942
13119
  onClose: () => setError(null),
12943
13120
  error: true
@@ -13634,6 +13811,18 @@ const NewNDCStepForm$1 = () => {
13634
13811
  const formState = useSelector(state => state.ndc.NDCForm);
13635
13812
  const step = formState.step;
13636
13813
  const tenantId = Digit.ULBService.getCurrentTenantId();
13814
+ const id = window.location.pathname.split("/").pop();
13815
+ const {
13816
+ isLoading,
13817
+ data: applicationDetails
13818
+ } = Digit.Hooks.ndc.useSearchEmployeeApplication({
13819
+ uuid: id
13820
+ }, tenantId);
13821
+ useEffect(() => {
13822
+ if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
13823
+ dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
13824
+ }
13825
+ }, [applicationDetails]);
13637
13826
  const setStep = updatedStepNumber => {
13638
13827
  dispatch(setNDCStep(updatedStepNumber));
13639
13828
  };
@@ -13788,6 +13977,7 @@ const NewNDCStepFormOne$1 = ({
13788
13977
  };
13789
13978
  function validateStepData(data) {
13790
13979
  var _data$cpt6, _data$cpt6$dues, _data$cpt7, _data$cpt7$dues, _data$dues, _propertyDetails$wate, _propertyDetails$sewe;
13980
+ console.log("data", data);
13791
13981
  const missingFields = [];
13792
13982
  const invalidFields = [];
13793
13983
  const cpt = (data === null || data === void 0 ? void 0 : data.cpt) || {};
@@ -13831,7 +14021,7 @@ const NewNDCStepFormOne$1 = ({
13831
14021
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
13832
14022
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
13833
14023
  const nameRegex = /^[A-Za-z\s]+$/;
13834
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
14024
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
13835
14025
  const mobileRegex = /^[6-9]\d{9}$/;
13836
14026
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
13837
14027
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));