@djb25/digit-ui-module-ws 1.0.107 → 1.0.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13253,7 +13253,7 @@ const WSConnectionDetails = _ref => {
13253
13253
  if ((formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD2 = formData.ConnectionDetails) === null || _formData$ConnectionD2 === void 0 ? void 0 : _formData$ConnectionD2.length) > 0) {
13254
13254
  const incoming = formData.ConnectionDetails[0];
13255
13255
  const current = connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails[0];
13256
- if (!(current !== null && current !== void 0 && current.addressType) && incoming !== null && incoming !== void 0 && incoming.addressType || !(current !== null && current !== void 0 && current.completeAddress) && incoming !== null && incoming !== void 0 && incoming.completeAddress || !lodash.isEqual(current, incoming)) {
13256
+ if (!lodash.isEqual(current, incoming)) {
13257
13257
  setConnectionDetails([incoming]);
13258
13258
  }
13259
13259
  }
@@ -13326,9 +13326,6 @@ const WSConnectionDetails = _ref => {
13326
13326
  }, [commonMastersData]);
13327
13327
  React.useEffect(() => {
13328
13328
  var _connectionDetails$, _connectionDetails$2;
13329
- if (userType === "employee") {
13330
- onSelect(config.key, connectionDetails);
13331
- }
13332
13329
  if (connectionDetails !== null && connectionDetails !== void 0 && (_connectionDetails$ = connectionDetails[0]) !== null && _connectionDetails$ !== void 0 && _connectionDetails$.water) setWaterSewarageSelection({
13333
13330
  water: true,
13334
13331
  sewerage: false
@@ -13339,7 +13336,7 @@ const WSConnectionDetails = _ref => {
13339
13336
  });
13340
13337
  }, [connectionDetails]);
13341
13338
  React.useEffect(() => {
13342
- if (!(formData !== null && formData !== void 0 && formData.ConnectionDetails)) {
13339
+ if (!(formData !== null && formData !== void 0 && formData.ConnectionDetails) && (connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails.length) === 0) {
13343
13340
  setConnectionDetails([createConnectionDetails()]);
13344
13341
  }
13345
13342
  }, [formData === null || formData === void 0 ? void 0 : formData.ConnectionDetails]);
@@ -13895,8 +13892,10 @@ const WSRoadCuttingDetails = _ref => {
13895
13892
  })) : setRoadCuttingDetails(prev => prev.filter(o => o.key != roadCutt.key));
13896
13893
  };
13897
13894
  React.useEffect(() => {
13898
- onSelect(config === null || config === void 0 ? void 0 : config.key, roadCuttingDetails);
13899
- }, [roadCuttingDetails]);
13895
+ if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], roadCuttingDetails)) {
13896
+ onSelect(config === null || config === void 0 ? void 0 : config.key, roadCuttingDetails);
13897
+ }
13898
+ }, [roadCuttingDetails, config === null || config === void 0 ? void 0 : config.key]);
13900
13899
  const commonProps = {
13901
13900
  focusIndex,
13902
13901
  allRoadCuttingDetails: roadCuttingDetails,
@@ -14318,18 +14317,11 @@ const WSConnectionHolderDetails = _ref => {
14318
14317
  const data = connectionHolderDetails.map(e => {
14319
14318
  return e;
14320
14319
  });
14321
- onSelect(config === null || config === void 0 ? void 0 : config.key, data);
14322
- }
14323
- }, [connectionHolderDetails]);
14324
- React.useEffect(() => {
14325
- if (userType === "employee") {
14326
- var _formData$config$key;
14327
- onSelect(config.key, [{
14328
- ...((_formData$config$key = formData[config.key]) === null || _formData$config$key === void 0 ? void 0 : _formData$config$key[0]),
14329
- ...(connectionHolderDetails === null || connectionHolderDetails === void 0 ? void 0 : connectionHolderDetails[0])
14330
- }]);
14320
+ if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], data)) {
14321
+ onSelect(config === null || config === void 0 ? void 0 : config.key, data);
14322
+ }
14331
14323
  }
14332
- }, [connectionHolderDetails]);
14324
+ }, [connectionHolderDetails, config === null || config === void 0 ? void 0 : config.key]);
14333
14325
  function ispagereloadingenabled(eyeclick) {
14334
14326
  var _Object$values, _formData$ConnectionH2;
14335
14327
  if ((window.location.href.includes("edit") || window.location.href.includes("modify")) && formData !== null && formData !== void 0 && formData.ConnectionHolderDetails && ((_Object$values = Object.values(formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH2 = formData.ConnectionHolderDetails) === null || _formData$ConnectionH2 === void 0 ? void 0 : _formData$ConnectionH2[0])) === null || _Object$values === void 0 ? void 0 : _Object$values.length) > 1) {
@@ -16463,8 +16455,10 @@ const WSActivationPlumberDetails = _ref => {
16463
16455
  const data = plumberDetails.length && plumberDetails.map(e => {
16464
16456
  return e;
16465
16457
  });
16466
- onSelect(config === null || config === void 0 ? void 0 : config.key, data);
16467
- }, [plumberDetails, formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : _formData$connectionD2.connectionType]);
16458
+ if (data && !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], data)) {
16459
+ onSelect(config === null || config === void 0 ? void 0 : config.key, data);
16460
+ }
16461
+ }, [plumberDetails, formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : _formData$connectionD2.connectionType, config === null || config === void 0 ? void 0 : config.key]);
16468
16462
  const commonProps = {
16469
16463
  focusIndex,
16470
16464
  allOwners: plumberDetails,
@@ -18914,9 +18908,12 @@ const WSDocumentsEmployee = _ref => {
18914
18908
  };
18915
18909
  onSelect(config.key, documentStep);
18916
18910
  } else {
18917
- onSelect(config.key, {
18911
+ const docPayload = {
18918
18912
  documents: removeDuplicateOtherDocuments(documents)
18919
- });
18913
+ };
18914
+ if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config.key], docPayload)) {
18915
+ onSelect(config.key, docPayload);
18916
+ }
18920
18917
  }
18921
18918
  };
18922
18919
  const downloadDocument = function () {
@@ -25857,7 +25854,7 @@ const WSDjbEmployee = _ref => {
25857
25854
  };
25858
25855
 
25859
25856
  const WSDivyangjan = _ref => {
25860
- var _formData$disability, _formData$additionalD;
25857
+ var _formData$disability, _formData$additionalD, _formData$config$key2;
25861
25858
  let {
25862
25859
  config,
25863
25860
  onSelect,
@@ -25886,11 +25883,16 @@ const WSDivyangjan = _ref => {
25886
25883
  }, [onSelect]);
25887
25884
  React.useEffect(() => {
25888
25885
  if (userType === "employee") {
25889
- onSelectRef.current(config.key, {
25890
- isDivyangjan: !!formValue.isDivyangjan
25891
- });
25886
+ var _formData$config$key;
25887
+ const currentVal = formData === null || formData === void 0 ? void 0 : (_formData$config$key = formData[config.key]) === null || _formData$config$key === void 0 ? void 0 : _formData$config$key.isDivyangjan;
25888
+ const newVal = !!formValue.isDivyangjan;
25889
+ if (currentVal !== newVal) {
25890
+ onSelectRef.current(config.key, {
25891
+ isDivyangjan: newVal
25892
+ });
25893
+ }
25892
25894
  }
25893
- }, [config.key, formValue.isDivyangjan, userType]);
25895
+ }, [config.key, formValue.isDivyangjan, userType, formData === null || formData === void 0 ? void 0 : (_formData$config$key2 = formData[config.key]) === null || _formData$config$key2 === void 0 ? void 0 : _formData$config$key2.isDivyangjan]);
25894
25896
  const content = /*#__PURE__*/React__default.createElement(digitUiReactComponents.CollapsibleCardPage, {
25895
25897
  title: t("Are you a Divyangjan/Person with Disability?"),
25896
25898
  defaultOpen: true
@@ -29494,11 +29496,7 @@ const WSCard = () => {
29494
29496
  setTotalCount(waterCount);
29495
29497
  }
29496
29498
  }, [wsData]);
29497
- let links = [{
29498
- label: t("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),
29499
- link: `/digit-ui/employee/ws/info`,
29500
- roles: ["WS_CEMP", "SW_CEMP"]
29501
- }];
29499
+ let links = [];
29502
29500
  links = links.filter(link => link.roles ? checkForEmployee(link.roles) : true);
29503
29501
  const propsForModuleCard = {
29504
29502
  Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.WSICon, null),
@@ -29516,43 +29514,43 @@ const WSCard = () => {
29516
29514
  count: isWSInboxLoading ? "-" : wsData === null || wsData === void 0 ? void 0 : wsData.totalCount,
29517
29515
  label: t("WATER_INBOX"),
29518
29516
  link: `/digit-ui/employee/ws/water/inbox`,
29519
- roles: ["WS_CEMP", "WS_APPROVER", "EE", "WS_DEALING_CLERK", "WS_CLERK"]
29517
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29520
29518
  }, {
29521
29519
  label: t("WS_BILL_AMENDMENT_INBOX", "Bill Amendment Inbox"),
29522
29520
  link: `/digit-ui/employee/ws/water/bill-amendment/inbox`,
29523
- roles: ["WS_CEMP", "WS_APPROVER", "EE", "WS_DEALING_CLERK", "WS_CLERK", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER"]
29521
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29524
29522
  }, {
29525
29523
  label: t("WS_BILL_AMENDMENT_APPLICATION_SEARCH", "Search Bill Amendment Application"),
29526
29524
  link: `/digit-ui/employee/ws/water/bill-amendment/search-application`,
29527
- roles: ["WS_CEMP", "WS_APPROVER", "EE", "WS_DEALING_CLERK", "WS_CLERK", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER"]
29525
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29528
29526
  }, ...links, {
29529
29527
  label: t("WS_WATER_CONNECTION_SEARCH_LABEL"),
29530
29528
  link: `/digit-ui/employee/ws/water/search-connection`,
29531
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
29529
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29532
29530
  }, {
29533
29531
  label: t("WS_WATER_APPLICATION_SEARCH"),
29534
29532
  link: `/digit-ui/employee/ws/water/search-application`,
29535
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
29533
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29536
29534
  }, {
29537
29535
  label: t("WS_CALCULATION"),
29538
29536
  link: `/digit-ui/employee/ws/water/calculation`,
29539
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
29537
+ roles: ["WS_CEMP", "WS_ZRO"]
29540
29538
  }, {
29541
29539
  label: t("WS_APPLY_MUTATION"),
29542
29540
  link: `/digit-ui/employee/ws/mutation-application`,
29543
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK", "SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"]
29541
+ roles: []
29544
29542
  }, {
29545
29543
  label: t("WS_ZRO_VERIFICATION"),
29546
29544
  link: `/digit-ui/employee/ws/zro-application`,
29547
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK", "SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"]
29545
+ roles: ["WS_CEMP", "WS_ZRO"]
29548
29546
  }, {
29549
29547
  label: t("WS_DISCONNECTION"),
29550
29548
  link: `/digit-ui/employee/ws/new-disconnection`,
29551
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK", "SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"]
29549
+ roles: []
29552
29550
  }, {
29553
29551
  label: t("WS_RECONNECTION"),
29554
29552
  link: `/digit-ui/employee/ws/new-restoration`,
29555
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK", "SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"]
29553
+ roles: []
29556
29554
  }].filter(link => link.roles ? checkForEmployee(link.roles) : true)
29557
29555
  };
29558
29556
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
@@ -29601,11 +29599,7 @@ const SWCard = () => {
29601
29599
  setTotalCount(sewerageCount);
29602
29600
  }
29603
29601
  }, [swData]);
29604
- let links = [{
29605
- label: t("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),
29606
- link: `/digit-ui/employee/ws/create-application`,
29607
- roles: ["WS_CEMP", "SW_CEMP"]
29608
- }];
29602
+ let links = [];
29609
29603
  links = links.filter(link => link.roles ? checkForEmployee(link.roles) : true);
29610
29604
  const propsForModuleCard = {
29611
29605
  Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.WSICon, null),
@@ -36976,10 +36970,122 @@ const ConsumptionDetails = _ref => {
36976
36970
  });
36977
36971
  };
36978
36972
  const consumption = (currentReading, lastReading) => {
36979
- if (currentReading && lastReading) {
36973
+ if (currentReading !== null && currentReading !== undefined && lastReading !== null && lastReading !== undefined && currentReading !== "" && lastReading !== "") {
36980
36974
  return Number(currentReading - lastReading);
36981
36975
  } else return t("NA");
36982
36976
  };
36977
+ const columns = React.useMemo(() => [{
36978
+ Header: t("WS_MYCONNECTIONS_CONSUMER_NO"),
36979
+ accessor: "connectionNo",
36980
+ disableSortBy: true,
36981
+ Cell: _ref2 => {
36982
+ var _row$original;
36983
+ let {
36984
+ row
36985
+ } = _ref2;
36986
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.connectionNo) || t("NA"));
36987
+ }
36988
+ }, {
36989
+ Header: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
36990
+ accessor: "billingPeriod",
36991
+ disableSortBy: true,
36992
+ Cell: _ref3 => {
36993
+ var _row$original2;
36994
+ let {
36995
+ row
36996
+ } = _ref3;
36997
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.billingPeriod) || t("NA"));
36998
+ }
36999
+ }, {
37000
+ Header: t("WS_READING_QUALITY_CODE"),
37001
+ accessor: "readingQualityCode",
37002
+ disableSortBy: true,
37003
+ Cell: _ref4 => {
37004
+ var _row$original3;
37005
+ let {
37006
+ row
37007
+ } = _ref4;
37008
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.readingQualityCode) || t("NA"));
37009
+ }
37010
+ }, {
37011
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
37012
+ accessor: "lastReading",
37013
+ disableSortBy: true,
37014
+ Cell: _ref5 => {
37015
+ var _row$original4, _row$original5, _row$original6;
37016
+ let {
37017
+ row
37018
+ } = _ref5;
37019
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.lastReading) !== undefined && ((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.lastReading) !== null ? (_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.lastReading : t("NA"));
37020
+ }
37021
+ }, {
37022
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
37023
+ accessor: "lastReadingDate",
37024
+ disableSortBy: true,
37025
+ Cell: _ref6 => {
37026
+ var _row$original7, _row$original8;
37027
+ let {
37028
+ row
37029
+ } = _ref6;
37030
+ return /*#__PURE__*/React__default.createElement("span", null, (_row$original7 = row.original) !== null && _row$original7 !== void 0 && _row$original7.lastReadingDate ? Digit.DateUtils.ConvertEpochToDate((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.lastReadingDate) : t("NA"));
37031
+ }
37032
+ }, {
37033
+ Header: t("WS_SERV_DETAIL_CUR_METER_READ"),
37034
+ accessor: "currentReading",
37035
+ disableSortBy: true,
37036
+ Cell: _ref7 => {
37037
+ var _row$original9, _row$original0, _row$original1;
37038
+ let {
37039
+ row
37040
+ } = _ref7;
37041
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.currentReading) !== undefined && ((_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.currentReading) !== null ? (_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.currentReading : t("NA"));
37042
+ }
37043
+ }, {
37044
+ Header: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
37045
+ accessor: "currentReadingDate",
37046
+ disableSortBy: true,
37047
+ Cell: _ref8 => {
37048
+ var _row$original10, _row$original11;
37049
+ let {
37050
+ row
37051
+ } = _ref8;
37052
+ return /*#__PURE__*/React__default.createElement("span", null, (_row$original10 = row.original) !== null && _row$original10 !== void 0 && _row$original10.currentReadingDate ? Digit.DateUtils.ConvertEpochToDate((_row$original11 = row.original) === null || _row$original11 === void 0 ? void 0 : _row$original11.currentReadingDate) : t("NA"));
37053
+ }
37054
+ }, {
37055
+ Header: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
37056
+ id: "consumption",
37057
+ disableSortBy: true,
37058
+ Cell: _ref9 => {
37059
+ var _row$original12, _row$original13;
37060
+ let {
37061
+ row
37062
+ } = _ref9;
37063
+ return /*#__PURE__*/React__default.createElement("span", null, consumption((_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : _row$original12.currentReading, (_row$original13 = row.original) === null || _row$original13 === void 0 ? void 0 : _row$original13.lastReading));
37064
+ }
37065
+ }, {
37066
+ Header: t("WS_COMMON_TABLE_COL_ACTION_LABEL"),
37067
+ id: "action",
37068
+ disableSortBy: true,
37069
+ Cell: _ref0 => {
37070
+ let {
37071
+ row
37072
+ } = _ref0;
37073
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
37074
+ style: {
37075
+ backgroundColor: "#0A4275",
37076
+ color: "#FFFFFF",
37077
+ minWidth: "auto",
37078
+ padding: "6px 14px",
37079
+ fontSize: "12px",
37080
+ height: "auto",
37081
+ margin: "0px",
37082
+ whiteSpace: "nowrap"
37083
+ },
37084
+ label: t("VIEW_METER_READING_DETAILS"),
37085
+ onSubmit: () => handleViewMeterReadingDetails(row.original)
37086
+ });
37087
+ }
37088
+ }], [t]);
36983
37089
  if (isLoading) {
36984
37090
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
36985
37091
  }
@@ -36987,90 +37093,32 @@ const ConsumptionDetails = _ref => {
36987
37093
  meterReadings
36988
37094
  } = data || {};
36989
37095
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
36990
- className: "employee-form-section-wrapper",
36991
- style: {
36992
- display: "flex",
36993
- gap: "16px",
36994
- width: "100%"
36995
- }
36996
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
36997
- config: [{
36998
- timeLine: [{
36999
- actions: "WS_VIEW_CONSUMPTION",
37000
- currentStep: 1
37001
- }]
37002
- }],
37003
- showFinalStep: false
37004
- }), /*#__PURE__*/React__default.createElement("div", {
37005
37096
  style: {
37006
37097
  flex: 1,
37007
37098
  display: "flex",
37008
37099
  flexDirection: "column",
37009
- gap: "16px"
37010
- }
37011
- }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 && meterReadings.map((application, index) => /*#__PURE__*/React__default.createElement("div", {
37012
- key: index
37013
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
37014
- style: {
37015
- display: "flex",
37016
- justifyContent: "flex-end",
37017
- marginBottom: "16px",
37018
- marginTop: "8px",
37019
- marginRight: "8px"
37100
+ gap: "16px",
37101
+ minWidth: 0,
37102
+ overflowX: "auto"
37020
37103
  }
37021
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
37022
- style: {
37023
- backgroundColor: "#0A4275",
37024
- color: "#FFFFFF"
37025
- },
37026
- label: t("VIEW_METER_READING_DETAILS"),
37027
- onSubmit: () => handleViewMeterReadingDetails(application)
37028
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37029
- key: t("WS_MYCONNECTIONS_CONSUMER_NO"),
37030
- label: `${t("WS_MYCONNECTIONS_CONSUMER_NO")}`,
37031
- text: (application === null || application === void 0 ? void 0 : application.connectionNo) || t("NA"),
37032
- className: "border-none"
37033
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37034
- key: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
37035
- label: `${t("WS_VIEW_BILL_BILLING_PERIOD_LABEL")}`,
37036
- text: (application === null || application === void 0 ? void 0 : application.billingPeriod) || t("NA"),
37037
- className: "border-none"
37038
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37039
- key: t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),
37040
- label: `${t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL")}`,
37041
- text: (application === null || application === void 0 ? void 0 : application.meterStatus) || t("NA"),
37042
- className: "border-none"
37043
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37044
- key: t("WS_READING_QUALITY_CODE"),
37045
- label: `${t("WS_READING_QUALITY_CODE")}`,
37046
- text: (application === null || application === void 0 ? void 0 : application.readingQualityCode) || t("NA"),
37047
- className: "border-none"
37048
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37049
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
37050
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL")}`,
37051
- text: (application === null || application === void 0 ? void 0 : application.lastReading) || t("NA"),
37052
- className: "border-none"
37053
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37054
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
37055
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL")}`,
37056
- text: application !== null && application !== void 0 && application.lastReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.lastReadingDate) : t("NA"),
37057
- className: "border-none"
37058
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37059
- key: t("WS_SERV_DETAIL_CUR_METER_READ"),
37060
- label: `${t("WS_SERV_DETAIL_CUR_METER_READ")}`,
37061
- text: (application === null || application === void 0 ? void 0 : application.currentReading) || t("NA"),
37062
- className: "border-none"
37063
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37064
- key: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
37065
- label: `${t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL")}`,
37066
- text: application !== null && application !== void 0 && application.currentReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.currentReadingDate) : t("NA"),
37067
- className: "border-none"
37068
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
37069
- key: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
37070
- label: `${t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL")}`,
37071
- text: consumption(application === null || application === void 0 ? void 0 : application.currentReading, application === null || application === void 0 ? void 0 : application.lastReading),
37072
- className: "border-none"
37073
- }))))), !(meterReadings !== null && meterReadings !== void 0 && meterReadings.length) > 0 && /*#__PURE__*/React__default.createElement("p", {
37104
+ }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
37105
+ t: t,
37106
+ data: meterReadings,
37107
+ columns: columns,
37108
+ totalRecords: meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length,
37109
+ manualPagination: false,
37110
+ isPaginationRequired: true,
37111
+ pageSizeLimit: 10,
37112
+ disableSort: true,
37113
+ autoSort: false,
37114
+ getCellProps: () => ({
37115
+ style: {
37116
+ whiteSpace: "nowrap",
37117
+ padding: "16px 14px",
37118
+ fontSize: "14px"
37119
+ }
37120
+ })
37121
+ }) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("p", {
37074
37122
  style: {
37075
37123
  marginLeft: "16px",
37076
37124
  marginTop: "16px"
@@ -55574,7 +55622,7 @@ const EditApplication$1 = () => {
55574
55622
  };
55575
55623
 
55576
55624
  const ConsumptionDetails$1 = _ref => {
55577
- var _user$info, _mdmsBillingPeriod$Md, _mdmsBillingPeriod$Md2, _mdmsBillingPeriod$Md3, _mdmsMeterStatus$Mdms, _mdmsMeterStatus$Mdms2, _mdmsMeterStatus$Mdms3, _DJBReadingQualityCod, _DJBReadingQualityCod2, _DJBReadingQualityCod3, _details$4, _details$5, _meterReadingDetailsD, _meterReadingDetailsD2, _meterReadingDetailsD3, _meterReadingDetailsD4, _meterReadingDetailsD5, _meterReadingDetailsD6, _meterReadingDetailsD7, _meterReadingDetailsD8, _meterReadingDetailsD9, _meterReadingDetailsD0, _meterReadingDetailsD1, _meterReadingDetailsD10, _meterReadingDetailsD11, _meterReadingDetailsD12, _meterReadingDetailsD13, _meterReadingDetailsD14, _meterReadingDetailsD15, _meterReadingDetailsD16, _meterReadingDetailsD17, _meterReadingDetailsD18, _meterReadingDetailsD19, _meterReadingDetailsD20, _meterReadingDetailsD21, _meterReadingDetailsD22, _meterReadingDetailsD23, _meterReadingDetailsD24, _meterReadingDetailsD25, _meterReadingDetailsD26, _meterReadingDetailsD27, _meterReadingDetailsD28, _meterReadingDetailsD29, _meterReadingDetailsD30, _meterReadingDetailsD31, _meterReadingDetailsD32, _meterReadingDetailsD33, _meterReadingDetailsD34, _meterReadingDetailsD35, _meterReadingDetailsD36, _meterReadingDetailsD37, _meterReadingDetailsD38, _meterReadingDetailsD39, _meterReadingDetailsD40, _meterReadingDetailsD41, _meterReadingDetailsD42, _meterReadingDetailsD43, _meterReadingDetailsD44, _meterReadingDetailsD45, _meterReadingDetailsD46, _meterReadingDetailsD47, _meterReadingDetailsD48, _meterReadingDetailsD49, _meterReadingDetailsD50, _meterReadingDetailsD51, _meterReadingDetailsD52, _meterReadingDetailsD53, _meterReadingDetailsD54, _meterReadingDetailsD55, _meterReadingDetailsD56, _meterReadingDetailsD57, _meterReadingDetailsD58, _meterReadingDetailsD59, _meterReadingDetailsD60, _meterReadingDetailsD61, _meterReadingDetailsD62, _meterReadingDetailsD63, _meterReadingDetailsD64, _meterReadingDetailsD65, _meterReadingDetailsD66, _meterReadingDetailsD67, _meterReadingDetailsD68, _meterReadingDetailsD69, _meterReadingDetailsD70, _meterReadingDetailsD71, _meterReadingDetailsD72, _meterReadingDetailsD73, _meterReadingDetailsD74, _meterReadingDetailsD75, _meterReadingDetailsD76, _meterReadingDetailsD77, _meterReadingDetailsD78, _meterReadingDetailsD79, _meterReadingDetailsD80, _meterReadingDetailsD81, _meterReadingDetailsD82;
55625
+ var _user$info, _mdmsBillingPeriod$Md, _mdmsBillingPeriod$Md2, _mdmsBillingPeriod$Md3, _mdmsMeterStatus$Mdms, _mdmsMeterStatus$Mdms2, _mdmsMeterStatus$Mdms3, _mdmsMeterStatus$Mdms4, _DJBReadingQualityCod, _DJBReadingQualityCod2, _DJBReadingQualityCod3, _DJBReadingQualityCod4, _details$4, _details$5, _meterReadingDetailsD, _meterReadingDetailsD2, _meterReadingDetailsD3, _meterReadingDetailsD4, _meterReadingDetailsD5, _meterReadingDetailsD6, _meterReadingDetailsD7, _meterReadingDetailsD8, _meterReadingDetailsD9, _meterReadingDetailsD0, _meterReadingDetailsD1, _meterReadingDetailsD10, _meterReadingDetailsD11, _meterReadingDetailsD12, _meterReadingDetailsD13, _meterReadingDetailsD14, _meterReadingDetailsD15, _meterReadingDetailsD16, _meterReadingDetailsD17, _meterReadingDetailsD18, _meterReadingDetailsD19, _meterReadingDetailsD20, _meterReadingDetailsD21, _meterReadingDetailsD22, _meterReadingDetailsD23, _meterReadingDetailsD24, _meterReadingDetailsD25, _meterReadingDetailsD26, _meterReadingDetailsD27, _meterReadingDetailsD28, _meterReadingDetailsD29, _meterReadingDetailsD30, _meterReadingDetailsD31, _meterReadingDetailsD32, _meterReadingDetailsD33, _meterReadingDetailsD34, _meterReadingDetailsD35, _meterReadingDetailsD36, _meterReadingDetailsD37, _meterReadingDetailsD38, _meterReadingDetailsD39, _meterReadingDetailsD40, _meterReadingDetailsD41, _meterReadingDetailsD42, _meterReadingDetailsD43, _meterReadingDetailsD44, _meterReadingDetailsD45, _meterReadingDetailsD46, _meterReadingDetailsD47, _meterReadingDetailsD48, _meterReadingDetailsD49, _meterReadingDetailsD50, _meterReadingDetailsD51, _meterReadingDetailsD52, _meterReadingDetailsD53, _meterReadingDetailsD54, _meterReadingDetailsD55, _meterReadingDetailsD56, _meterReadingDetailsD57, _meterReadingDetailsD58, _meterReadingDetailsD59, _meterReadingDetailsD60, _meterReadingDetailsD61, _meterReadingDetailsD62, _meterReadingDetailsD63, _meterReadingDetailsD64, _meterReadingDetailsD65, _meterReadingDetailsD66, _meterReadingDetailsD67, _meterReadingDetailsD68, _meterReadingDetailsD69, _meterReadingDetailsD70, _meterReadingDetailsD71, _meterReadingDetailsD72, _meterReadingDetailsD73, _meterReadingDetailsD74, _meterReadingDetailsD75, _meterReadingDetailsD76, _meterReadingDetailsD77, _meterReadingDetailsD78, _meterReadingDetailsD79, _meterReadingDetailsD80, _meterReadingDetailsD81, _meterReadingDetailsD82;
55578
55626
  const {
55579
55627
  t
55580
55628
  } = reactI18next.useTranslation();
@@ -55816,11 +55864,14 @@ const ConsumptionDetails$1 = _ref => {
55816
55864
  return Promise.reject(e);
55817
55865
  }
55818
55866
  };
55819
- let optionsList = mdmsMeterStatus === null || mdmsMeterStatus === void 0 ? void 0 : (_mdmsMeterStatus$Mdms = mdmsMeterStatus.MdmsRes) === null || _mdmsMeterStatus$Mdms === void 0 ? void 0 : (_mdmsMeterStatus$Mdms2 = _mdmsMeterStatus$Mdms["ws-services-calculation"]) === null || _mdmsMeterStatus$Mdms2 === void 0 ? void 0 : (_mdmsMeterStatus$Mdms3 = _mdmsMeterStatus$Mdms2.MeterStatus) === null || _mdmsMeterStatus$Mdms3 === void 0 ? void 0 : _mdmsMeterStatus$Mdms3.map(status => ({
55820
- code: status,
55821
- i18nKey: `WS_SERVICES_CALCULATION_METERSTATUS_${Digit.Utils.locale.getTransformedLocale(status)}`
55822
- }));
55823
- const ReadingQualityCodeList = DJBReadingQualityCode === null || DJBReadingQualityCode === void 0 ? void 0 : (_DJBReadingQualityCod = DJBReadingQualityCode.MdmsRes) === null || _DJBReadingQualityCod === void 0 ? void 0 : (_DJBReadingQualityCod2 = _DJBReadingQualityCod["ws-services-calculation"]) === null || _DJBReadingQualityCod2 === void 0 ? void 0 : (_DJBReadingQualityCod3 = _DJBReadingQualityCod2.DJBReadingQualityCode) === null || _DJBReadingQualityCod3 === void 0 ? void 0 : _DJBReadingQualityCod3.map(status => {
55867
+ let optionsList = mdmsMeterStatus === null || mdmsMeterStatus === void 0 ? void 0 : (_mdmsMeterStatus$Mdms = mdmsMeterStatus.MdmsRes) === null || _mdmsMeterStatus$Mdms === void 0 ? void 0 : (_mdmsMeterStatus$Mdms2 = _mdmsMeterStatus$Mdms["ws-services-calculation"]) === null || _mdmsMeterStatus$Mdms2 === void 0 ? void 0 : (_mdmsMeterStatus$Mdms3 = _mdmsMeterStatus$Mdms2.MeterStatus) === null || _mdmsMeterStatus$Mdms3 === void 0 ? void 0 : (_mdmsMeterStatus$Mdms4 = _mdmsMeterStatus$Mdms3.filter(status => typeof status === "object" ? (status === null || status === void 0 ? void 0 : status.active) === true || (status === null || status === void 0 ? void 0 : status.active) === "true" : true)) === null || _mdmsMeterStatus$Mdms4 === void 0 ? void 0 : _mdmsMeterStatus$Mdms4.map(status => {
55868
+ const statusCode = typeof status === "object" ? status.name || status.code : status;
55869
+ return {
55870
+ code: statusCode,
55871
+ i18nKey: `WS_SERVICES_CALCULATION_METERSTATUS_${Digit.Utils.locale.getTransformedLocale(statusCode)}`
55872
+ };
55873
+ });
55874
+ const ReadingQualityCodeList = DJBReadingQualityCode === null || DJBReadingQualityCode === void 0 ? void 0 : (_DJBReadingQualityCod = DJBReadingQualityCode.MdmsRes) === null || _DJBReadingQualityCod === void 0 ? void 0 : (_DJBReadingQualityCod2 = _DJBReadingQualityCod["ws-services-calculation"]) === null || _DJBReadingQualityCod2 === void 0 ? void 0 : (_DJBReadingQualityCod3 = _DJBReadingQualityCod2.DJBReadingQualityCode) === null || _DJBReadingQualityCod3 === void 0 ? void 0 : (_DJBReadingQualityCod4 = _DJBReadingQualityCod3.filter(status => typeof status === "object" ? (status === null || status === void 0 ? void 0 : status.active) === true || (status === null || status === void 0 ? void 0 : status.active) === "true" : true)) === null || _DJBReadingQualityCod4 === void 0 ? void 0 : _DJBReadingQualityCod4.map(status => {
55824
55875
  const statusCode = typeof status === "object" ? status.code : status;
55825
55876
  return {
55826
55877
  code: statusCode,
@@ -55977,10 +56028,122 @@ const ConsumptionDetails$1 = _ref => {
55977
56028
  }, /*#__PURE__*/React__default.createElement(Close, null));
55978
56029
  };
55979
56030
  const consumption = (currentReading, lastReading) => {
55980
- if (currentReading && lastReading) {
56031
+ if (currentReading !== null && currentReading !== undefined && lastReading !== null && lastReading !== undefined && currentReading !== "" && lastReading !== "") {
55981
56032
  return Number(currentReading - lastReading);
55982
56033
  } else return t("NA");
55983
56034
  };
56035
+ const columns = React.useMemo(() => [{
56036
+ Header: t("WS_MYCONNECTIONS_CONSUMER_NO"),
56037
+ accessor: "connectionNo",
56038
+ disableSortBy: true,
56039
+ Cell: _ref2 => {
56040
+ var _row$original;
56041
+ let {
56042
+ row
56043
+ } = _ref2;
56044
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.connectionNo) || t("NA"));
56045
+ }
56046
+ }, {
56047
+ Header: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
56048
+ accessor: "billingPeriod",
56049
+ disableSortBy: true,
56050
+ Cell: _ref3 => {
56051
+ var _row$original2;
56052
+ let {
56053
+ row
56054
+ } = _ref3;
56055
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.billingPeriod) || t("NA"));
56056
+ }
56057
+ }, {
56058
+ Header: t("WS_READING_QUALITY_CODE"),
56059
+ accessor: "readingQualityCode",
56060
+ disableSortBy: true,
56061
+ Cell: _ref4 => {
56062
+ var _row$original3;
56063
+ let {
56064
+ row
56065
+ } = _ref4;
56066
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.readingQualityCode) || t("NA"));
56067
+ }
56068
+ }, {
56069
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
56070
+ accessor: "lastReading",
56071
+ disableSortBy: true,
56072
+ Cell: _ref5 => {
56073
+ var _row$original4, _row$original5, _row$original6;
56074
+ let {
56075
+ row
56076
+ } = _ref5;
56077
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.lastReading) !== undefined && ((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.lastReading) !== null ? (_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.lastReading : t("NA"));
56078
+ }
56079
+ }, {
56080
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
56081
+ accessor: "lastReadingDate",
56082
+ disableSortBy: true,
56083
+ Cell: _ref6 => {
56084
+ var _row$original7, _row$original8;
56085
+ let {
56086
+ row
56087
+ } = _ref6;
56088
+ return /*#__PURE__*/React__default.createElement("span", null, (_row$original7 = row.original) !== null && _row$original7 !== void 0 && _row$original7.lastReadingDate ? Digit.DateUtils.ConvertEpochToDate((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.lastReadingDate) : t("NA"));
56089
+ }
56090
+ }, {
56091
+ Header: t("WS_SERV_DETAIL_CUR_METER_READ"),
56092
+ accessor: "currentReading",
56093
+ disableSortBy: true,
56094
+ Cell: _ref7 => {
56095
+ var _row$original9, _row$original0, _row$original1;
56096
+ let {
56097
+ row
56098
+ } = _ref7;
56099
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.currentReading) !== undefined && ((_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.currentReading) !== null ? (_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.currentReading : t("NA"));
56100
+ }
56101
+ }, {
56102
+ Header: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
56103
+ accessor: "currentReadingDate",
56104
+ disableSortBy: true,
56105
+ Cell: _ref8 => {
56106
+ var _row$original10, _row$original11;
56107
+ let {
56108
+ row
56109
+ } = _ref8;
56110
+ return /*#__PURE__*/React__default.createElement("span", null, (_row$original10 = row.original) !== null && _row$original10 !== void 0 && _row$original10.currentReadingDate ? Digit.DateUtils.ConvertEpochToDate((_row$original11 = row.original) === null || _row$original11 === void 0 ? void 0 : _row$original11.currentReadingDate) : t("NA"));
56111
+ }
56112
+ }, {
56113
+ Header: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
56114
+ id: "consumption",
56115
+ disableSortBy: true,
56116
+ Cell: _ref9 => {
56117
+ var _row$original12, _row$original13;
56118
+ let {
56119
+ row
56120
+ } = _ref9;
56121
+ return /*#__PURE__*/React__default.createElement("span", null, consumption((_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : _row$original12.currentReading, (_row$original13 = row.original) === null || _row$original13 === void 0 ? void 0 : _row$original13.lastReading));
56122
+ }
56123
+ }, {
56124
+ Header: t("WS_COMMON_TABLE_COL_ACTION_LABEL"),
56125
+ id: "action",
56126
+ disableSortBy: true,
56127
+ Cell: _ref0 => {
56128
+ let {
56129
+ row
56130
+ } = _ref0;
56131
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
56132
+ style: {
56133
+ backgroundColor: "#0A4275",
56134
+ color: "#FFFFFF",
56135
+ minWidth: "auto",
56136
+ padding: "6px 14px",
56137
+ fontSize: "12px",
56138
+ height: "auto",
56139
+ margin: "0px",
56140
+ whiteSpace: "nowrap"
56141
+ },
56142
+ label: t("VIEW_METER_READING_DETAILS"),
56143
+ onSubmit: () => handleViewMeterReadingDetails(row.original)
56144
+ });
56145
+ }
56146
+ }], [t]);
55984
56147
  if (isLoading || isConnectionDetailsLoading) {
55985
56148
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
55986
56149
  }
@@ -55988,89 +56151,40 @@ const ConsumptionDetails$1 = _ref => {
55988
56151
  meterReadings
55989
56152
  } = response || {};
55990
56153
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
55991
- className: "employee-form-section-wrapper"
55992
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
55993
- config: [{
55994
- timeLine: [{
55995
- actions: "WS_VIEW_CONSUMPTION",
55996
- currentStep: 1
55997
- }]
55998
- }],
55999
- showFinalStep: false
56000
- }), /*#__PURE__*/React__default.createElement("div", {
56001
56154
  style: {
56002
56155
  flex: 1,
56003
56156
  display: "flex",
56004
56157
  flexDirection: "column",
56005
- gap: "16px"
56006
- }
56007
- }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 && meterReadings.map((application, index) => /*#__PURE__*/React__default.createElement("div", {
56008
- key: index
56009
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
56010
- style: {
56011
- display: "flex",
56012
- justifyContent: "flex-end",
56013
- marginBottom: "16px",
56014
- marginTop: "8px",
56015
- marginRight: "8px"
56158
+ gap: "16px",
56159
+ minWidth: 0,
56160
+ overflowX: "auto"
56016
56161
  }
56017
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
56018
- label: t("VIEW_METER_READING_DETAILS"),
56019
- onSubmit: () => handleViewMeterReadingDetails(application)
56020
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56021
- key: t("WS_MYCONNECTIONS_CONSUMER_NO"),
56022
- label: `${t("WS_MYCONNECTIONS_CONSUMER_NO")}`,
56023
- text: (application === null || application === void 0 ? void 0 : application.connectionNo) || t("NA"),
56024
- className: "border-none"
56025
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56026
- key: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
56027
- label: `${t("WS_VIEW_BILL_BILLING_PERIOD_LABEL")}`,
56028
- text: (application === null || application === void 0 ? void 0 : application.billingPeriod) || t("NA"),
56029
- className: "border-none"
56030
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56031
- key: t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),
56032
- label: `${t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL")}`,
56033
- text: (application === null || application === void 0 ? void 0 : application.meterStatus) || t("NA"),
56034
- className: "border-none"
56035
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56036
- key: t("WS_READING_QUALITY_CODE"),
56037
- label: `${t("WS_READING_QUALITY_CODE")}`,
56038
- text: (application === null || application === void 0 ? void 0 : application.readingQualityCode) || t("NA"),
56039
- className: "border-none"
56040
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56041
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
56042
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL")}`,
56043
- text: (application === null || application === void 0 ? void 0 : application.lastReading) || t("NA"),
56044
- className: "border-none"
56045
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56046
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
56047
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL")}`,
56048
- text: application !== null && application !== void 0 && application.lastReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.lastReadingDate) : t("NA"),
56049
- className: "border-none"
56050
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56051
- key: t("WS_SERV_DETAIL_CUR_METER_READ"),
56052
- label: `${t("WS_SERV_DETAIL_CUR_METER_READ")}`,
56053
- text: (application === null || application === void 0 ? void 0 : application.currentReading) || t("NA"),
56054
- className: "border-none"
56055
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56056
- key: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
56057
- label: `${t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL")}`,
56058
- text: application !== null && application !== void 0 && application.currentReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.currentReadingDate) : t("NA"),
56059
- className: "border-none"
56060
- }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
56061
- key: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
56062
- label: `${t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL")}`,
56063
- text: consumption(application === null || application === void 0 ? void 0 : application.currentReading, application === null || application === void 0 ? void 0 : application.lastReading),
56064
- className: "border-none"
56065
- }))))), !(meterReadings !== null && meterReadings !== void 0 && meterReadings.length) > 0 && /*#__PURE__*/React__default.createElement("p", {
56162
+ }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
56163
+ t: t,
56164
+ data: meterReadings,
56165
+ columns: columns,
56166
+ totalRecords: meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length,
56167
+ manualPagination: false,
56168
+ isPaginationRequired: true,
56169
+ pageSizeLimit: 10,
56170
+ disableSort: true,
56171
+ autoSort: false,
56172
+ getCellProps: () => ({
56173
+ style: {
56174
+ whiteSpace: "nowrap",
56175
+ padding: "16px 14px",
56176
+ fontSize: "14px"
56177
+ }
56178
+ })
56179
+ }) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("p", {
56066
56180
  style: {
56067
56181
  marginLeft: "16px",
56068
56182
  marginTop: "16px"
56069
56183
  }
56070
- }, t("WS_NO_CONSUMPTION_FOUND"))), isLoading || meterStatusLoading || billingPeriodLoading || !isUserAllowedToAddMeterReading ? null : /*#__PURE__*/React__default.createElement("div", null, isAddMeterReadingButtonEnable && /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
56184
+ }, t("WS_NO_CONSUMPTION_FOUND")))), isLoading || meterStatusLoading || billingPeriodLoading || !isUserAllowedToAddMeterReading ? null : /*#__PURE__*/React__default.createElement("div", null, isAddMeterReadingButtonEnable && /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
56071
56185
  label: t("WS_CONSUMPTION_BUTTON_METER_READING_LABEL"),
56072
56186
  onSubmit: popUp
56073
- })))), openModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
56187
+ }))), openModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
56074
56188
  headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
56075
56189
  label: t(config.label.heading)
56076
56190
  }),
@@ -62350,9 +62464,6 @@ const OLDApplication = () => {
62350
62464
  const [canSubmit, setSubmitValve] = React.useState(false);
62351
62465
  const [isEnableLoader, setIsEnableLoader] = React.useState(false);
62352
62466
  const [showToast, setShowToast] = React.useState(null);
62353
- const [config, setConfig] = React.useState({
62354
- body: []
62355
- });
62356
62467
  const [showCheckPage, setShowCheckPage] = React.useState(false);
62357
62468
  const isCitizen = ((_Digit$UserService$ge = Digit.UserService.getType()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.toUpperCase()) === "CITIZEN";
62358
62469
  const timelineConfig = [{
@@ -62386,15 +62497,21 @@ const OLDApplication = () => {
62386
62497
  tenantId = (_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code;
62387
62498
  }
62388
62499
  const stateId = Digit.ULBService.getStateId();
62500
+ const mdmsOptions = React.useMemo(() => ({}), []);
62389
62501
  let {
62390
- data: newConfig,
62502
+ data: newConfig$1,
62391
62503
  isLoading
62392
- } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {});
62504
+ } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, mdmsOptions);
62393
62505
  const requestedPropertyId = new URLSearchParams(location.search).get("propertyId");
62394
62506
  const [propertyId, setPropertyId] = React.useState(requestedPropertyId);
62395
62507
  const initialPropertyId = React.useRef(requestedPropertyId);
62396
62508
  const verifiedPropertyId = React.useRef(sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID"));
62397
62509
  const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {});
62510
+ const formDataRef = React.useRef(sessionFormData || {});
62511
+ const sessionSaveTimeoutRef = React.useRef(null);
62512
+ const defaultValues = React.useMemo(() => {
62513
+ return sessionFormData && Object.keys(sessionFormData).length > 0 ? sessionFormData : Digit.SessionStorage.get("PT_CREATE_EMP_WS_NEW_FORM") || {};
62514
+ }, []);
62398
62515
  const {
62399
62516
  data: propertyDetails
62400
62517
  } = Digit.Hooks.pt.usePropertySearch({
@@ -62419,102 +62536,106 @@ const OLDApplication = () => {
62419
62536
  React.useEffect(() => {
62420
62537
  sessionStorage.removeItem("FORMSTATE_ERRORS");
62421
62538
  }, []);
62422
- React.useEffect(() => {
62423
- if (!isLoading && newConfig) {
62424
- const config = newConfig.find(conf => conf.hideInCitizen && conf.isCreate);
62425
- if (config) {
62426
- var _config$body;
62427
- const allCreateSections = (config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.filter(section => section === null || section === void 0 ? void 0 : section.isCreateConnection)) || [];
62428
- const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "WSDivyangjan", "WSDjbEmployee", "WSPropertyLocationDetails", "PropertyWaterConnection", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSDocumentsEmployee"];
62429
- const reorderedBody = [];
62430
- desiredComponentOrder.forEach(compName => {
62431
- const section = allCreateSections.find(s => {
62432
- var _s$body, _s$body$;
62433
- const bodyComp = (_s$body = s.body) === null || _s$body === void 0 ? void 0 : (_s$body$ = _s$body[0]) === null || _s$body$ === void 0 ? void 0 : _s$body$.component;
62434
- return bodyComp === compName || compName === "WSConnectionDetails" && bodyComp === "WSConnectionDetails";
62435
- });
62436
- if (section) {
62437
- reorderedBody.push(section);
62438
- } else if (compName === "WSPropertyLocationDetails") {
62439
- reorderedBody.push({
62440
- isCreateConnection: true,
62441
- body: [{
62442
- type: "component",
62443
- key: "propertyAddress",
62444
- component: "WSPropertyLocationDetails",
62445
- withoutLabel: true,
62446
- isAutomaticFill: true,
62447
- texts: {
62448
- header: `${t("PT_LOCATION_DETAILS_AUTOMATIC_FILL_BY_PROPERTY")}`
62449
- },
62450
- defaultOpen: false
62451
- }]
62452
- });
62453
- } else if (compName === "PropertyWaterConnection") {
62454
- reorderedBody.push({
62455
- isCreateConnection: true,
62456
- body: [{
62457
- type: "component",
62458
- key: "useDetails",
62459
- component: "PropertyWaterConnection",
62460
- withoutLabel: true,
62461
- isAutomaticFill: true
62462
- }]
62463
- });
62464
- } else if (compName === "WSDeclaration") {
62465
- reorderedBody.push({
62466
- isCreateConnection: true,
62467
- body: [{
62468
- type: "component",
62469
- key: "declarationData",
62470
- component: "WSDeclaration",
62471
- withoutLabel: true
62472
- }]
62473
- });
62474
- } else if (compName === "WSDjbEmployee") {
62475
- reorderedBody.push({
62476
- isCreateConnection: true,
62477
- body: [{
62478
- type: "component",
62479
- key: "djbEmployee",
62480
- component: "WSDjbEmployee",
62481
- withoutLabel: true
62482
- }]
62483
- });
62484
- } else if (compName === "WSDivyangjan") {
62485
- reorderedBody.push({
62486
- isCreateConnection: true,
62487
- body: [{
62488
- type: "component",
62489
- key: "disability",
62490
- component: "WSDivyangjan",
62491
- withoutLabel: true,
62492
- texts: {
62493
- header: "Divyangjan/Person with Disability?"
62494
- }
62495
- }]
62496
- });
62497
- }
62539
+ const config = React.useMemo(() => {
62540
+ var _configCopy$body;
62541
+ const rawConfigs = newConfig$1 && Array.isArray(newConfig$1) && newConfig$1.length > 0 ? newConfig$1 : newConfig;
62542
+ const foundConfig = rawConfigs === null || rawConfigs === void 0 ? void 0 : rawConfigs.find(conf => conf.hideInCitizen && conf.isCreate);
62543
+ if (!foundConfig) return {
62544
+ body: []
62545
+ };
62546
+ const configCopy = cloneDeep_1(foundConfig);
62547
+ const allCreateSections = (configCopy === null || configCopy === void 0 ? void 0 : (_configCopy$body = configCopy.body) === null || _configCopy$body === void 0 ? void 0 : _configCopy$body.filter(section => section === null || section === void 0 ? void 0 : section.isCreateConnection)) || [];
62548
+ const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "WSDivyangjan", "WSDjbEmployee", "WSPropertyLocationDetails", "PropertyWaterConnection", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSDocumentsEmployee"];
62549
+ const reorderedBody = [];
62550
+ desiredComponentOrder.forEach(compName => {
62551
+ const section = allCreateSections.find(s => {
62552
+ var _s$body, _s$body$;
62553
+ const bodyComp = (_s$body = s.body) === null || _s$body === void 0 ? void 0 : (_s$body$ = _s$body[0]) === null || _s$body$ === void 0 ? void 0 : _s$body$.component;
62554
+ return bodyComp === compName || compName === "WSConnectionDetails" && bodyComp === "WSConnectionDetails";
62555
+ });
62556
+ if (section) {
62557
+ reorderedBody.push(section);
62558
+ } else if (compName === "WSPropertyLocationDetails") {
62559
+ reorderedBody.push({
62560
+ isCreateConnection: true,
62561
+ body: [{
62562
+ type: "component",
62563
+ key: "propertyAddress",
62564
+ component: "WSPropertyLocationDetails",
62565
+ withoutLabel: true,
62566
+ isAutomaticFill: true,
62567
+ texts: {
62568
+ header: `${t("PT_LOCATION_DETAILS_AUTOMATIC_FILL_BY_PROPERTY")}`
62569
+ },
62570
+ defaultOpen: false
62571
+ }]
62498
62572
  });
62499
- allCreateSections.forEach(section => {
62500
- var _section$body, _section$body$;
62501
- const bodyComp = (_section$body = section.body) === null || _section$body === void 0 ? void 0 : (_section$body$ = _section$body[0]) === null || _section$body$ === void 0 ? void 0 : _section$body$.component;
62502
- if (bodyComp !== "CPTPropertySearchNSummary" && !reorderedBody.find(r => {
62503
- var _r$body, _r$body$;
62504
- return ((_r$body = r.body) === null || _r$body === void 0 ? void 0 : (_r$body$ = _r$body[0]) === null || _r$body$ === void 0 ? void 0 : _r$body$.component) === bodyComp;
62505
- })) {
62506
- reorderedBody.push(section);
62507
- }
62573
+ } else if (compName === "PropertyWaterConnection") {
62574
+ reorderedBody.push({
62575
+ isCreateConnection: true,
62576
+ body: [{
62577
+ type: "component",
62578
+ key: "useDetails",
62579
+ component: "PropertyWaterConnection",
62580
+ withoutLabel: true,
62581
+ isAutomaticFill: true
62582
+ }]
62583
+ });
62584
+ } else if (compName === "WSDeclaration") {
62585
+ reorderedBody.push({
62586
+ isCreateConnection: true,
62587
+ body: [{
62588
+ type: "component",
62589
+ key: "declarationData",
62590
+ component: "WSDeclaration",
62591
+ withoutLabel: true
62592
+ }]
62593
+ });
62594
+ } else if (compName === "WSDjbEmployee") {
62595
+ reorderedBody.push({
62596
+ isCreateConnection: true,
62597
+ body: [{
62598
+ type: "component",
62599
+ key: "djbEmployee",
62600
+ component: "WSDjbEmployee",
62601
+ withoutLabel: true
62602
+ }]
62603
+ });
62604
+ } else if (compName === "WSDivyangjan") {
62605
+ reorderedBody.push({
62606
+ isCreateConnection: true,
62607
+ body: [{
62608
+ type: "component",
62609
+ key: "disability",
62610
+ component: "WSDivyangjan",
62611
+ withoutLabel: true,
62612
+ texts: {
62613
+ header: "Divyangjan/Person with Disability?"
62614
+ }
62615
+ }]
62508
62616
  });
62509
- config.body = reorderedBody;
62510
- setConfig(config);
62511
62617
  }
62512
- }
62513
- }, [newConfig, isLoading]);
62618
+ });
62619
+ allCreateSections.forEach(section => {
62620
+ var _section$body, _section$body$;
62621
+ const bodyComp = (_section$body = section.body) === null || _section$body === void 0 ? void 0 : (_section$body$ = _section$body[0]) === null || _section$body$ === void 0 ? void 0 : _section$body$.component;
62622
+ if (bodyComp !== "CPTPropertySearchNSummary" && !reorderedBody.find(r => {
62623
+ var _r$body, _r$body$;
62624
+ return ((_r$body = r.body) === null || _r$body === void 0 ? void 0 : (_r$body$ = _r$body[0]) === null || _r$body$ === void 0 ? void 0 : _r$body$.component) === bodyComp;
62625
+ })) {
62626
+ reorderedBody.push(section);
62627
+ }
62628
+ });
62629
+ configCopy.body = reorderedBody;
62630
+ return configCopy;
62631
+ }, [newConfig$1, t]);
62514
62632
  React.useEffect(() => {
62515
- var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
62516
- !propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
62517
- }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
62633
+ var _sessionFormData$cpt, _sessionFormData$cpt$, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4;
62634
+ const cptId = (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) || ((_Digit$SessionStorage2 = Digit.SessionStorage.get("PT_CREATE_EMP_WS_NEW_FORM")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.cpt) === null || _Digit$SessionStorage3 === void 0 ? void 0 : (_Digit$SessionStorage4 = _Digit$SessionStorage3.details) === null || _Digit$SessionStorage4 === void 0 ? void 0 : _Digit$SessionStorage4.propertyId);
62635
+ if (!propertyId && cptId) {
62636
+ setPropertyId(cptId);
62637
+ }
62638
+ }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt, propertyId]);
62518
62639
  const {
62519
62640
  isLoading: creatingWaterApplicationLoading,
62520
62641
  mutate: waterMutation
@@ -62532,29 +62653,42 @@ const OLDApplication = () => {
62532
62653
  mutate: sewerageUpdateMutation
62533
62654
  } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
62534
62655
  const onFormValueChange = (setValue, formData, formState) => {
62535
- var _djbData$document, _updatedFormData$cpt, _updatedFormData$cpt$, _propertyDetails$Prop, _propertyDetails$Prop2;
62536
- const updatedFormData = {
62537
- ...sessionFormData,
62656
+ var _formData$cpt, _formData$cpt$details, _formDataRef$current, _formDataRef$current2, _djbData$document, _formDataRef$current3, _formDataRef$current4, _formDataRef$current5, _propertyDetails$Prop, _propertyDetails$Prop2;
62657
+ formDataRef.current = {
62658
+ ...formDataRef.current,
62538
62659
  ...formData
62539
62660
  };
62540
- const cleanedFormData = JSON.parse(JSON.stringify(updatedFormData));
62541
- if (!lodash.isEqual(sessionFormData, cleanedFormData)) {
62542
- setSessionFormData(cleanedFormData);
62661
+ if (sessionSaveTimeoutRef.current) {
62662
+ clearTimeout(sessionSaveTimeoutRef.current);
62543
62663
  }
62664
+ sessionSaveTimeoutRef.current = setTimeout(() => {
62665
+ Digit.SessionStorage.set("PT_CREATE_EMP_WS_NEW_FORM", formDataRef.current);
62666
+ }, 300);
62544
62667
  sessionStorage.setItem("FORMSTATE_ERRORS", JSON.stringify((formState === null || formState === void 0 ? void 0 : formState.errors) || {}));
62545
- const djbData = (updatedFormData === null || updatedFormData === void 0 ? void 0 : updatedFormData.djbEmployee) || (updatedFormData === null || updatedFormData === void 0 ? void 0 : updatedFormData.additionalDetails);
62668
+ const cptPropId = formData === null || formData === void 0 ? void 0 : (_formData$cpt = formData.cpt) === null || _formData$cpt === void 0 ? void 0 : (_formData$cpt$details = _formData$cpt.details) === null || _formData$cpt$details === void 0 ? void 0 : _formData$cpt$details.propertyId;
62669
+ if (!propertyId && cptPropId) {
62670
+ setPropertyId(cptPropId);
62671
+ }
62672
+ const djbData = ((_formDataRef$current = formDataRef.current) === null || _formDataRef$current === void 0 ? void 0 : _formDataRef$current.djbEmployee) || ((_formDataRef$current2 = formDataRef.current) === null || _formDataRef$current2 === void 0 ? void 0 : _formDataRef$current2.additionalDetails);
62546
62673
  const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
62547
62674
  const isDjbEmpInvalid = isDjbEmp && (!(djbData !== null && djbData !== void 0 && djbData.employeeId) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.employeeId).trim() || !(djbData !== null && djbData !== void 0 && djbData.designation) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.designation).trim() || !(djbData !== null && djbData !== void 0 && (_djbData$document = djbData.document) !== null && _djbData$document !== void 0 && _djbData$document.fileStoreId || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && djbData !== null && djbData !== void 0 && djbData.document.trim() || djbData !== null && djbData !== void 0 && djbData.document));
62548
62675
  const hasErrors = Object.keys((formState === null || formState === void 0 ? void 0 : formState.errors) || {}).length > 0 || isDjbEmpInvalid;
62549
- const hasProperty = (updatedFormData === null || updatedFormData === void 0 ? void 0 : (_updatedFormData$cpt = updatedFormData.cpt) === null || _updatedFormData$cpt === void 0 ? void 0 : (_updatedFormData$cpt$ = _updatedFormData$cpt.details) === null || _updatedFormData$cpt$ === void 0 ? void 0 : _updatedFormData$cpt$.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : (_propertyDetails$Prop2 = _propertyDetails$Prop[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.propertyId);
62550
- setSubmitValve(!hasErrors && !!hasProperty);
62676
+ const hasProperty = ((_formDataRef$current3 = formDataRef.current) === null || _formDataRef$current3 === void 0 ? void 0 : (_formDataRef$current4 = _formDataRef$current3.cpt) === null || _formDataRef$current4 === void 0 ? void 0 : (_formDataRef$current5 = _formDataRef$current4.details) === null || _formDataRef$current5 === void 0 ? void 0 : _formDataRef$current5.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : (_propertyDetails$Prop2 = _propertyDetails$Prop[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.propertyId);
62677
+ const canSubmitNow = !hasErrors && !!hasProperty;
62678
+ setSubmitValve(prev => prev !== canSubmitNow ? canSubmitNow : prev);
62551
62679
  };
62552
62680
  const onFormSubmit = data => {
62553
- var _data$cpt, _data$cpt$details, _propertyDetails$Prop3, _propertyDetails$Prop4, _data$cpt2, _propertyDetails$Prop5, _djbData$document2;
62554
- const hasProperty = (data === null || data === void 0 ? void 0 : (_data$cpt = data.cpt) === null || _data$cpt === void 0 ? void 0 : (_data$cpt$details = _data$cpt.details) === null || _data$cpt$details === void 0 ? void 0 : _data$cpt$details.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : (_propertyDetails$Prop4 = _propertyDetails$Prop3[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : _propertyDetails$Prop4.propertyId);
62681
+ var _combinedData$cpt, _combinedData$cpt$det, _propertyDetails$Prop3, _propertyDetails$Prop4, _combinedData$cpt2, _propertyDetails$Prop5, _djbData$document2;
62682
+ const combinedData = {
62683
+ ...formDataRef.current,
62684
+ ...data
62685
+ };
62686
+ formDataRef.current = combinedData;
62687
+ Digit.SessionStorage.set("PT_CREATE_EMP_WS_NEW_FORM", combinedData);
62688
+ const hasProperty = (combinedData === null || combinedData === void 0 ? void 0 : (_combinedData$cpt = combinedData.cpt) === null || _combinedData$cpt === void 0 ? void 0 : (_combinedData$cpt$det = _combinedData$cpt.details) === null || _combinedData$cpt$det === void 0 ? void 0 : _combinedData$cpt$det.propertyId) || sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID") || propertyId || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : (_propertyDetails$Prop4 = _propertyDetails$Prop3[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : _propertyDetails$Prop4.propertyId);
62555
62689
  if (!hasProperty) {
62556
62690
  console.warn("[WS] onSubmit EXIT: invalid property", {
62557
- cpt: data === null || data === void 0 ? void 0 : data.cpt,
62691
+ cpt: combinedData === null || combinedData === void 0 ? void 0 : combinedData.cpt,
62558
62692
  propertyDetails
62559
62693
  });
62560
62694
  setShowToast({
@@ -62563,11 +62697,11 @@ const OLDApplication = () => {
62563
62697
  });
62564
62698
  return;
62565
62699
  }
62566
- if (!(data !== null && data !== void 0 && (_data$cpt2 = data.cpt) !== null && _data$cpt2 !== void 0 && _data$cpt2.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop5 = propertyDetails.Properties) !== null && _propertyDetails$Prop5 !== void 0 && _propertyDetails$Prop5[0])) {
62567
- var _data$cpt3;
62568
- if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details) || !propertyDetails) {
62700
+ if (!(combinedData !== null && combinedData !== void 0 && (_combinedData$cpt2 = combinedData.cpt) !== null && _combinedData$cpt2 !== void 0 && _combinedData$cpt2.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop5 = propertyDetails.Properties) !== null && _propertyDetails$Prop5 !== void 0 && _propertyDetails$Prop5[0])) {
62701
+ var _combinedData$cpt3;
62702
+ if (!(combinedData !== null && combinedData !== void 0 && (_combinedData$cpt3 = combinedData.cpt) !== null && _combinedData$cpt3 !== void 0 && _combinedData$cpt3.details) || !propertyDetails) {
62569
62703
  console.warn("[WS] onSubmit EXIT: invalid property", {
62570
- cpt: data === null || data === void 0 ? void 0 : data.cpt,
62704
+ cpt: combinedData === null || combinedData === void 0 ? void 0 : combinedData.cpt,
62571
62705
  propertyDetails
62572
62706
  });
62573
62707
  setShowToast({
@@ -62577,7 +62711,7 @@ const OLDApplication = () => {
62577
62711
  return;
62578
62712
  }
62579
62713
  }
62580
- const djbData = (data === null || data === void 0 ? void 0 : data.djbEmployee) || (data === null || data === void 0 ? void 0 : data.additionalDetails);
62714
+ const djbData = (combinedData === null || combinedData === void 0 ? void 0 : combinedData.djbEmployee) || (combinedData === null || combinedData === void 0 ? void 0 : combinedData.additionalDetails);
62581
62715
  const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
62582
62716
  const isDjbEmpInvalid = isDjbEmp && (!(djbData !== null && djbData !== void 0 && djbData.employeeId) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.employeeId).trim() || !(djbData !== null && djbData !== void 0 && djbData.designation) || !String(djbData === null || djbData === void 0 ? void 0 : djbData.designation).trim() || !(djbData !== null && djbData !== void 0 && (_djbData$document2 = djbData.document) !== null && _djbData$document2 !== void 0 && _djbData$document2.fileStoreId || typeof (djbData === null || djbData === void 0 ? void 0 : djbData.document) === "string" && djbData !== null && djbData !== void 0 && djbData.document.trim() || djbData !== null && djbData !== void 0 && djbData.document));
62583
62717
  if (isDjbEmpInvalid) {
@@ -62591,7 +62725,7 @@ const OLDApplication = () => {
62591
62725
  };
62592
62726
  const processSubmission = function (data) {
62593
62727
  try {
62594
- var _data$useDetails, _data$ConnectionDetai, _data$ConnectionDetai2, _data$DocumentsRequir, _data$cpt4, _Digit$UserService$ge2, _data$ConnectionHolde, _data$ConnectionHolde2, _data$ConnectionHolde3, _data$ConnectionHolde4, _data$ConnectionHolde5, _propertyDetails$Prop7, _propertyDetails$Prop8, _propertyDetails$Prop9, _propertyDetails$Prop0, _data$ConnectionHolde6, _data$ConnectionHolde7, _data$cpt5, _data$cpt5$details, _data$cpt5$details$ow, _data$cpt5$details$ow2;
62728
+ var _data$useDetails, _data$ConnectionDetai, _data$ConnectionDetai2, _data$DocumentsRequir, _data$cpt, _Digit$UserService$ge2, _data$ConnectionHolde, _data$ConnectionHolde2, _data$ConnectionHolde3, _data$ConnectionHolde4, _data$ConnectionHolde5, _propertyDetails$Prop7, _propertyDetails$Prop8, _propertyDetails$Prop9, _propertyDetails$Prop0, _data$ConnectionHolde6, _data$ConnectionHolde7, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ow, _data$cpt2$details$ow2;
62595
62729
  const basePath = window.location.href.includes("/employee") ? "/digit-ui/employee/ws" : "/digit-ui/citizen/ws";
62596
62730
  if (data !== null && data !== void 0 && (_data$useDetails = data.useDetails) !== null && _data$useDetails !== void 0 && _data$useDetails.useDetails) {
62597
62731
  data.useDetails = {
@@ -62688,7 +62822,7 @@ const OLDApplication = () => {
62688
62822
  data.declarationData.agree = data.declaration.agree;
62689
62823
  data.declarationData.declarations = data.declaration.declarations;
62690
62824
  }
62691
- if (!(data !== null && data !== void 0 && (_data$cpt4 = data.cpt) !== null && _data$cpt4 !== void 0 && _data$cpt4.details)) {
62825
+ if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.details)) {
62692
62826
  var _propertyDetails$Prop6;
62693
62827
  data.cpt = {
62694
62828
  details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop6 = propertyDetails.Properties) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6[0]
@@ -62713,7 +62847,7 @@ const OLDApplication = () => {
62713
62847
  departmentType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.departmentType,
62714
62848
  temporaryConnection: connDetail === null || connDetail === void 0 ? void 0 : connDetail.temporaryType,
62715
62849
  waterDemandType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.waterDemandType,
62716
- ownerContactNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde6 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde6 === void 0 ? void 0 : (_data$ConnectionHolde7 = _data$ConnectionHolde6[0]) === null || _data$ConnectionHolde7 === void 0 ? void 0 : _data$ConnectionHolde7.mobileNumber) || (data === null || data === void 0 ? void 0 : (_data$cpt5 = data.cpt) === null || _data$cpt5 === void 0 ? void 0 : (_data$cpt5$details = _data$cpt5.details) === null || _data$cpt5$details === void 0 ? void 0 : (_data$cpt5$details$ow = _data$cpt5$details.owners) === null || _data$cpt5$details$ow === void 0 ? void 0 : (_data$cpt5$details$ow2 = _data$cpt5$details$ow[0]) === null || _data$cpt5$details$ow2 === void 0 ? void 0 : _data$cpt5$details$ow2.mobileNumber)
62850
+ ownerContactNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde6 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde6 === void 0 ? void 0 : (_data$ConnectionHolde7 = _data$ConnectionHolde6[0]) === null || _data$ConnectionHolde7 === void 0 ? void 0 : _data$ConnectionHolde7.mobileNumber) || (data === null || data === void 0 ? void 0 : (_data$cpt2 = data.cpt) === null || _data$cpt2 === void 0 ? void 0 : (_data$cpt2$details = _data$cpt2.details) === null || _data$cpt2$details === void 0 ? void 0 : (_data$cpt2$details$ow = _data$cpt2$details.owners) === null || _data$cpt2$details$ow === void 0 ? void 0 : (_data$cpt2$details$ow2 = _data$cpt2$details$ow[0]) === null || _data$cpt2$details$ow2 === void 0 ? void 0 : _data$cpt2$details$ow2.mobileNumber)
62717
62851
  };
62718
62852
  return Promise.resolve(createPayloadOfWS(data)).then(function (payload) {
62719
62853
  if (!(payload !== null && payload !== void 0 && payload.water) && !(payload !== null && payload !== void 0 && payload.sewerage)) {
@@ -62960,8 +63094,8 @@ const OLDApplication = () => {
62960
63094
  currentActiveIndex: 9,
62961
63095
  showFinalStep: false
62962
63096
  }), /*#__PURE__*/React__default.createElement(CheckPage$4, {
62963
- data: sessionFormData,
62964
- onSubmit: finalData => processSubmission(finalData || sessionFormData),
63097
+ data: formDataRef.current || sessionFormData,
63098
+ onSubmit: finalData => processSubmission(finalData || formDataRef.current || sessionFormData),
62965
63099
  onEdit: () => setShowCheckPage(false)
62966
63100
  })));
62967
63101
  }
@@ -62978,7 +63112,7 @@ const OLDApplication = () => {
62978
63112
  isDisabled: !canSubmit,
62979
63113
  label: creatingWaterApplicationLoading || creatingSewerageApplicationLoading || updatingWaterApplicationLoading || updatingSewerageApplicationLoading ? t("CS_COMMON_SUBMITTING") : t("CS_COMMON_NEXT"),
62980
63114
  onSubmit: onFormSubmit,
62981
- defaultValues: sessionFormData,
63115
+ defaultValues: defaultValues,
62982
63116
  noCard: true,
62983
63117
  noBreakLine: true,
62984
63118
  cardFormWrapperClassName: "new-application-card"
@@ -63067,19 +63201,26 @@ const FitterSandbox = _ref => {
63067
63201
  status: "ACTIVE",
63068
63202
  isVerified: false
63069
63203
  }];
63070
- payload.connectionExecutionDate = Date.now();
63071
- payload.disconnectionExecutionDate = Date.now();
63204
+ const currentDate = Date.now();
63205
+ const actionToExecute = (action === null || action === void 0 ? void 0 : action.action) || (typeof action === "string" ? action : "EXECUTE_DISCONNECTION");
63206
+ payload.connectionExecutionDate = currentDate;
63207
+ payload.disconnectionExecutionDate = currentDate;
63208
+ payload.action = actionToExecute;
63072
63209
  payload.wfDocuments = docArray;
63073
63210
  payload.documents = [...(payload.documents || []), ...docArray];
63074
63211
  payload.additionalDetails = {
63075
63212
  ...payload.additionalDetails,
63076
63213
  finalMeterReading: meterReading,
63214
+ disconnectionExecutionDate: currentDate,
63077
63215
  disconnectionGpsLocation: gpsLocation.replace(/<[^>]*>?/gm, ""),
63078
63216
  disconnectionTimestamp: timestamp.replace(/<[^>]*>?/gm, "")
63079
63217
  };
63218
+ if (Array.isArray(payload.disConnectionDetails) && payload.disConnectionDetails.length > 0) {
63219
+ payload.disConnectionDetails[0].disconnectionExecutionDate = currentDate;
63220
+ }
63080
63221
  payload.processInstance = {
63081
63222
  ...payload.processInstance,
63082
- action: action === null || action === void 0 ? void 0 : action.action,
63223
+ action: actionToExecute,
63083
63224
  comment: `Meter Reading: ${meterReading} m3`,
63084
63225
  documents: docArray
63085
63226
  };