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

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, 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';
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';
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,16 +642,14 @@ const App = () => {
642
642
  url,
643
643
  ...match
644
644
  } = useRouteMatch();
645
- const {
646
- t
647
- } = useTranslation();
645
+ console.log("NDC Citizen App Loaded", path);
648
646
  const NewNDCStepForm = Digit.ComponentRegistryService.getComponent("NewNDCStepFormCitizen");
649
647
  const MyApplications = Digit.ComponentRegistryService.getComponent("MyApplications");
650
648
  const NDCResponseCitizen = Digit.ComponentRegistryService.getComponent("NDCResponseCitizen");
651
649
  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");
652
650
  return /*#__PURE__*/React.createElement("span", {
653
651
  className: "tl-citizen"
654
- }, /*#__PURE__*/React.createElement(BackButton, null, t("CS_COMMON_BACK")), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(PrivateRoute, {
652
+ }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(PrivateRoute, {
655
653
  path: `${path}/new-application`,
656
654
  component: NewNDCStepForm
657
655
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
@@ -1027,7 +1025,6 @@ const NDCModal = ({
1027
1025
  Licenses: [applicationData]
1028
1026
  });
1029
1027
  }
1030
- console.log("config.label.submit", config);
1031
1028
  useEffect(() => {
1032
1029
  if (action) {
1033
1030
  setConfig(ModalConfig({
@@ -1082,6 +1079,7 @@ const getTimelineCaptions = (checkpoint, index, arr, t) => {
1082
1079
  thumbnailsToShow,
1083
1080
  wfDocuments
1084
1081
  } = checkpoint;
1082
+ console.log("wfDocuments", wfDocuments);
1085
1083
  const caption = {
1086
1084
  date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
1087
1085
  name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name,
@@ -1114,7 +1112,7 @@ const getTimelineCaptions = (checkpoint, index, arr, t) => {
1114
1112
  }, 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()))));
1115
1113
  };
1116
1114
  const ApplicationOverview = () => {
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;
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;
1118
1116
  const {
1119
1117
  id
1120
1118
  } = useParams();
@@ -1223,6 +1221,7 @@ const ApplicationOverview = () => {
1223
1221
  useEffect(() => {
1224
1222
  var _applicationDetails$A;
1225
1223
  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);
1226
1225
  if (ndcObject) {
1227
1226
  var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
1228
1227
  const applicantData = {
@@ -1251,12 +1250,14 @@ const ApplicationOverview = () => {
1251
1250
  }
1252
1251
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
1253
1252
  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);
1260
1261
  const payload = {
1261
1262
  Licenses: [action]
1262
1263
  };
@@ -1274,6 +1275,7 @@ const ApplicationOverview = () => {
1274
1275
  const submitAction = async data => {
1275
1276
  var _data$Licenses;
1276
1277
  const payloadData = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications[0];
1278
+ console.log("data", data);
1277
1279
  const updatedApplicant = {
1278
1280
  ...payloadData,
1279
1281
  workflow: {}
@@ -1285,6 +1287,7 @@ const ApplicationOverview = () => {
1285
1287
  comment: filtData === null || filtData === void 0 ? void 0 : filtData.comment,
1286
1288
  documents: filtData === null || filtData === void 0 ? void 0 : filtData.wfDocuments
1287
1289
  };
1290
+ console.log("filtData", filtData);
1288
1291
  if (!(filtData !== null && filtData !== void 0 && filtData.assignee) && filtData.action == "FORWARD") {
1289
1292
  setShowToast({
1290
1293
  key: "error"
@@ -1333,7 +1336,11 @@ const ApplicationOverview = () => {
1333
1336
  }
1334
1337
  return /*#__PURE__*/React.createElement("div", {
1335
1338
  className: "employee-main-application-details"
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, {
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, {
1337
1344
  key: key,
1338
1345
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
1339
1346
  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")
@@ -1375,10 +1382,10 @@ const ApplicationOverview = () => {
1375
1382
  }) : /*#__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, {
1376
1383
  keyValue: index,
1377
1384
  isCompleted: index === 0,
1378
- label: t(checkpoint.status),
1385
+ label: t("NDC_STATUS_" + checkpoint.status),
1379
1386
  customChild: getTimelineCaptions(checkpoint, index, arr, t)
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`,
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"}`,
1382
1389
  options: actions,
1383
1390
  optionKey: "action",
1384
1391
  t: t,
@@ -1387,13 +1394,6 @@ const ApplicationOverview = () => {
1387
1394
  ref: menuRef,
1388
1395
  label: t("WF_TAKE_ACTION"),
1389
1396
  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,74 +8731,49 @@ 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, _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];
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]) || {};
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")}`;
8737
8767
  return {
8738
- t: t,
8768
+ t,
8739
8769
  tenantId: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code,
8740
8770
  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(".", "_")}`))}`,
8741
8771
  email: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.emailId,
8742
8772
  phoneNumber: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.contactNumber,
8743
8773
  heading: t("NDC_CERTIFICATE"),
8744
- applicationNumber: (appData === null || appData === void 0 ? void 0 : appData.uuid) || "NA",
8774
+ applicationNumber,
8745
8775
  details: [{
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
- }]
8776
+ value: certificateBody
8802
8777
  }]
8803
8778
  };
8804
8779
  };
@@ -8841,14 +8816,13 @@ const getTimelineCaptions$1 = (checkpoint, index, arr, t) => {
8841
8816
  }, 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()))));
8842
8817
  };
8843
8818
  const CitizenApplicationOverview = () => {
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;
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;
8845
8820
  const {
8846
8821
  id
8847
8822
  } = useParams();
8848
8823
  const {
8849
8824
  t
8850
8825
  } = useTranslation();
8851
- const history = useHistory();
8852
8826
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
8853
8827
  const state = tenantId === null || tenantId === void 0 ? void 0 : tenantId.split(".")[0];
8854
8828
  const [appDetails, setAppDetails] = useState({});
@@ -8901,12 +8875,12 @@ const CitizenApplicationOverview = () => {
8901
8875
  var _applicationDetails$A;
8902
8876
  const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
8903
8877
  if (ndcObject) {
8904
- var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
8878
+ var _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _removeDuplicatesByUU;
8905
8879
  const applicantData = {
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,
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,
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
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,
8882
+ 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,
8910
8884
  applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.uuid
8911
8885
  };
8912
8886
  const Documents = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.Documents) || []);
@@ -8928,6 +8902,7 @@ const CitizenApplicationOverview = () => {
8928
8902
  }
8929
8903
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
8930
8904
  useEffect(() => {
8905
+ console.log("applicationDetails", applicationDetails);
8931
8906
  if (applicationDetails) {
8932
8907
  setIsDetailsLoading(true);
8933
8908
  setAppDetails({
@@ -8941,9 +8916,12 @@ const CitizenApplicationOverview = () => {
8941
8916
  }, [applicationDetails]);
8942
8917
  const handleDownloadPdf = async () => {
8943
8918
  const Property = applicationDetails;
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));
8919
+ console.log("applicationDetails in StakeholderAck", applicationDetails);
8920
+ console.log("tenants", tenants);
8921
+ const tenantInfo = tenants.find(tenant => tenant.code === Property.tenantId);
8945
8922
  const acknowledgementData = await getAcknowledgementData(Property, tenantInfo, t);
8946
- Digit.Utils.pdf.generate(acknowledgementData);
8923
+ console.log("acknowledgementData", acknowledgementData);
8924
+ Digit.Utils.pdf.generateNDC(acknowledgementData);
8947
8925
  };
8948
8926
  if (isLoading || isDetailsLoading) {
8949
8927
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -8953,34 +8931,25 @@ const CitizenApplicationOverview = () => {
8953
8931
  }, /*#__PURE__*/React.createElement("div", {
8954
8932
  style: {
8955
8933
  display: "flex",
8956
- justifyContent: "end",
8934
+ justifyContent: "space-between",
8957
8935
  alignItems: "center",
8958
8936
  padding: "16px"
8959
8937
  }
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",
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, {
8962
8943
  label: t("DOWNLOAD_CERTIFICATE"),
8944
+ style: {
8945
+ color: "#A52A2A"
8946
+ },
8963
8947
  onClick: handleDownloadPdf
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, {
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, {
8976
8949
  key: key,
8977
8950
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
8978
8951
  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")
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) => {
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) => {
8984
8953
  var _detail$dueAmount;
8985
8954
  return /*#__PURE__*/React.createElement("div", {
8986
8955
  key: index,
@@ -9003,11 +8972,7 @@ const CitizenApplicationOverview = () => {
9003
8972
  label: t("NDC_PROPERTY_TYPE"),
9004
8973
  text: t(detail.propertyType) || detail.propertyType
9005
8974
  })));
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", {
8975
+ })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
9011
8976
  style: {
9012
8977
  display: "flex",
9013
8978
  gap: "16px"
@@ -9016,17 +8981,13 @@ const CitizenApplicationOverview = () => {
9016
8981
  value: {
9017
8982
  workflowDocs: displayData === null || displayData === void 0 ? void 0 : displayData.Documents
9018
8983
  }
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, {
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, {
9024
8985
  isCompleted: true,
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)
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))
9026
8987
  }) : /*#__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, {
9027
8988
  keyValue: index,
9028
8989
  isCompleted: index === 0,
9029
- label: t(checkpoint.status),
8990
+ label: t("NDC_STATUS_" + checkpoint.status),
9030
8991
  customChild: getTimelineCaptions$1(checkpoint, index, arr, t)
9031
8992
  })))));
9032
8993
  };
@@ -9557,7 +9518,7 @@ const Inbox = ({
9557
9518
  }, [data]);
9558
9519
  const PropsForInboxLinks = {
9559
9520
  logoIcon: /*#__PURE__*/React.createElement(ComplaintIcon, null),
9560
- headerText: `${t("MODULE_NKS_NO_DUE_CERTIFICATE_FEES")}`,
9521
+ headerText: "NDC Module",
9561
9522
  links: [{
9562
9523
  text: "Create NDC Application",
9563
9524
  link: "/digit-ui/employee/ndc/create"
@@ -11453,12 +11414,6 @@ const config = [{
11453
11414
  head: "",
11454
11415
  stepNumber: 1,
11455
11416
  body: [{
11456
- name: "NDC_COMMON_NDC_REASON",
11457
- type: "component",
11458
- component: "SelectNDCReason",
11459
- key: "NDCReason",
11460
- withoutLabel: true
11461
- }, {
11462
11417
  name: "",
11463
11418
  type: "component",
11464
11419
  component: "NDCPropertySearch",
@@ -11470,6 +11425,12 @@ const config = [{
11470
11425
  component: "PropertyDetailsFormCitizen",
11471
11426
  key: "PropertyDetails",
11472
11427
  withoutLabel: true
11428
+ }, {
11429
+ name: "NDC_COMMON_NDC_REASON",
11430
+ type: "component",
11431
+ component: "SelectNDCReason",
11432
+ key: "NDCReason",
11433
+ withoutLabel: true
11473
11434
  }]
11474
11435
  }, {
11475
11436
  head: "NDC_COMMON_DOCUMENTS_REQUIRED",
@@ -11544,29 +11505,10 @@ const NewNDCStepForm = () => {
11544
11505
  const formState = useSelector(state => state.ndc.NDCForm);
11545
11506
  const step = formState.step;
11546
11507
  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]);
11559
11508
  const setStep = updatedStepNumber => {
11560
11509
  dispatch(setNDCStep(updatedStepNumber));
11561
11510
  };
11562
11511
  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]);
11570
11512
  return /*#__PURE__*/React.createElement("div", {
11571
11513
  className: "pageCard"
11572
11514
  }, /*#__PURE__*/React.createElement(CardHeader, {
@@ -11753,7 +11695,7 @@ const NewNDCStepFormOne = ({
11753
11695
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
11754
11696
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
11755
11697
  const nameRegex = /^[A-Za-z\s]+$/;
11756
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
11698
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
11757
11699
  const mobileRegex = /^[6-9]\d{9}$/;
11758
11700
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
11759
11701
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
@@ -11826,10 +11768,6 @@ function SelectNDCReason({
11826
11768
  const {
11827
11769
  t
11828
11770
  } = 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
- });
11833
11771
  const {
11834
11772
  data: menuList,
11835
11773
  isLoading
@@ -11853,18 +11791,6 @@ function SelectNDCReason({
11853
11791
  useEffect(() => {
11854
11792
  onSelect("NDCReason", ndcReason, config);
11855
11793
  }, [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]);
11868
11794
  if (isLoading) {
11869
11795
  return /*#__PURE__*/React.createElement(Loader, null);
11870
11796
  }
@@ -11876,10 +11802,10 @@ function SelectNDCReason({
11876
11802
  };
11877
11803
  return /*#__PURE__*/React.createElement("div", {
11878
11804
  style: {
11879
- paddingBottom: "16px"
11805
+ marginBottom: "16px"
11880
11806
  }
11881
11807
  }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
11882
- className: "card-label-smaller ndc_card_labels"
11808
+ className: "card-label-smaller"
11883
11809
  }, `${t("NDC_NEW_NDC_APPLICATION_NDC_REASON")} * `), /*#__PURE__*/React.createElement(Controller, {
11884
11810
  name: "NDCReason",
11885
11811
  rules: {
@@ -11893,7 +11819,6 @@ function SelectNDCReason({
11893
11819
  option: ndcReasonOptions,
11894
11820
  select: e => {
11895
11821
  setNDCReason(e);
11896
- props.onChange(e);
11897
11822
  },
11898
11823
  optionKey: "i18nKey",
11899
11824
  onBlur: props.onBlur,
@@ -11912,7 +11837,7 @@ const PropertyDetailsForm$1 = ({
11912
11837
  formState,
11913
11838
  clearErrors
11914
11839
  }) => {
11915
- var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _apiDataCheck$6, _propertyDetails$wate, _propertyDetails$sewe;
11840
+ var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _propertyDetails$wate, _propertyDetails$sewe;
11916
11841
  const {
11917
11842
  control,
11918
11843
  formState: localFormState,
@@ -11925,10 +11850,6 @@ const PropertyDetailsForm$1 = ({
11925
11850
  t
11926
11851
  } = useTranslation();
11927
11852
  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
- });
11932
11853
  const [showToast, setShowToast] = useState(null);
11933
11854
  const [propertyLoader, setPropertyLoader] = useState(false);
11934
11855
  const [showPayModal, setShowPayModal] = useState(false);
@@ -11997,63 +11918,39 @@ const PropertyDetailsForm$1 = ({
11997
11918
  });
11998
11919
  }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : _formData$cpt3.details]);
11999
11920
  useEffect(() => {
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
- }))) || [];
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
+ });
12022
11935
  }
12023
- setPropertyDetails(prev => ({
12024
- ...prev,
12025
- waterConnection
12026
- }));
12027
- }, [waterConnectionData, apiDataCheck]);
11936
+ }, [waterConnectionData, waterConnectionLoading]);
12028
11937
  useEffect(() => {
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
- }))) || [];
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
+ });
12051
11952
  }
12052
- setPropertyDetails(prev => ({
12053
- ...prev,
12054
- sewerageConnection
12055
- }));
12056
- }, [sewerageConnectionData, apiDataCheck]);
11953
+ }, [sewerageConnectionData, sewerageConnectionLoading]);
12057
11954
  useEffect(() => {
12058
11955
  onSelect("PropertyDetails", propertyDetails, config);
12059
11956
  }, [propertyDetails]);
@@ -12108,6 +12005,7 @@ const PropertyDetailsForm$1 = ({
12108
12005
  consumerCode: consumercodes
12109
12006
  });
12110
12007
  setPropertyLoader(false);
12008
+ console.log("result======???????", result);
12111
12009
  if ((result === null || result === void 0 ? void 0 : (_result$Bill = result.Bill) === null || _result$Bill === void 0 ? void 0 : _result$Bill.length) > 0) {
12112
12010
  var _result$Bill$;
12113
12011
  if ((result === null || result === void 0 ? void 0 : (_result$Bill$ = result.Bill[0]) === null || _result$Bill$ === void 0 ? void 0 : _result$Bill$.totalAmount) > 0) {
@@ -12149,6 +12047,10 @@ const PropertyDetailsForm$1 = ({
12149
12047
  }));
12150
12048
  }
12151
12049
  } 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
+ });
12152
12054
  if (bussinessService === "WS") {
12153
12055
  const updated = [...propertyDetails.waterConnection];
12154
12056
  updated[index].billData = {
@@ -12159,10 +12061,6 @@ const PropertyDetailsForm$1 = ({
12159
12061
  ...prev,
12160
12062
  waterConnection: updated
12161
12063
  }));
12162
- setShowToast({
12163
- error: false,
12164
- label: t("NDC_NO_BILLS_FOUND_WS")
12165
- });
12166
12064
  } else if (bussinessService === "SW") {
12167
12065
  const updated = [...propertyDetails.sewerageConnection];
12168
12066
  updated[index].billData = {
@@ -12173,10 +12071,6 @@ const PropertyDetailsForm$1 = ({
12173
12071
  ...prev,
12174
12072
  sewerageConnection: updated
12175
12073
  }));
12176
- setShowToast({
12177
- error: false,
12178
- label: t("NDC_NO_BILLS_FOUND_SW")
12179
- });
12180
12074
  } else if (bussinessService === "PT") {
12181
12075
  let updated = {
12182
12076
  ...propertyDetails.propertyBillData
@@ -12186,12 +12080,12 @@ const PropertyDetailsForm$1 = ({
12186
12080
  ...prev,
12187
12081
  propertyBillData: updated
12188
12082
  }));
12189
- setShowToast({
12190
- error: false,
12191
- label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12192
- });
12193
12083
  }
12194
12084
  } else {
12085
+ setShowToast({
12086
+ error: false,
12087
+ label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12088
+ });
12195
12089
  if (bussinessService === "WS") {
12196
12090
  const updated = [...propertyDetails.waterConnection];
12197
12091
  updated[index].isLoading = false;
@@ -12202,10 +12096,6 @@ const PropertyDetailsForm$1 = ({
12202
12096
  ...prev,
12203
12097
  waterConnection: updated
12204
12098
  }));
12205
- setShowToast({
12206
- error: false,
12207
- label: t("NDC_NO_BILLS_FOUND_WS")
12208
- });
12209
12099
  } else if (bussinessService === "SW") {
12210
12100
  const updated = [...propertyDetails.sewerageConnection];
12211
12101
  updated[index].isLoading = false;
@@ -12216,10 +12106,6 @@ const PropertyDetailsForm$1 = ({
12216
12106
  ...prev,
12217
12107
  sewerageConnection: updated
12218
12108
  }));
12219
- setShowToast({
12220
- error: false,
12221
- label: t("NDC_NO_BILLS_FOUND_SW")
12222
- });
12223
12109
  } else if (bussinessService === "PT") {
12224
12110
  let updated = {
12225
12111
  ...propertyDetails.propertyBillData
@@ -12229,10 +12115,6 @@ const PropertyDetailsForm$1 = ({
12229
12115
  ...prev,
12230
12116
  propertyBillData: updated
12231
12117
  }));
12232
- setShowToast({
12233
- error: false,
12234
- label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12235
- });
12236
12118
  }
12237
12119
  }
12238
12120
  } catch (error) {
@@ -12304,36 +12186,16 @@ const PropertyDetailsForm$1 = ({
12304
12186
  }
12305
12187
  }
12306
12188
  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);
12327
12189
  return /*#__PURE__*/React.createElement("div", {
12328
12190
  style: {
12329
12191
  marginBottom: "16px"
12330
12192
  }
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, {
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, {
12332
12194
  style: {
12333
12195
  marginTop: "40px"
12334
12196
  }
12335
12197
  }, /*#__PURE__*/React.createElement(CardLabel, {
12336
- className: "card-label-smaller ndc_card_labels"
12198
+ className: "card-label-smaller"
12337
12199
  }, `${t("NDC_WATER_CONNECTION")}`), waterConnectionLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
12338
12200
  className: "field",
12339
12201
  style: {
@@ -12343,7 +12205,7 @@ const PropertyDetailsForm$1 = ({
12343
12205
  width: "100%"
12344
12206
  }
12345
12207
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.map((item, index) => {
12346
- var _apiDataCheck$7, _item$billData, _item$billData2, _item$billData3, _item$billData4;
12208
+ var _item$billData, _item$billData2, _item$billData3, _item$billData4;
12347
12209
  return /*#__PURE__*/React.createElement("div", {
12348
12210
  className: "ndc_property_search",
12349
12211
  key: index,
@@ -12384,7 +12246,7 @@ const PropertyDetailsForm$1 = ({
12384
12246
  alignItems: "center",
12385
12247
  gap: "12px"
12386
12248
  }
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", {
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", {
12388
12250
  className: "submit-bar",
12389
12251
  type: "button",
12390
12252
  style: {
@@ -12441,7 +12303,7 @@ const PropertyDetailsForm$1 = ({
12441
12303
  marginTop: "40px"
12442
12304
  }
12443
12305
  }, /*#__PURE__*/React.createElement(CardLabel, {
12444
- className: "card-label-smaller ndc_card_labels"
12306
+ className: "card-label-smaller"
12445
12307
  }, `${t("NDC_SEWERAGE_CONNECTION")} `), sewerageConnectionLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
12446
12308
  className: "field",
12447
12309
  style: {
@@ -12451,7 +12313,7 @@ const PropertyDetailsForm$1 = ({
12451
12313
  width: "100%"
12452
12314
  }
12453
12315
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$sewe = propertyDetails.sewerageConnection) === null || _propertyDetails$sewe === void 0 ? void 0 : _propertyDetails$sewe.map((item, index) => {
12454
- var _apiDataCheck$8, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
12316
+ var _item$billData5, _item$billData6, _item$billData7, _item$billData8;
12455
12317
  return /*#__PURE__*/React.createElement("div", {
12456
12318
  className: "ndc_property_search",
12457
12319
  key: index,
@@ -12492,7 +12354,7 @@ const PropertyDetailsForm$1 = ({
12492
12354
  alignItems: "center",
12493
12355
  gap: "12px"
12494
12356
  }
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", {
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", {
12496
12358
  className: "submit-bar",
12497
12359
  type: "button",
12498
12360
  style: {
@@ -12549,7 +12411,7 @@ const PropertyDetailsForm$1 = ({
12549
12411
  marginTop: "40px"
12550
12412
  }
12551
12413
  }, /*#__PURE__*/React.createElement(CardLabel, {
12552
- className: "card-label-smaller ndc_card_labels"
12414
+ className: "card-label-smaller"
12553
12415
  }, `${t("NDC_FIRST_NAME")} * `), /*#__PURE__*/React.createElement("div", {
12554
12416
  className: "field"
12555
12417
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12580,7 +12442,7 @@ const PropertyDetailsForm$1 = ({
12580
12442
  });
12581
12443
  }
12582
12444
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12583
- className: "card-label-smaller ndc_card_labels"
12445
+ className: "card-label-smaller"
12584
12446
  }, `${t("NDC_LAST_NAME")} * `), /*#__PURE__*/React.createElement("div", {
12585
12447
  className: "field"
12586
12448
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12611,7 +12473,7 @@ const PropertyDetailsForm$1 = ({
12611
12473
  });
12612
12474
  }
12613
12475
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12614
- className: "card-label-smaller ndc_card_labels"
12476
+ className: "card-label-smaller"
12615
12477
  }, `${t("NDC_EMAIL")} * `), /*#__PURE__*/React.createElement("div", {
12616
12478
  className: "field"
12617
12479
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12619,9 +12481,9 @@ const PropertyDetailsForm$1 = ({
12619
12481
  name: "email",
12620
12482
  defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email) || "",
12621
12483
  render: props => {
12622
- var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3;
12484
+ var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3, _formData$cpt7$detail4;
12623
12485
  return /*#__PURE__*/React.createElement(TextInput, {
12624
- value: props === null || props === void 0 ? void 0 : props.value,
12486
+ value: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email,
12625
12487
  onChange: e => {
12626
12488
  setPropertyDetails(prev => ({
12627
12489
  ...prev,
@@ -12632,11 +12494,11 @@ const PropertyDetailsForm$1 = ({
12632
12494
  onBlur: e => {
12633
12495
  props.onBlur(e);
12634
12496
  },
12635
- 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$detail3.emailId
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
12636
12498
  });
12637
12499
  }
12638
12500
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12639
- className: "card-label-smaller ndc_card_labels"
12501
+ className: "card-label-smaller"
12640
12502
  }, `${t("NDC_MOBILE_NUMBER")} * `), /*#__PURE__*/React.createElement("div", {
12641
12503
  className: "field"
12642
12504
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12657,7 +12519,7 @@ const PropertyDetailsForm$1 = ({
12657
12519
  }
12658
12520
  })
12659
12521
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12660
- className: "card-label-smaller ndc_card_labels"
12522
+ className: "card-label-smaller"
12661
12523
  }, `${t("NDC_ADDRESS")} * `), /*#__PURE__*/React.createElement("div", {
12662
12524
  className: "field"
12663
12525
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12682,7 +12544,7 @@ const PropertyDetailsForm$1 = ({
12682
12544
  });
12683
12545
  }
12684
12546
  })))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12685
- className: "card-label-smaller ndc_card_labels"
12547
+ className: "card-label-smaller"
12686
12548
  }, `${t("NDC_TL_NUMBER")}`), /*#__PURE__*/React.createElement("div", {
12687
12549
  className: "field"
12688
12550
  }, /*#__PURE__*/React.createElement(Controller, {
@@ -12724,30 +12586,23 @@ const PropertySearchNSummary = ({
12724
12586
  onSelect,
12725
12587
  formData
12726
12588
  }) => {
12727
- var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$cpt12, _formData$cpt13, _formData$cpt13$dues;
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;
12728
12590
  const {
12729
12591
  t
12730
12592
  } = useTranslation();
12731
12593
  const myElementRef = useRef(null);
12732
- const dispatch = useDispatch();
12733
12594
  let {
12734
12595
  pathname,
12735
12596
  state
12736
12597
  } = useLocation();
12737
12598
  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
- });
12742
12599
  const isEditScreen = pathname.includes("/modify-application/");
12743
12600
  const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
12744
12601
  const search = useLocation().search;
12745
12602
  const urlPropertyId = new URLSearchParams(search).get("propertyId");
12746
12603
  const isfirstRender = useRef(true);
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) || "");
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 : "");
12751
12606
  const [showToast, setShowToast] = useState(null);
12752
12607
  const [propertyDetails, setPropertyDetails] = useState(() => {
12753
12608
  var _formData$cpt3, _formData$cpt4;
@@ -12780,8 +12635,6 @@ const PropertySearchNSummary = ({
12780
12635
  }
12781
12636
  });
12782
12637
  const [isSearchClicked, setIsSearchClicked] = useState(false);
12783
- const [getNoDue, setNoDue] = useState(false);
12784
- const [getCheckStatus, setCheckStats] = useState(false);
12785
12638
  const {
12786
12639
  isLoading,
12787
12640
  isError,
@@ -12800,25 +12653,11 @@ const PropertySearchNSummary = ({
12800
12653
  enabled: searchPropertyId ? true : false,
12801
12654
  privacy: Digit.Utils.getPrivacyObject()
12802
12655
  });
12803
- console.log("apiDataCheck", apiDataCheck);
12804
- useEffect(() => {
12805
- if (ptFromApi !== null && ptFromApi !== void 0 && ptFromApi.consumerCode) {
12806
- setIsSearchClicked(true);
12807
- setPropertyId(ptFromApi.consumerCode);
12808
- setSearchPropertyId(ptFromApi.consumerCode);
12809
- setNoDue(true);
12810
- onSelect(config.key, {
12811
- ...formData[config.key],
12812
- id: ptFromApi.consumerCode
12813
- });
12814
- }
12815
- }, [ptFromApi]);
12816
12656
  useEffect(() => {
12817
12657
  var _propertyDetailsFetch;
12818
12658
  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) {
12819
12659
  setPropertyDetails(propertyDetailsFetch);
12820
12660
  setShowToast(null);
12821
- setCheckStats(true);
12822
12661
  } else {
12823
12662
  var _formData$cpt9;
12824
12663
  if (isfirstRender.current) {
@@ -12826,6 +12665,7 @@ const PropertySearchNSummary = ({
12826
12665
  return;
12827
12666
  }
12828
12667
  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);
12829
12669
  setPropertyDetails({});
12830
12670
  setShowToast({
12831
12671
  error: true,
@@ -12840,6 +12680,7 @@ const PropertySearchNSummary = ({
12840
12680
  useEffect(() => {
12841
12681
  var _propertyDetails$Prop;
12842
12682
  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);
12843
12684
  setShowToast({
12844
12685
  error: true,
12845
12686
  label: "PT_ENTER_VALID_PROPERTY_ID"
@@ -12879,8 +12720,6 @@ const PropertySearchNSummary = ({
12879
12720
  setPropertyId(e.target.value);
12880
12721
  setValue(e.target.value, propertyIdInput.name);
12881
12722
  setIsSearchClicked(false);
12882
- setNoDue(false);
12883
- setCheckStats(false);
12884
12723
  };
12885
12724
  if (isEditScreen) {
12886
12725
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -12909,6 +12748,9 @@ const PropertySearchNSummary = ({
12909
12748
  [input]: value
12910
12749
  });
12911
12750
  }
12751
+ function getValue(input) {
12752
+ return formData && formData[config.key] ? formData[config.key][input] : undefined;
12753
+ }
12912
12754
  async function fetchBill() {
12913
12755
  try {
12914
12756
  var _formData$cpt0, _result$Bill;
@@ -12926,10 +12768,8 @@ const PropertySearchNSummary = ({
12926
12768
  } else {
12927
12769
  setShowToast({
12928
12770
  error: false,
12929
- label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12771
+ label: t("NDC_MESSAGE_NO_DUES_FOUND")
12930
12772
  });
12931
- setNoDue(true);
12932
- setCheckStats(false);
12933
12773
  }
12934
12774
  setPropertyDues({
12935
12775
  dues: result === null || result === void 0 ? void 0 : result.Bill[0]
@@ -12937,27 +12777,23 @@ const PropertySearchNSummary = ({
12937
12777
  } else if (result !== null && result !== void 0 && result.Bill) {
12938
12778
  setShowToast({
12939
12779
  error: false,
12940
- label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12780
+ label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12941
12781
  });
12942
12782
  setPropertyDues({
12943
12783
  dues: {
12944
12784
  totalAmount: 0
12945
12785
  }
12946
12786
  });
12947
- setNoDue(true);
12948
- setCheckStats(false);
12949
12787
  } else {
12950
12788
  setShowToast({
12951
12789
  error: false,
12952
- label: t("NDC_NO_BILLS_FOUND_PROPERTY")
12790
+ label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
12953
12791
  });
12954
12792
  setPropertyDues({
12955
12793
  dues: {
12956
12794
  totalAmount: 0
12957
12795
  }
12958
12796
  });
12959
- setNoDue(true);
12960
- setCheckStats(false);
12961
12797
  }
12962
12798
  } catch (error) {
12963
12799
  setShowToast({
@@ -12973,20 +12809,12 @@ const PropertySearchNSummary = ({
12973
12809
  window.open(payUrl, "_blank");
12974
12810
  setPropertyDues({});
12975
12811
  }
12976
- useEffect(() => {
12977
- if (showToast) {
12978
- const timer = setTimeout(() => {
12979
- setShowToast(null);
12980
- }, 3000);
12981
- return () => clearTimeout(timer);
12982
- }
12983
- }, [showToast]);
12984
12812
  return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading && /*#__PURE__*/React.createElement(Loader, null), /*#__PURE__*/React.createElement("div", {
12985
12813
  style: {
12986
12814
  marginBottom: "16px"
12987
12815
  }
12988
12816
  }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
12989
- className: "card-label-smaller ndc_card_labels",
12817
+ className: "card-label-smaller",
12990
12818
  style: getInputStyles()
12991
12819
  }, `${t(propertyIdInput.label)}`, null), /*#__PURE__*/React.createElement("div", {
12992
12820
  className: "field ndc_property_search",
@@ -13001,7 +12829,7 @@ const PropertySearchNSummary = ({
13001
12829
  id: "search-property-field"
13002
12830
  }, /*#__PURE__*/React.createElement(TextInput, Object.assign({
13003
12831
  key: propertyIdInput.name,
13004
- value: propertyId,
12832
+ value: getValue(propertyIdInput.name),
13005
12833
  onChange: handlePropertyChange,
13006
12834
  disable: false,
13007
12835
  maxlength: 16,
@@ -13015,7 +12843,7 @@ const PropertySearchNSummary = ({
13015
12843
  maxWidth: "100px"
13016
12844
  },
13017
12845
  onClick: searchProperty
13018
- }, `${t("PT_SEARCH")}`), !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && _apiDataCheck$2.NdcDetails) && getCheckStatus && /*#__PURE__*/React.createElement("button", {
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", {
13019
12847
  className: "submit-bar",
13020
12848
  type: "button",
13021
12849
  style: {
@@ -13027,7 +12855,7 @@ const PropertySearchNSummary = ({
13027
12855
  onClick: () => {
13028
12856
  fetchBill();
13029
12857
  }
13030
- }, `${t("CHECK_STATUS_PROPERTY")}`), (formData === null || formData === void 0 ? void 0 : (_formData$cpt12 = formData.cpt) === null || _formData$cpt12 === void 0 ? void 0 : _formData$cpt12.id) && (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) > 0 && !isSearchClicked && /*#__PURE__*/React.createElement("button", {
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", {
13031
12859
  className: "submit-bar",
13032
12860
  type: "button",
13033
12861
  style: {
@@ -13038,7 +12866,7 @@ const PropertySearchNSummary = ({
13038
12866
  onClick: () => {
13039
12867
  redirectToPayBill();
13040
12868
  }
13041
- }, `${t("PAY_DUES")}`), getNoDue && /*#__PURE__*/React.createElement("div", {
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", {
13042
12870
  style: {
13043
12871
  color: "green",
13044
12872
  width: "100%",
@@ -13110,7 +12938,6 @@ const SelectNDCDocuments = ({
13110
12938
  formState: formState
13111
12939
  });
13112
12940
  }), error && /*#__PURE__*/React.createElement(Toast, {
13113
- isDleteBtn: true,
13114
12941
  label: error,
13115
12942
  onClose: () => setError(null),
13116
12943
  error: true
@@ -13807,18 +13634,6 @@ const NewNDCStepForm$1 = () => {
13807
13634
  const formState = useSelector(state => state.ndc.NDCForm);
13808
13635
  const step = formState.step;
13809
13636
  const tenantId = Digit.ULBService.getCurrentTenantId();
13810
- const id = window.location.pathname.split("/").pop();
13811
- const {
13812
- isLoading,
13813
- data: applicationDetails
13814
- } = Digit.Hooks.ndc.useSearchEmployeeApplication({
13815
- uuid: id
13816
- }, tenantId);
13817
- useEffect(() => {
13818
- if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
13819
- dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
13820
- }
13821
- }, [applicationDetails]);
13822
13637
  const setStep = updatedStepNumber => {
13823
13638
  dispatch(setNDCStep(updatedStepNumber));
13824
13639
  };
@@ -13973,7 +13788,6 @@ const NewNDCStepFormOne$1 = ({
13973
13788
  };
13974
13789
  function validateStepData(data) {
13975
13790
  var _data$cpt6, _data$cpt6$dues, _data$cpt7, _data$cpt7$dues, _data$dues, _propertyDetails$wate, _propertyDetails$sewe;
13976
- console.log("data", data);
13977
13791
  const missingFields = [];
13978
13792
  const invalidFields = [];
13979
13793
  const cpt = (data === null || data === void 0 ? void 0 : data.cpt) || {};
@@ -14017,7 +13831,7 @@ const NewNDCStepFormOne$1 = ({
14017
13831
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
14018
13832
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
14019
13833
  const nameRegex = /^[A-Za-z\s]+$/;
14020
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
13834
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
14021
13835
  const mobileRegex = /^[6-9]\d{9}$/;
14022
13836
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
14023
13837
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));