@mseva/digit-ui-module-ndc 1.0.35 → 1.0.36

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.
@@ -1309,9 +1309,14 @@ const ApplicationOverview = () => {
1309
1309
  workflow: {}
1310
1310
  };
1311
1311
  const filtData = data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : _data$Licenses[0];
1312
+ let checkAssigne;
1313
+ if (filtData.action == "SENDBACKTOCITIZEN") {
1314
+ var _payloadData$owners, _payloadData$owners$;
1315
+ checkAssigne = [payloadData === null || payloadData === void 0 ? void 0 : (_payloadData$owners = payloadData.owners) === null || _payloadData$owners === void 0 ? void 0 : (_payloadData$owners$ = _payloadData$owners[0]) === null || _payloadData$owners$ === void 0 ? void 0 : _payloadData$owners$.uuid];
1316
+ }
1312
1317
  updatedApplicant.workflow = {
1313
1318
  action: filtData.action,
1314
- assignes: filtData === null || filtData === void 0 ? void 0 : filtData.assignee,
1319
+ assignes: (filtData === null || filtData === void 0 ? void 0 : filtData.assignee) || checkAssigne,
1315
1320
  comment: filtData === null || filtData === void 0 ? void 0 : filtData.comment,
1316
1321
  documents: filtData === null || filtData === void 0 ? void 0 : filtData.wfDocuments
1317
1322
  };
@@ -8865,16 +8870,17 @@ function cleanEscapedString(input) {
8865
8870
  const capitalize = text => text.substr(0, 1).toUpperCase() + text.substr(1);
8866
8871
  const ulbCamel = ulb => ulb.toLowerCase().split(" ").map(capitalize).join(" ");
8867
8872
  const getAcknowledgementData = async (application, tenantInfo, t) => {
8868
- var _application$Applicat, _appData$owners, _appData$NdcDetails, _appData$NdcDetails2, _appData$NdcDetails2$, _appData$NdcDetails3, _appData$NdcDetails3$, _appData$NdcDetails3$2, _appData$additionalDe, _tenantInfo$city;
8873
+ var _application$Applicat, _appData$owners, _appData$NdcDetails, _appData$additionalDe, _tenantInfo$city;
8869
8874
  const appData = (application === null || application === void 0 ? void 0 : (_application$Applicat = application.Applications) === null || _application$Applicat === void 0 ? void 0 : _application$Applicat[0]) || {};
8870
8875
  const owner = (appData === null || appData === void 0 ? void 0 : (_appData$owners = appData.owners) === null || _appData$owners === void 0 ? void 0 : _appData$owners[0]) || {};
8871
8876
  const ndc = (appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails = appData.NdcDetails) === null || _appData$NdcDetails === void 0 ? void 0 : _appData$NdcDetails[0]) || {};
8872
8877
  const add = (ndc === null || ndc === void 0 ? void 0 : ndc.additionalDetails) || {};
8873
8878
  const applicationNumber = (appData === null || appData === void 0 ? void 0 : appData.uuid) || "NA";
8874
- const propertyId = appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails2 = appData.NdcDetails) === null || _appData$NdcDetails2 === void 0 ? void 0 : (_appData$NdcDetails2$ = _appData$NdcDetails2[3]) === null || _appData$NdcDetails2$ === void 0 ? void 0 : _appData$NdcDetails2$.consumerCode;
8879
+ const propertyId = (ndc === null || ndc === void 0 ? void 0 : ndc.consumerCode) || "NA";
8875
8880
  const propertyType = add !== null && add !== void 0 && add.propertyType ? t(add.propertyType) : "NA";
8876
8881
  const applicantName = (owner === null || owner === void 0 ? void 0 : owner.name) || "NA";
8877
- const address = (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$2 = _appData$NdcDetails3$.additionalDetails) === null || _appData$NdcDetails3$2 === void 0 ? void 0 : _appData$NdcDetails3$2.propertyAddress) || (owner === null || owner === void 0 ? void 0 : owner.permanentAddress) || (owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress) || "NA";
8882
+ const address = (owner === null || owner === void 0 ? void 0 : owner.permanentAddress) || (owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress) || "NA";
8883
+ const ulbName = (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (appData === null || appData === void 0 ? void 0 : appData.tenantId) || "NA";
8878
8884
  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";
8879
8885
  const certificateBody = `${t("NDC_MSG_INTRO")}
8880
8886
 
@@ -8882,7 +8888,9 @@ ${t("NDC_MSG_APPLICATION_LABEL")}: ${applicationNumber}
8882
8888
 
8883
8889
  ${t("NDC_MSG_PROPERTY_LABEL")}: ${propertyId} ${t("NDC_MSG_PROPERTY_TYPE_LABEL")} ${propertyType}
8884
8890
 
8885
- ${t("NDC_MSG_APPLICANT_LABEL")}: ${applicantName} ${t("NDC_MSG_FOR_LAND")} ${address} ${t("NDC_MSG_FALLING_CLAUSE_PART1")} ${t("NDC_MSG_FALLING_CLAUSE_PART2")} Municipal Council/ Corporation ${t("NDC_MSG_AFTER_RECOVERY")} ${duesAmount} ${t("NDC_MSG_DUES_LIST")}
8891
+ ${t("NDC_MSG_APPLICANT_LABEL")}: ${applicantName} ${t("NDC_MSG_FOR_LAND")} ${address}
8892
+
8893
+ ${t("NDC_MSG_FALLING_CLAUSE_PART1")} ${t("NDC_MSG_FALLING_CLAUSE_PART2")} ${ulbName} ${t("NDC_MSG_AFTER_RECOVERY")} ${duesAmount} ${t("NDC_MSG_DUES_LIST")}
8886
8894
 
8887
8895
  ${t("NDC_MSG_DECLARATION_TITLE")}
8888
8896
  ${t("NDC_MSG_DECL_A")}
@@ -9118,6 +9126,7 @@ const CitizenApplicationOverview = () => {
9118
9126
  className: "ndc_label"
9119
9127
  }, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai2 = displayData.NdcDetails) === null || _displayData$NdcDetai2 === void 0 ? void 0 : _displayData$NdcDetai2.map((detail, index) => {
9120
9128
  var _detail$dueAmount, _propertyDetailsFetch, _propertyDetailsFetch2, _propertyDetailsFetch3, _propertyDetailsFetch4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18;
9129
+ const isRed = detail.dueAmount > 0;
9121
9130
  return /*#__PURE__*/React.createElement("div", {
9122
9131
  key: index,
9123
9132
  style: {
@@ -9132,10 +9141,17 @@ const CitizenApplicationOverview = () => {
9132
9141
  }), /*#__PURE__*/React.createElement(Row, {
9133
9142
  label: t("NDC_CONSUMER_CODE"),
9134
9143
  text: detail.consumerCode || "N/A"
9135
- }), /*#__PURE__*/React.createElement(Row, {
9144
+ }), /*#__PURE__*/React.createElement("div", {
9145
+ style: {
9146
+ background: isRed ? "red" : "none",
9147
+ color: isRed ? "white" : "black",
9148
+ paddingTop: isRed ? "8px" : "0",
9149
+ paddingLeft: isRed ? "10px" : "0"
9150
+ }
9151
+ }, /*#__PURE__*/React.createElement(Row, {
9136
9152
  label: t("NDC_DUE_AMOUNT"),
9137
9153
  text: ((_detail$dueAmount = detail.dueAmount) === null || _detail$dueAmount === void 0 ? void 0 : _detail$dueAmount.toString()) || "0"
9138
- }), /*#__PURE__*/React.createElement(Row, {
9154
+ })), /*#__PURE__*/React.createElement(Row, {
9139
9155
  label: t("NDC_PROPERTY_TYPE"),
9140
9156
  text: t(detail.propertyType) || detail.propertyType
9141
9157
  }), (detail === null || detail === void 0 ? void 0 : detail.businessService) == "NDC_PROPERTY_TAX" && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Row, {
@@ -9309,7 +9325,7 @@ const SearchFormFieldsComponents = ({
9309
9325
  name: "uuid",
9310
9326
  inputRef: registerRef({})
9311
9327
  })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("CORE_COMMON_PHONE_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
9312
- name: "phoneNumber",
9328
+ name: "mobileNumber",
9313
9329
  inputRef: registerRef({})
9314
9330
  })), /*#__PURE__*/React.createElement("div", {
9315
9331
  className: "search-action-wrapper",
@@ -9614,7 +9630,7 @@ const Inbox = ({
9614
9630
  const onSearchFormReset = setSearchFormValue => {
9615
9631
  setSearchFormValue("sourceRefId", null);
9616
9632
  setSearchFormValue("uuid", null);
9617
- setSearchFormValue("phoneNumber", null);
9633
+ setSearchFormValue("mobileNumber", null);
9618
9634
  dispatch({
9619
9635
  action: "mutateSearchForm",
9620
9636
  data: searchFormDefaultValues
@@ -11714,6 +11730,7 @@ const NewNDCStepForm = () => {
11714
11730
  uuid: id
11715
11731
  }, tenantId);
11716
11732
  useEffect(() => {
11733
+ console.log("applicationDetails", applicationDetails);
11717
11734
  if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
11718
11735
  dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
11719
11736
  }
@@ -11762,8 +11779,10 @@ const NewNDCStepFormOne = ({
11762
11779
  const [showToast, setShowToast] = useState(false);
11763
11780
  const [error, setError] = useState("");
11764
11781
  const user = Digit.UserService.getUser();
11782
+ const id = window.location.pathname.split("/").pop();
11765
11783
  const currentStepData = useSelector(state => state.ndc.NDCForm.formData && state.ndc.NDCForm.formData[config.key] ? state.ndc.NDCForm.formData[config.key] : {});
11766
11784
  const checkFormData = useSelector(state => state.ndc.NDCForm.formData || {});
11785
+ const checkFormDatass = useSelector(state => state.ndc.NDCForm || {});
11767
11786
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
11768
11787
  function goNext(data) {
11769
11788
  var _checkFormData$apiDat, _checkFormData$apiDat2, _checkFormData$apiDat3, _checkFormData$respon, _checkFormData$respon2;
@@ -11776,8 +11795,12 @@ const NewNDCStepFormOne = ({
11776
11795
  }, 3000);
11777
11796
  return;
11778
11797
  }
11779
- if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$apiDat = checkFormData.apiData) !== null && _checkFormData$apiDat !== void 0 && (_checkFormData$apiDat2 = _checkFormData$apiDat.Applications) !== null && _checkFormData$apiDat2 !== void 0 && (_checkFormData$apiDat3 = _checkFormData$apiDat2[0]) !== null && _checkFormData$apiDat3 !== void 0 && _checkFormData$apiDat3.uuid || checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && _checkFormData$respon2.uuid) {
11780
- onGoNext();
11798
+ console.log("checkFormData", checkFormData);
11799
+ const isRealId = id && id.startsWith("NDC-");
11800
+ console.log("isRealId", isRealId);
11801
+ if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$apiDat = checkFormData.apiData) !== null && _checkFormData$apiDat !== void 0 && (_checkFormData$apiDat2 = _checkFormData$apiDat.Applications) !== null && _checkFormData$apiDat2 !== void 0 && (_checkFormData$apiDat3 = _checkFormData$apiDat2[0]) !== null && _checkFormData$apiDat3 !== void 0 && _checkFormData$apiDat3.uuid || checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && _checkFormData$respon2.uuid || isRealId) {
11802
+ updateApplication(data);
11803
+ console.log("here bab");
11781
11804
  } else createApplication(data);
11782
11805
  }
11783
11806
  const createApplication = async data => {
@@ -11869,18 +11892,117 @@ const NewNDCStepFormOne = ({
11869
11892
  };
11870
11893
  }
11871
11894
  };
11895
+ const updateApplication = async data => {
11896
+ var _Digit$UserService$ge2, _user$info5, _user$info6, _data$PropertyDetails1, _user$info7, _user$info8, _checkFormData$respon3, _checkFormData$respon4, _checkFormData$respon5, _data$NDCReason2, _data$cpt1, _data$cpt1$details, _response$ResponseInf2;
11897
+ const applicant = ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.info) || {};
11898
+ const applicantId = applicant === null || applicant === void 0 ? void 0 : applicant.uuid;
11899
+ console.log("data===?????", data);
11900
+ console.log("checkFormData???====", checkFormData);
11901
+ const owners = [{
11902
+ name: user === null || user === void 0 ? void 0 : (_user$info5 = user.info) === null || _user$info5 === void 0 ? void 0 : _user$info5.name,
11903
+ mobileNumber: user === null || user === void 0 ? void 0 : (_user$info6 = user.info) === null || _user$info6 === void 0 ? void 0 : _user$info6.mobileNumber,
11904
+ gender: data === null || data === void 0 ? void 0 : (_data$PropertyDetails1 = data.PropertyDetails) === null || _data$PropertyDetails1 === void 0 ? void 0 : _data$PropertyDetails1.gender,
11905
+ emailId: user === null || user === void 0 ? void 0 : (_user$info7 = user.info) === null || _user$info7 === void 0 ? void 0 : _user$info7.emailId,
11906
+ type: user === null || user === void 0 ? void 0 : (_user$info8 = user.info) === null || _user$info8 === void 0 ? void 0 : _user$info8.type
11907
+ }];
11908
+ let ndcDetails = [];
11909
+ if ((checkFormData === null || checkFormData === void 0 ? void 0 : (_checkFormData$respon3 = checkFormData.responseData) === null || _checkFormData$respon3 === void 0 ? void 0 : (_checkFormData$respon4 = _checkFormData$respon3[0]) === null || _checkFormData$respon4 === void 0 ? void 0 : (_checkFormData$respon5 = _checkFormData$respon4.NdcDetails) === null || _checkFormData$respon5 === void 0 ? void 0 : _checkFormData$respon5.length) > 0) {
11910
+ ndcDetails = checkFormData.responseData[0].NdcDetails;
11911
+ } else {
11912
+ var _ref, _data$PropertyDetails10, _ref2, _data$PropertyDetails12, _data$PropertyDetails14, _data$PropertyDetails15;
11913
+ (_ref = (data === null || data === void 0 ? void 0 : (_data$PropertyDetails10 = data.PropertyDetails) === null || _data$PropertyDetails10 === void 0 ? void 0 : _data$PropertyDetails10.waterConnection) || []) === null || _ref === void 0 ? void 0 : _ref.forEach(wc => {
11914
+ var _wc$billData4, _data$PropertyDetails11, _data$cpt7, _data$cpt7$details, _wc$billData5, _wc$billData6;
11915
+ ndcDetails.push({
11916
+ uuid: wc === null || wc === void 0 ? void 0 : (_wc$billData4 = wc.billData) === null || _wc$billData4 === void 0 ? void 0 : _wc$billData4.id,
11917
+ applicantId: applicantId,
11918
+ businessService: "WS",
11919
+ consumerCode: wc === null || wc === void 0 ? void 0 : wc.connectionNo,
11920
+ additionalDetails: {
11921
+ propertyAddress: data === null || data === void 0 ? void 0 : (_data$PropertyDetails11 = data.PropertyDetails) === null || _data$PropertyDetails11 === void 0 ? void 0 : _data$PropertyDetails11.address,
11922
+ propertyType: data === null || data === void 0 ? void 0 : (_data$cpt7 = data.cpt) === null || _data$cpt7 === void 0 ? void 0 : (_data$cpt7$details = _data$cpt7.details) === null || _data$cpt7$details === void 0 ? void 0 : _data$cpt7$details.usageCategory
11923
+ },
11924
+ dueAmount: (wc === null || wc === void 0 ? void 0 : (_wc$billData5 = wc.billData) === null || _wc$billData5 === void 0 ? void 0 : _wc$billData5.totalAmount) || 0,
11925
+ status: wc === null || wc === void 0 ? void 0 : (_wc$billData6 = wc.billData) === null || _wc$billData6 === void 0 ? void 0 : _wc$billData6.status
11926
+ });
11927
+ });
11928
+ (_ref2 = (data === null || data === void 0 ? void 0 : (_data$PropertyDetails12 = data.PropertyDetails) === null || _data$PropertyDetails12 === void 0 ? void 0 : _data$PropertyDetails12.sewerageConnection) || []) === null || _ref2 === void 0 ? void 0 : _ref2.forEach(sc => {
11929
+ var _sc$billData4, _data$PropertyDetails13, _data$cpt8, _data$cpt8$details, _sc$billData5, _sc$billData6;
11930
+ ndcDetails.push({
11931
+ uuid: sc === null || sc === void 0 ? void 0 : (_sc$billData4 = sc.billData) === null || _sc$billData4 === void 0 ? void 0 : _sc$billData4.id,
11932
+ applicantId: applicantId,
11933
+ businessService: "SW",
11934
+ consumerCode: sc === null || sc === void 0 ? void 0 : sc.connectionNo,
11935
+ additionalDetails: {
11936
+ propertyAddress: data === null || data === void 0 ? void 0 : (_data$PropertyDetails13 = data.PropertyDetails) === null || _data$PropertyDetails13 === void 0 ? void 0 : _data$PropertyDetails13.address,
11937
+ propertyType: data === null || data === void 0 ? void 0 : (_data$cpt8 = data.cpt) === null || _data$cpt8 === void 0 ? void 0 : (_data$cpt8$details = _data$cpt8.details) === null || _data$cpt8$details === void 0 ? void 0 : _data$cpt8$details.usageCategory
11938
+ },
11939
+ dueAmount: (sc === null || sc === void 0 ? void 0 : (_sc$billData5 = sc.billData) === null || _sc$billData5 === void 0 ? void 0 : _sc$billData5.totalAmount) || 0,
11940
+ status: sc === null || sc === void 0 ? void 0 : (_sc$billData6 = sc.billData) === null || _sc$billData6 === void 0 ? void 0 : _sc$billData6.status
11941
+ });
11942
+ });
11943
+ if (data !== null && data !== void 0 && (_data$PropertyDetails14 = data.PropertyDetails) !== null && _data$PropertyDetails14 !== void 0 && (_data$PropertyDetails15 = _data$PropertyDetails14.propertyBillData) !== null && _data$PropertyDetails15 !== void 0 && _data$PropertyDetails15.billData) {
11944
+ var _data$PropertyDetails16, _data$PropertyDetails17, _data$cpt9, _data$PropertyDetails18, _data$cpt0, _data$cpt0$details;
11945
+ const billData = data === null || data === void 0 ? void 0 : (_data$PropertyDetails16 = data.PropertyDetails) === null || _data$PropertyDetails16 === void 0 ? void 0 : (_data$PropertyDetails17 = _data$PropertyDetails16.propertyBillData) === null || _data$PropertyDetails17 === void 0 ? void 0 : _data$PropertyDetails17.billData;
11946
+ ndcDetails.push({
11947
+ uuid: billData === null || billData === void 0 ? void 0 : billData.id,
11948
+ applicantId: applicantId,
11949
+ businessService: "PT",
11950
+ consumerCode: data === null || data === void 0 ? void 0 : (_data$cpt9 = data.cpt) === null || _data$cpt9 === void 0 ? void 0 : _data$cpt9.id,
11951
+ additionalDetails: {
11952
+ propertyAddress: data === null || data === void 0 ? void 0 : (_data$PropertyDetails18 = data.PropertyDetails) === null || _data$PropertyDetails18 === void 0 ? void 0 : _data$PropertyDetails18.address,
11953
+ propertyType: data === null || data === void 0 ? void 0 : (_data$cpt0 = data.cpt) === null || _data$cpt0 === void 0 ? void 0 : (_data$cpt0$details = _data$cpt0.details) === null || _data$cpt0$details === void 0 ? void 0 : _data$cpt0$details.usageCategory
11954
+ },
11955
+ dueAmount: (billData === null || billData === void 0 ? void 0 : billData.totalAmount) || 0,
11956
+ status: billData === null || billData === void 0 ? void 0 : billData.status
11957
+ });
11958
+ }
11959
+ }
11960
+ const payload = {
11961
+ Applications: [{
11962
+ tenantId,
11963
+ owners,
11964
+ NdcDetails: ndcDetails,
11965
+ Documents: [],
11966
+ active: true,
11967
+ reason: data === null || data === void 0 ? void 0 : (_data$NDCReason2 = data.NDCReason) === null || _data$NDCReason2 === void 0 ? void 0 : _data$NDCReason2.code,
11968
+ auditDetails: data === null || data === void 0 ? void 0 : (_data$cpt1 = data.cpt) === null || _data$cpt1 === void 0 ? void 0 : (_data$cpt1$details = _data$cpt1.details) === null || _data$cpt1$details === void 0 ? void 0 : _data$cpt1$details.auditDetails,
11969
+ uuid: id,
11970
+ workflow: {
11971
+ action: "DRAFT"
11972
+ }
11973
+ }]
11974
+ };
11975
+ console.log("payload", payload);
11976
+ const response = await Digit.NDCService.NDCUpdate({
11977
+ tenantId,
11978
+ details: payload
11979
+ });
11980
+ if ((response === null || response === void 0 ? void 0 : (_response$ResponseInf2 = response.ResponseInfo) === null || _response$ResponseInf2 === void 0 ? void 0 : _response$ResponseInf2.status) === "successful") {
11981
+ dispatch(updateNDCForm("apiData", response));
11982
+ onGoNext();
11983
+ return {
11984
+ isSuccess: true,
11985
+ response
11986
+ };
11987
+ } else {
11988
+ return {
11989
+ isSuccess: false,
11990
+ response
11991
+ };
11992
+ }
11993
+ };
11872
11994
  function validateStepData(data) {
11873
- var _data$cpt6, _data$cpt7, _data$cpt7$dues, _propertyDetails$wate, _propertyDetails$sewe;
11995
+ var _data$cpt10, _data$cpt11, _data$cpt11$dues, _propertyDetails$wate, _propertyDetails$sewe;
11874
11996
  const missingFields = [];
11875
11997
  const invalidFields = [];
11876
11998
  const cpt = (data === null || data === void 0 ? void 0 : data.cpt) || {};
11877
11999
  const cptDetails = (cpt === null || cpt === void 0 ? void 0 : cpt.details) || {};
11878
12000
  const propertyDetails = (data === null || data === void 0 ? void 0 : data.PropertyDetails) || {};
11879
12001
  const NDCReason = (data === null || data === void 0 ? void 0 : data.NDCReason) || {};
11880
- if (!(data !== null && data !== void 0 && (_data$cpt6 = data.cpt) !== null && _data$cpt6 !== void 0 && _data$cpt6.dues)) {
12002
+ if (!(data !== null && data !== void 0 && (_data$cpt10 = data.cpt) !== null && _data$cpt10 !== void 0 && _data$cpt10.dues)) {
11881
12003
  missingFields.push(`${t("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
11882
12004
  }
11883
- if ((data === null || data === void 0 ? void 0 : (_data$cpt7 = data.cpt) === null || _data$cpt7 === void 0 ? void 0 : (_data$cpt7$dues = _data$cpt7.dues) === null || _data$cpt7$dues === void 0 ? void 0 : _data$cpt7$dues.totalAmount) > 0) {
12005
+ if ((data === null || data === void 0 ? void 0 : (_data$cpt11 = data.cpt) === null || _data$cpt11 === void 0 ? void 0 : (_data$cpt11$dues = _data$cpt11.dues) === null || _data$cpt11$dues === void 0 ? void 0 : _data$cpt11$dues.totalAmount) > 0) {
11884
12006
  missingFields.push(`${t("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")} ${cpt === null || cpt === void 0 ? void 0 : cpt.id}`);
11885
12007
  }
11886
12008
  if ((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.length) > 0) {
@@ -12149,8 +12271,8 @@ const PropertyDetailsForm$1 = ({
12149
12271
  var _apiDataCheck$2;
12150
12272
  let waterConnection;
12151
12273
  if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && _apiDataCheck$2.NdcDetails) {
12152
- var _apiDataCheck$3;
12153
- const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : _apiDataCheck$3.NdcDetails.filter(item => {
12274
+ var _apiDataCheck$3, _apiDataCheck$3$NdcDe;
12275
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$NdcDe = _apiDataCheck$3.NdcDetails) === null || _apiDataCheck$3$NdcDe === void 0 ? void 0 : _apiDataCheck$3$NdcDe.filter(item => {
12154
12276
  return item.businessService == "WS";
12155
12277
  });
12156
12278
  waterConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
@@ -12177,9 +12299,10 @@ const PropertyDetailsForm$1 = ({
12177
12299
  useEffect(() => {
12178
12300
  var _apiDataCheck$4;
12179
12301
  let sewerageConnection;
12302
+ console.log("apiDataCheck", apiDataCheck);
12180
12303
  if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$4 = apiDataCheck[0]) !== null && _apiDataCheck$4 !== void 0 && _apiDataCheck$4.NdcDetails) {
12181
- var _apiDataCheck$5;
12182
- const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : _apiDataCheck$5.NdcDetails.filter(item => {
12304
+ var _apiDataCheck$5, _apiDataCheck$5$NdcDe;
12305
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$NdcDe = _apiDataCheck$5.NdcDetails) === null || _apiDataCheck$5$NdcDe === void 0 ? void 0 : _apiDataCheck$5$NdcDe.filter(item => {
12183
12306
  return item.businessService == "SW";
12184
12307
  });
12185
12308
  sewerageConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
@@ -13205,11 +13328,13 @@ const SelectNDCDocuments = ({
13205
13328
  const [error, setError] = useState(null);
13206
13329
  useEffect(() => {
13207
13330
  var _checkFormData$respon, _checkFormData$respon2, _checkFormData$respon3;
13208
- if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && (_checkFormData$respon3 = _checkFormData$respon2.Documents) !== null && _checkFormData$respon3 !== void 0 && _checkFormData$respon3.length) {
13209
- const apiDocs = checkFormData.responseData[0].Documents.map(doc => ({
13210
- documentType: doc.documentType,
13211
- fileStoreId: doc.documentAttachment,
13212
- documentUid: doc.documentAttachment
13331
+ console.log("coming here again");
13332
+ if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && (_checkFormData$respon3 = _checkFormData$respon2.Documents) !== null && _checkFormData$respon3 !== void 0 && _checkFormData$respon3.length && documents.length === 0) {
13333
+ var _checkFormData$respon4, _checkFormData$respon5, _checkFormData$respon6;
13334
+ const apiDocs = checkFormData === null || checkFormData === void 0 ? void 0 : (_checkFormData$respon4 = checkFormData.responseData) === null || _checkFormData$respon4 === void 0 ? void 0 : (_checkFormData$respon5 = _checkFormData$respon4[0]) === null || _checkFormData$respon5 === void 0 ? void 0 : (_checkFormData$respon6 = _checkFormData$respon5.Documents) === null || _checkFormData$respon6 === void 0 ? void 0 : _checkFormData$respon6.map(doc => ({
13335
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
13336
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.documentAttachment,
13337
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentAttachment
13213
13338
  }));
13214
13339
  setDocuments(apiDocs);
13215
13340
  }
@@ -13278,7 +13403,7 @@ function SelectDocument({
13278
13403
  setFile(e.target.files[0]);
13279
13404
  }
13280
13405
  useEffect(() => {
13281
- if (filteredDocument !== null && filteredDocument !== void 0 && filteredDocument.fileStoreId) {
13406
+ if (filteredDocument !== null && filteredDocument !== void 0 && filteredDocument.fileStoreId && !file) {
13282
13407
  setUploadedFile(filteredDocument.fileStoreId);
13283
13408
  }
13284
13409
  }, [filteredDocument]);
@@ -13360,10 +13485,26 @@ const NewNDCStepFormTwo = ({
13360
13485
  const stateId = Digit.ULBService.getStateId();
13361
13486
  const [showToast, setShowToast] = useState(false);
13362
13487
  const [error, setError] = useState("");
13488
+ const tenantId = window.localStorage.getItem("CITIZEN.CITY");
13363
13489
  const {
13364
13490
  isLoading,
13365
13491
  data
13366
13492
  } = Digit.Hooks.pt.usePropertyMDMS(stateId, "NDC", ["Documents"]);
13493
+ const checkFormData = useSelector(state => state.ndc.NDCForm.formData || {});
13494
+ const id = window.location.pathname.split("/").pop();
13495
+ const user = Digit.UserService.getUser();
13496
+ const {
13497
+ isLoading: propertyLoading,
13498
+ data: applicationDetails,
13499
+ refetch
13500
+ } = Digit.Hooks.ndc.useSearchEmployeeApplication({
13501
+ uuid: id
13502
+ }, tenantId);
13503
+ useEffect(() => {
13504
+ if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
13505
+ dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
13506
+ }
13507
+ }, [applicationDetails]);
13367
13508
  function goNext(finaldata) {
13368
13509
  console.log(`Data in step ${config.currStepNumber} is: \n`, finaldata);
13369
13510
  const missingFields = validation(finaldata);
@@ -13375,8 +13516,68 @@ const NewNDCStepFormTwo = ({
13375
13516
  }, 3000);
13376
13517
  return;
13377
13518
  }
13378
- onGoNext();
13519
+ const isRealId = id && id.startsWith("NDC-");
13520
+ console.log("here", isRealId);
13521
+ if (isRealId) {
13522
+ console.log("here bab");
13523
+ updateApplication(finaldata);
13524
+ } else {
13525
+ console.log("go next");
13526
+ onGoNext();
13527
+ }
13379
13528
  }
13529
+ const updateApplication = async data => {
13530
+ var _Digit$UserService$ge, _user$info, _user$info2, _checkFormData$NDCDet, _checkFormData$NDCDet2, _user$info3, _user$info4, _checkFormData$respon, _ref, _data$documents, _response$ResponseInf;
13531
+ const applicant = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
13532
+ console.log("final data===?????", data);
13533
+ console.log("checkFormData???====", checkFormData);
13534
+ const owners = [{
13535
+ name: user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name,
13536
+ mobileNumber: user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.mobileNumber,
13537
+ gender: checkFormData === null || checkFormData === void 0 ? void 0 : (_checkFormData$NDCDet = checkFormData.NDCDetails) === null || _checkFormData$NDCDet === void 0 ? void 0 : (_checkFormData$NDCDet2 = _checkFormData$NDCDet.PropertyDetails) === null || _checkFormData$NDCDet2 === void 0 ? void 0 : _checkFormData$NDCDet2.gender,
13538
+ emailId: user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.emailId,
13539
+ type: user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.type
13540
+ }];
13541
+ const baseApplication = (checkFormData === null || checkFormData === void 0 ? void 0 : (_checkFormData$respon = checkFormData.responseData) === null || _checkFormData$respon === void 0 ? void 0 : _checkFormData$respon[0]) || {};
13542
+ const updatedApplication = {
13543
+ ...baseApplication,
13544
+ workflow: {
13545
+ ...(baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.workflow)
13546
+ },
13547
+ owners: owners,
13548
+ NdcDetails: baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.NdcDetails,
13549
+ Documents: []
13550
+ };
13551
+ (_ref = (data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : _data$documents.documents) || []) === null || _ref === void 0 ? void 0 : _ref.forEach(doc => {
13552
+ var _updatedApplication$D;
13553
+ (_updatedApplication$D = updatedApplication.Documents) === null || _updatedApplication$D === void 0 ? void 0 : _updatedApplication$D.push({
13554
+ uuid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
13555
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
13556
+ documentAttachment: doc === null || doc === void 0 ? void 0 : doc.fileStoreId
13557
+ });
13558
+ });
13559
+ const payload = {
13560
+ Applications: [updatedApplication]
13561
+ };
13562
+ console.log("payload", payload);
13563
+ const response = await Digit.NDCService.NDCUpdate({
13564
+ tenantId,
13565
+ details: payload
13566
+ });
13567
+ if ((response === null || response === void 0 ? void 0 : (_response$ResponseInf = response.ResponseInfo) === null || _response$ResponseInf === void 0 ? void 0 : _response$ResponseInf.status) === "successful") {
13568
+ dispatch(updateNDCForm("apiData", response));
13569
+ onGoNext();
13570
+ return {
13571
+ isSuccess: true,
13572
+ response
13573
+ };
13574
+ } else {
13575
+ return {
13576
+ isSuccess: false,
13577
+ response
13578
+ };
13579
+ }
13580
+ };
13380
13581
  const closeToast = () => {
13381
13582
  setShowToast(false);
13382
13583
  setError("");