@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.
@@ -13250,7 +13250,7 @@ const WSConnectionDetails = _ref => {
13250
13250
  if ((formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD2 = formData.ConnectionDetails) === null || _formData$ConnectionD2 === void 0 ? void 0 : _formData$ConnectionD2.length) > 0) {
13251
13251
  const incoming = formData.ConnectionDetails[0];
13252
13252
  const current = connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails[0];
13253
- 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)) {
13253
+ if (!lodash.isEqual(current, incoming)) {
13254
13254
  setConnectionDetails([incoming]);
13255
13255
  }
13256
13256
  }
@@ -13323,9 +13323,6 @@ const WSConnectionDetails = _ref => {
13323
13323
  }, [commonMastersData]);
13324
13324
  useEffect(() => {
13325
13325
  var _connectionDetails$, _connectionDetails$2;
13326
- if (userType === "employee") {
13327
- onSelect(config.key, connectionDetails);
13328
- }
13329
13326
  if (connectionDetails !== null && connectionDetails !== void 0 && (_connectionDetails$ = connectionDetails[0]) !== null && _connectionDetails$ !== void 0 && _connectionDetails$.water) setWaterSewarageSelection({
13330
13327
  water: true,
13331
13328
  sewerage: false
@@ -13336,7 +13333,7 @@ const WSConnectionDetails = _ref => {
13336
13333
  });
13337
13334
  }, [connectionDetails]);
13338
13335
  useEffect(() => {
13339
- if (!(formData !== null && formData !== void 0 && formData.ConnectionDetails)) {
13336
+ if (!(formData !== null && formData !== void 0 && formData.ConnectionDetails) && (connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails.length) === 0) {
13340
13337
  setConnectionDetails([createConnectionDetails()]);
13341
13338
  }
13342
13339
  }, [formData === null || formData === void 0 ? void 0 : formData.ConnectionDetails]);
@@ -13892,8 +13889,10 @@ const WSRoadCuttingDetails = _ref => {
13892
13889
  })) : setRoadCuttingDetails(prev => prev.filter(o => o.key != roadCutt.key));
13893
13890
  };
13894
13891
  useEffect(() => {
13895
- onSelect(config === null || config === void 0 ? void 0 : config.key, roadCuttingDetails);
13896
- }, [roadCuttingDetails]);
13892
+ if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], roadCuttingDetails)) {
13893
+ onSelect(config === null || config === void 0 ? void 0 : config.key, roadCuttingDetails);
13894
+ }
13895
+ }, [roadCuttingDetails, config === null || config === void 0 ? void 0 : config.key]);
13897
13896
  const commonProps = {
13898
13897
  focusIndex,
13899
13898
  allRoadCuttingDetails: roadCuttingDetails,
@@ -14315,18 +14314,11 @@ const WSConnectionHolderDetails = _ref => {
14315
14314
  const data = connectionHolderDetails.map(e => {
14316
14315
  return e;
14317
14316
  });
14318
- onSelect(config === null || config === void 0 ? void 0 : config.key, data);
14319
- }
14320
- }, [connectionHolderDetails]);
14321
- useEffect(() => {
14322
- if (userType === "employee") {
14323
- var _formData$config$key;
14324
- onSelect(config.key, [{
14325
- ...((_formData$config$key = formData[config.key]) === null || _formData$config$key === void 0 ? void 0 : _formData$config$key[0]),
14326
- ...(connectionHolderDetails === null || connectionHolderDetails === void 0 ? void 0 : connectionHolderDetails[0])
14327
- }]);
14317
+ if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], data)) {
14318
+ onSelect(config === null || config === void 0 ? void 0 : config.key, data);
14319
+ }
14328
14320
  }
14329
- }, [connectionHolderDetails]);
14321
+ }, [connectionHolderDetails, config === null || config === void 0 ? void 0 : config.key]);
14330
14322
  function ispagereloadingenabled(eyeclick) {
14331
14323
  var _Object$values, _formData$ConnectionH2;
14332
14324
  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) {
@@ -16460,8 +16452,10 @@ const WSActivationPlumberDetails = _ref => {
16460
16452
  const data = plumberDetails.length && plumberDetails.map(e => {
16461
16453
  return e;
16462
16454
  });
16463
- onSelect(config === null || config === void 0 ? void 0 : config.key, data);
16464
- }, [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]);
16455
+ if (data && !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], data)) {
16456
+ onSelect(config === null || config === void 0 ? void 0 : config.key, data);
16457
+ }
16458
+ }, [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]);
16465
16459
  const commonProps = {
16466
16460
  focusIndex,
16467
16461
  allOwners: plumberDetails,
@@ -18911,9 +18905,12 @@ const WSDocumentsEmployee = _ref => {
18911
18905
  };
18912
18906
  onSelect(config.key, documentStep);
18913
18907
  } else {
18914
- onSelect(config.key, {
18908
+ const docPayload = {
18915
18909
  documents: removeDuplicateOtherDocuments(documents)
18916
- });
18910
+ };
18911
+ if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config.key], docPayload)) {
18912
+ onSelect(config.key, docPayload);
18913
+ }
18917
18914
  }
18918
18915
  };
18919
18916
  const downloadDocument = function () {
@@ -25854,7 +25851,7 @@ const WSDjbEmployee = _ref => {
25854
25851
  };
25855
25852
 
25856
25853
  const WSDivyangjan = _ref => {
25857
- var _formData$disability, _formData$additionalD;
25854
+ var _formData$disability, _formData$additionalD, _formData$config$key2;
25858
25855
  let {
25859
25856
  config,
25860
25857
  onSelect,
@@ -25883,11 +25880,16 @@ const WSDivyangjan = _ref => {
25883
25880
  }, [onSelect]);
25884
25881
  useEffect(() => {
25885
25882
  if (userType === "employee") {
25886
- onSelectRef.current(config.key, {
25887
- isDivyangjan: !!formValue.isDivyangjan
25888
- });
25883
+ var _formData$config$key;
25884
+ 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;
25885
+ const newVal = !!formValue.isDivyangjan;
25886
+ if (currentVal !== newVal) {
25887
+ onSelectRef.current(config.key, {
25888
+ isDivyangjan: newVal
25889
+ });
25890
+ }
25889
25891
  }
25890
- }, [config.key, formValue.isDivyangjan, userType]);
25892
+ }, [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]);
25891
25893
  const content = /*#__PURE__*/React.createElement(CollapsibleCardPage, {
25892
25894
  title: t("Are you a Divyangjan/Person with Disability?"),
25893
25895
  defaultOpen: true
@@ -29491,11 +29493,7 @@ const WSCard = () => {
29491
29493
  setTotalCount(waterCount);
29492
29494
  }
29493
29495
  }, [wsData]);
29494
- let links = [{
29495
- label: t("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),
29496
- link: `/digit-ui/employee/ws/info`,
29497
- roles: ["WS_CEMP", "SW_CEMP"]
29498
- }];
29496
+ let links = [];
29499
29497
  links = links.filter(link => link.roles ? checkForEmployee(link.roles) : true);
29500
29498
  const propsForModuleCard = {
29501
29499
  Icon: /*#__PURE__*/React.createElement(WSICon, null),
@@ -29513,43 +29511,43 @@ const WSCard = () => {
29513
29511
  count: isWSInboxLoading ? "-" : wsData === null || wsData === void 0 ? void 0 : wsData.totalCount,
29514
29512
  label: t("WATER_INBOX"),
29515
29513
  link: `/digit-ui/employee/ws/water/inbox`,
29516
- roles: ["WS_CEMP", "WS_APPROVER", "EE", "WS_DEALING_CLERK", "WS_CLERK"]
29514
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29517
29515
  }, {
29518
29516
  label: t("WS_BILL_AMENDMENT_INBOX", "Bill Amendment Inbox"),
29519
29517
  link: `/digit-ui/employee/ws/water/bill-amendment/inbox`,
29520
- roles: ["WS_CEMP", "WS_APPROVER", "EE", "WS_DEALING_CLERK", "WS_CLERK", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER"]
29518
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29521
29519
  }, {
29522
29520
  label: t("WS_BILL_AMENDMENT_APPLICATION_SEARCH", "Search Bill Amendment Application"),
29523
29521
  link: `/digit-ui/employee/ws/water/bill-amendment/search-application`,
29524
- roles: ["WS_CEMP", "WS_APPROVER", "EE", "WS_DEALING_CLERK", "WS_CLERK", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER"]
29522
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29525
29523
  }, ...links, {
29526
29524
  label: t("WS_WATER_CONNECTION_SEARCH_LABEL"),
29527
29525
  link: `/digit-ui/employee/ws/water/search-connection`,
29528
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
29526
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29529
29527
  }, {
29530
29528
  label: t("WS_WATER_APPLICATION_SEARCH"),
29531
29529
  link: `/digit-ui/employee/ws/water/search-application`,
29532
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
29530
+ roles: ["WS_CEMP", "WS_ZRO", "EE"]
29533
29531
  }, {
29534
29532
  label: t("WS_CALCULATION"),
29535
29533
  link: `/digit-ui/employee/ws/water/calculation`,
29536
- roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
29534
+ roles: ["WS_CEMP", "WS_ZRO"]
29537
29535
  }, {
29538
29536
  label: t("WS_APPLY_MUTATION"),
29539
29537
  link: `/digit-ui/employee/ws/mutation-application`,
29540
- 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"]
29538
+ roles: []
29541
29539
  }, {
29542
29540
  label: t("WS_ZRO_VERIFICATION"),
29543
29541
  link: `/digit-ui/employee/ws/zro-application`,
29544
- 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"]
29542
+ roles: ["WS_CEMP", "WS_ZRO"]
29545
29543
  }, {
29546
29544
  label: t("WS_DISCONNECTION"),
29547
29545
  link: `/digit-ui/employee/ws/new-disconnection`,
29548
- 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"]
29546
+ roles: []
29549
29547
  }, {
29550
29548
  label: t("WS_RECONNECTION"),
29551
29549
  link: `/digit-ui/employee/ws/new-restoration`,
29552
- 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"]
29550
+ roles: []
29553
29551
  }].filter(link => link.roles ? checkForEmployee(link.roles) : true)
29554
29552
  };
29555
29553
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
@@ -29598,11 +29596,7 @@ const SWCard = () => {
29598
29596
  setTotalCount(sewerageCount);
29599
29597
  }
29600
29598
  }, [swData]);
29601
- let links = [{
29602
- label: t("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),
29603
- link: `/digit-ui/employee/ws/create-application`,
29604
- roles: ["WS_CEMP", "SW_CEMP"]
29605
- }];
29599
+ let links = [];
29606
29600
  links = links.filter(link => link.roles ? checkForEmployee(link.roles) : true);
29607
29601
  const propsForModuleCard = {
29608
29602
  Icon: /*#__PURE__*/React.createElement(WSICon, null),
@@ -36973,10 +36967,122 @@ const ConsumptionDetails = _ref => {
36973
36967
  });
36974
36968
  };
36975
36969
  const consumption = (currentReading, lastReading) => {
36976
- if (currentReading && lastReading) {
36970
+ if (currentReading !== null && currentReading !== undefined && lastReading !== null && lastReading !== undefined && currentReading !== "" && lastReading !== "") {
36977
36971
  return Number(currentReading - lastReading);
36978
36972
  } else return t("NA");
36979
36973
  };
36974
+ const columns = useMemo(() => [{
36975
+ Header: t("WS_MYCONNECTIONS_CONSUMER_NO"),
36976
+ accessor: "connectionNo",
36977
+ disableSortBy: true,
36978
+ Cell: _ref2 => {
36979
+ var _row$original;
36980
+ let {
36981
+ row
36982
+ } = _ref2;
36983
+ return /*#__PURE__*/React.createElement("span", null, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.connectionNo) || t("NA"));
36984
+ }
36985
+ }, {
36986
+ Header: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
36987
+ accessor: "billingPeriod",
36988
+ disableSortBy: true,
36989
+ Cell: _ref3 => {
36990
+ var _row$original2;
36991
+ let {
36992
+ row
36993
+ } = _ref3;
36994
+ return /*#__PURE__*/React.createElement("span", null, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.billingPeriod) || t("NA"));
36995
+ }
36996
+ }, {
36997
+ Header: t("WS_READING_QUALITY_CODE"),
36998
+ accessor: "readingQualityCode",
36999
+ disableSortBy: true,
37000
+ Cell: _ref4 => {
37001
+ var _row$original3;
37002
+ let {
37003
+ row
37004
+ } = _ref4;
37005
+ return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.readingQualityCode) || t("NA"));
37006
+ }
37007
+ }, {
37008
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
37009
+ accessor: "lastReading",
37010
+ disableSortBy: true,
37011
+ Cell: _ref5 => {
37012
+ var _row$original4, _row$original5, _row$original6;
37013
+ let {
37014
+ row
37015
+ } = _ref5;
37016
+ return /*#__PURE__*/React.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"));
37017
+ }
37018
+ }, {
37019
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
37020
+ accessor: "lastReadingDate",
37021
+ disableSortBy: true,
37022
+ Cell: _ref6 => {
37023
+ var _row$original7, _row$original8;
37024
+ let {
37025
+ row
37026
+ } = _ref6;
37027
+ return /*#__PURE__*/React.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"));
37028
+ }
37029
+ }, {
37030
+ Header: t("WS_SERV_DETAIL_CUR_METER_READ"),
37031
+ accessor: "currentReading",
37032
+ disableSortBy: true,
37033
+ Cell: _ref7 => {
37034
+ var _row$original9, _row$original0, _row$original1;
37035
+ let {
37036
+ row
37037
+ } = _ref7;
37038
+ return /*#__PURE__*/React.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"));
37039
+ }
37040
+ }, {
37041
+ Header: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
37042
+ accessor: "currentReadingDate",
37043
+ disableSortBy: true,
37044
+ Cell: _ref8 => {
37045
+ var _row$original10, _row$original11;
37046
+ let {
37047
+ row
37048
+ } = _ref8;
37049
+ return /*#__PURE__*/React.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"));
37050
+ }
37051
+ }, {
37052
+ Header: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
37053
+ id: "consumption",
37054
+ disableSortBy: true,
37055
+ Cell: _ref9 => {
37056
+ var _row$original12, _row$original13;
37057
+ let {
37058
+ row
37059
+ } = _ref9;
37060
+ return /*#__PURE__*/React.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));
37061
+ }
37062
+ }, {
37063
+ Header: t("WS_COMMON_TABLE_COL_ACTION_LABEL"),
37064
+ id: "action",
37065
+ disableSortBy: true,
37066
+ Cell: _ref0 => {
37067
+ let {
37068
+ row
37069
+ } = _ref0;
37070
+ return /*#__PURE__*/React.createElement(SubmitBar, {
37071
+ style: {
37072
+ backgroundColor: "#0A4275",
37073
+ color: "#FFFFFF",
37074
+ minWidth: "auto",
37075
+ padding: "6px 14px",
37076
+ fontSize: "12px",
37077
+ height: "auto",
37078
+ margin: "0px",
37079
+ whiteSpace: "nowrap"
37080
+ },
37081
+ label: t("VIEW_METER_READING_DETAILS"),
37082
+ onSubmit: () => handleViewMeterReadingDetails(row.original)
37083
+ });
37084
+ }
37085
+ }], [t]);
36980
37086
  if (isLoading) {
36981
37087
  return /*#__PURE__*/React.createElement(Loader, null);
36982
37088
  }
@@ -36984,90 +37090,32 @@ const ConsumptionDetails = _ref => {
36984
37090
  meterReadings
36985
37091
  } = data || {};
36986
37092
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
36987
- className: "employee-form-section-wrapper",
36988
- style: {
36989
- display: "flex",
36990
- gap: "16px",
36991
- width: "100%"
36992
- }
36993
- }, /*#__PURE__*/React.createElement(VerticalTimeline, {
36994
- config: [{
36995
- timeLine: [{
36996
- actions: "WS_VIEW_CONSUMPTION",
36997
- currentStep: 1
36998
- }]
36999
- }],
37000
- showFinalStep: false
37001
- }), /*#__PURE__*/React.createElement("div", {
37002
37093
  style: {
37003
37094
  flex: 1,
37004
37095
  display: "flex",
37005
37096
  flexDirection: "column",
37006
- gap: "16px"
37007
- }
37008
- }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 && meterReadings.map((application, index) => /*#__PURE__*/React.createElement("div", {
37009
- key: index
37010
- }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
37011
- style: {
37012
- display: "flex",
37013
- justifyContent: "flex-end",
37014
- marginBottom: "16px",
37015
- marginTop: "8px",
37016
- marginRight: "8px"
37097
+ gap: "16px",
37098
+ minWidth: 0,
37099
+ overflowX: "auto"
37017
37100
  }
37018
- }, /*#__PURE__*/React.createElement(SubmitBar, {
37019
- style: {
37020
- backgroundColor: "#0A4275",
37021
- color: "#FFFFFF"
37022
- },
37023
- label: t("VIEW_METER_READING_DETAILS"),
37024
- onSubmit: () => handleViewMeterReadingDetails(application)
37025
- })), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
37026
- key: t("WS_MYCONNECTIONS_CONSUMER_NO"),
37027
- label: `${t("WS_MYCONNECTIONS_CONSUMER_NO")}`,
37028
- text: (application === null || application === void 0 ? void 0 : application.connectionNo) || t("NA"),
37029
- className: "border-none"
37030
- }), /*#__PURE__*/React.createElement(Row, {
37031
- key: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
37032
- label: `${t("WS_VIEW_BILL_BILLING_PERIOD_LABEL")}`,
37033
- text: (application === null || application === void 0 ? void 0 : application.billingPeriod) || t("NA"),
37034
- className: "border-none"
37035
- }), /*#__PURE__*/React.createElement(Row, {
37036
- key: t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),
37037
- label: `${t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL")}`,
37038
- text: (application === null || application === void 0 ? void 0 : application.meterStatus) || t("NA"),
37039
- className: "border-none"
37040
- }), /*#__PURE__*/React.createElement(Row, {
37041
- key: t("WS_READING_QUALITY_CODE"),
37042
- label: `${t("WS_READING_QUALITY_CODE")}`,
37043
- text: (application === null || application === void 0 ? void 0 : application.readingQualityCode) || t("NA"),
37044
- className: "border-none"
37045
- }), /*#__PURE__*/React.createElement(Row, {
37046
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
37047
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL")}`,
37048
- text: (application === null || application === void 0 ? void 0 : application.lastReading) || t("NA"),
37049
- className: "border-none"
37050
- }), /*#__PURE__*/React.createElement(Row, {
37051
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
37052
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL")}`,
37053
- text: application !== null && application !== void 0 && application.lastReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.lastReadingDate) : t("NA"),
37054
- className: "border-none"
37055
- }), /*#__PURE__*/React.createElement(Row, {
37056
- key: t("WS_SERV_DETAIL_CUR_METER_READ"),
37057
- label: `${t("WS_SERV_DETAIL_CUR_METER_READ")}`,
37058
- text: (application === null || application === void 0 ? void 0 : application.currentReading) || t("NA"),
37059
- className: "border-none"
37060
- }), /*#__PURE__*/React.createElement(Row, {
37061
- key: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
37062
- label: `${t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL")}`,
37063
- text: application !== null && application !== void 0 && application.currentReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.currentReadingDate) : t("NA"),
37064
- className: "border-none"
37065
- }), /*#__PURE__*/React.createElement(Row, {
37066
- key: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
37067
- label: `${t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL")}`,
37068
- text: consumption(application === null || application === void 0 ? void 0 : application.currentReading, application === null || application === void 0 ? void 0 : application.lastReading),
37069
- className: "border-none"
37070
- }))))), !(meterReadings !== null && meterReadings !== void 0 && meterReadings.length) > 0 && /*#__PURE__*/React.createElement("p", {
37101
+ }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 ? /*#__PURE__*/React.createElement(Table, {
37102
+ t: t,
37103
+ data: meterReadings,
37104
+ columns: columns,
37105
+ totalRecords: meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length,
37106
+ manualPagination: false,
37107
+ isPaginationRequired: true,
37108
+ pageSizeLimit: 10,
37109
+ disableSort: true,
37110
+ autoSort: false,
37111
+ getCellProps: () => ({
37112
+ style: {
37113
+ whiteSpace: "nowrap",
37114
+ padding: "16px 14px",
37115
+ fontSize: "14px"
37116
+ }
37117
+ })
37118
+ }) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("p", {
37071
37119
  style: {
37072
37120
  marginLeft: "16px",
37073
37121
  marginTop: "16px"
@@ -55571,7 +55619,7 @@ const EditApplication$1 = () => {
55571
55619
  };
55572
55620
 
55573
55621
  const ConsumptionDetails$1 = _ref => {
55574
- 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;
55622
+ 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;
55575
55623
  const {
55576
55624
  t
55577
55625
  } = useTranslation();
@@ -55813,11 +55861,14 @@ const ConsumptionDetails$1 = _ref => {
55813
55861
  return Promise.reject(e);
55814
55862
  }
55815
55863
  };
55816
- 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 => ({
55817
- code: status,
55818
- i18nKey: `WS_SERVICES_CALCULATION_METERSTATUS_${Digit.Utils.locale.getTransformedLocale(status)}`
55819
- }));
55820
- 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 => {
55864
+ 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 => {
55865
+ const statusCode = typeof status === "object" ? status.name || status.code : status;
55866
+ return {
55867
+ code: statusCode,
55868
+ i18nKey: `WS_SERVICES_CALCULATION_METERSTATUS_${Digit.Utils.locale.getTransformedLocale(statusCode)}`
55869
+ };
55870
+ });
55871
+ 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 => {
55821
55872
  const statusCode = typeof status === "object" ? status.code : status;
55822
55873
  return {
55823
55874
  code: statusCode,
@@ -55974,10 +56025,122 @@ const ConsumptionDetails$1 = _ref => {
55974
56025
  }, /*#__PURE__*/React.createElement(Close, null));
55975
56026
  };
55976
56027
  const consumption = (currentReading, lastReading) => {
55977
- if (currentReading && lastReading) {
56028
+ if (currentReading !== null && currentReading !== undefined && lastReading !== null && lastReading !== undefined && currentReading !== "" && lastReading !== "") {
55978
56029
  return Number(currentReading - lastReading);
55979
56030
  } else return t("NA");
55980
56031
  };
56032
+ const columns = useMemo(() => [{
56033
+ Header: t("WS_MYCONNECTIONS_CONSUMER_NO"),
56034
+ accessor: "connectionNo",
56035
+ disableSortBy: true,
56036
+ Cell: _ref2 => {
56037
+ var _row$original;
56038
+ let {
56039
+ row
56040
+ } = _ref2;
56041
+ return /*#__PURE__*/React.createElement("span", null, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.connectionNo) || t("NA"));
56042
+ }
56043
+ }, {
56044
+ Header: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
56045
+ accessor: "billingPeriod",
56046
+ disableSortBy: true,
56047
+ Cell: _ref3 => {
56048
+ var _row$original2;
56049
+ let {
56050
+ row
56051
+ } = _ref3;
56052
+ return /*#__PURE__*/React.createElement("span", null, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.billingPeriod) || t("NA"));
56053
+ }
56054
+ }, {
56055
+ Header: t("WS_READING_QUALITY_CODE"),
56056
+ accessor: "readingQualityCode",
56057
+ disableSortBy: true,
56058
+ Cell: _ref4 => {
56059
+ var _row$original3;
56060
+ let {
56061
+ row
56062
+ } = _ref4;
56063
+ return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.readingQualityCode) || t("NA"));
56064
+ }
56065
+ }, {
56066
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
56067
+ accessor: "lastReading",
56068
+ disableSortBy: true,
56069
+ Cell: _ref5 => {
56070
+ var _row$original4, _row$original5, _row$original6;
56071
+ let {
56072
+ row
56073
+ } = _ref5;
56074
+ return /*#__PURE__*/React.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"));
56075
+ }
56076
+ }, {
56077
+ Header: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
56078
+ accessor: "lastReadingDate",
56079
+ disableSortBy: true,
56080
+ Cell: _ref6 => {
56081
+ var _row$original7, _row$original8;
56082
+ let {
56083
+ row
56084
+ } = _ref6;
56085
+ return /*#__PURE__*/React.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"));
56086
+ }
56087
+ }, {
56088
+ Header: t("WS_SERV_DETAIL_CUR_METER_READ"),
56089
+ accessor: "currentReading",
56090
+ disableSortBy: true,
56091
+ Cell: _ref7 => {
56092
+ var _row$original9, _row$original0, _row$original1;
56093
+ let {
56094
+ row
56095
+ } = _ref7;
56096
+ return /*#__PURE__*/React.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"));
56097
+ }
56098
+ }, {
56099
+ Header: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
56100
+ accessor: "currentReadingDate",
56101
+ disableSortBy: true,
56102
+ Cell: _ref8 => {
56103
+ var _row$original10, _row$original11;
56104
+ let {
56105
+ row
56106
+ } = _ref8;
56107
+ return /*#__PURE__*/React.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"));
56108
+ }
56109
+ }, {
56110
+ Header: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
56111
+ id: "consumption",
56112
+ disableSortBy: true,
56113
+ Cell: _ref9 => {
56114
+ var _row$original12, _row$original13;
56115
+ let {
56116
+ row
56117
+ } = _ref9;
56118
+ return /*#__PURE__*/React.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));
56119
+ }
56120
+ }, {
56121
+ Header: t("WS_COMMON_TABLE_COL_ACTION_LABEL"),
56122
+ id: "action",
56123
+ disableSortBy: true,
56124
+ Cell: _ref0 => {
56125
+ let {
56126
+ row
56127
+ } = _ref0;
56128
+ return /*#__PURE__*/React.createElement(SubmitBar, {
56129
+ style: {
56130
+ backgroundColor: "#0A4275",
56131
+ color: "#FFFFFF",
56132
+ minWidth: "auto",
56133
+ padding: "6px 14px",
56134
+ fontSize: "12px",
56135
+ height: "auto",
56136
+ margin: "0px",
56137
+ whiteSpace: "nowrap"
56138
+ },
56139
+ label: t("VIEW_METER_READING_DETAILS"),
56140
+ onSubmit: () => handleViewMeterReadingDetails(row.original)
56141
+ });
56142
+ }
56143
+ }], [t]);
55981
56144
  if (isLoading || isConnectionDetailsLoading) {
55982
56145
  return /*#__PURE__*/React.createElement(Loader, null);
55983
56146
  }
@@ -55985,89 +56148,40 @@ const ConsumptionDetails$1 = _ref => {
55985
56148
  meterReadings
55986
56149
  } = response || {};
55987
56150
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
55988
- className: "employee-form-section-wrapper"
55989
- }, /*#__PURE__*/React.createElement(VerticalTimeline, {
55990
- config: [{
55991
- timeLine: [{
55992
- actions: "WS_VIEW_CONSUMPTION",
55993
- currentStep: 1
55994
- }]
55995
- }],
55996
- showFinalStep: false
55997
- }), /*#__PURE__*/React.createElement("div", {
55998
56151
  style: {
55999
56152
  flex: 1,
56000
56153
  display: "flex",
56001
56154
  flexDirection: "column",
56002
- gap: "16px"
56003
- }
56004
- }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 && meterReadings.map((application, index) => /*#__PURE__*/React.createElement("div", {
56005
- key: index
56006
- }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
56007
- style: {
56008
- display: "flex",
56009
- justifyContent: "flex-end",
56010
- marginBottom: "16px",
56011
- marginTop: "8px",
56012
- marginRight: "8px"
56155
+ gap: "16px",
56156
+ minWidth: 0,
56157
+ overflowX: "auto"
56013
56158
  }
56014
- }, /*#__PURE__*/React.createElement(SubmitBar, {
56015
- label: t("VIEW_METER_READING_DETAILS"),
56016
- onSubmit: () => handleViewMeterReadingDetails(application)
56017
- })), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
56018
- key: t("WS_MYCONNECTIONS_CONSUMER_NO"),
56019
- label: `${t("WS_MYCONNECTIONS_CONSUMER_NO")}`,
56020
- text: (application === null || application === void 0 ? void 0 : application.connectionNo) || t("NA"),
56021
- className: "border-none"
56022
- }), /*#__PURE__*/React.createElement(Row, {
56023
- key: t("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),
56024
- label: `${t("WS_VIEW_BILL_BILLING_PERIOD_LABEL")}`,
56025
- text: (application === null || application === void 0 ? void 0 : application.billingPeriod) || t("NA"),
56026
- className: "border-none"
56027
- }), /*#__PURE__*/React.createElement(Row, {
56028
- key: t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),
56029
- label: `${t("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL")}`,
56030
- text: (application === null || application === void 0 ? void 0 : application.meterStatus) || t("NA"),
56031
- className: "border-none"
56032
- }), /*#__PURE__*/React.createElement(Row, {
56033
- key: t("WS_READING_QUALITY_CODE"),
56034
- label: `${t("WS_READING_QUALITY_CODE")}`,
56035
- text: (application === null || application === void 0 ? void 0 : application.readingQualityCode) || t("NA"),
56036
- className: "border-none"
56037
- }), /*#__PURE__*/React.createElement(Row, {
56038
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),
56039
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL")}`,
56040
- text: (application === null || application === void 0 ? void 0 : application.lastReading) || t("NA"),
56041
- className: "border-none"
56042
- }), /*#__PURE__*/React.createElement(Row, {
56043
- key: t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),
56044
- label: `${t("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL")}`,
56045
- text: application !== null && application !== void 0 && application.lastReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.lastReadingDate) : t("NA"),
56046
- className: "border-none"
56047
- }), /*#__PURE__*/React.createElement(Row, {
56048
- key: t("WS_SERV_DETAIL_CUR_METER_READ"),
56049
- label: `${t("WS_SERV_DETAIL_CUR_METER_READ")}`,
56050
- text: (application === null || application === void 0 ? void 0 : application.currentReading) || t("NA"),
56051
- className: "border-none"
56052
- }), /*#__PURE__*/React.createElement(Row, {
56053
- key: t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),
56054
- label: `${t("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL")}`,
56055
- text: application !== null && application !== void 0 && application.currentReadingDate ? Digit.DateUtils.ConvertEpochToDate(application === null || application === void 0 ? void 0 : application.currentReadingDate) : t("NA"),
56056
- className: "border-none"
56057
- }), /*#__PURE__*/React.createElement(Row, {
56058
- key: t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),
56059
- label: `${t("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL")}`,
56060
- text: consumption(application === null || application === void 0 ? void 0 : application.currentReading, application === null || application === void 0 ? void 0 : application.lastReading),
56061
- className: "border-none"
56062
- }))))), !(meterReadings !== null && meterReadings !== void 0 && meterReadings.length) > 0 && /*#__PURE__*/React.createElement("p", {
56159
+ }, (meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length) > 0 ? /*#__PURE__*/React.createElement(Table, {
56160
+ t: t,
56161
+ data: meterReadings,
56162
+ columns: columns,
56163
+ totalRecords: meterReadings === null || meterReadings === void 0 ? void 0 : meterReadings.length,
56164
+ manualPagination: false,
56165
+ isPaginationRequired: true,
56166
+ pageSizeLimit: 10,
56167
+ disableSort: true,
56168
+ autoSort: false,
56169
+ getCellProps: () => ({
56170
+ style: {
56171
+ whiteSpace: "nowrap",
56172
+ padding: "16px 14px",
56173
+ fontSize: "14px"
56174
+ }
56175
+ })
56176
+ }) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("p", {
56063
56177
  style: {
56064
56178
  marginLeft: "16px",
56065
56179
  marginTop: "16px"
56066
56180
  }
56067
- }, t("WS_NO_CONSUMPTION_FOUND"))), isLoading || meterStatusLoading || billingPeriodLoading || !isUserAllowedToAddMeterReading ? null : /*#__PURE__*/React.createElement("div", null, isAddMeterReadingButtonEnable && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
56181
+ }, t("WS_NO_CONSUMPTION_FOUND")))), isLoading || meterStatusLoading || billingPeriodLoading || !isUserAllowedToAddMeterReading ? null : /*#__PURE__*/React.createElement("div", null, isAddMeterReadingButtonEnable && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
56068
56182
  label: t("WS_CONSUMPTION_BUTTON_METER_READING_LABEL"),
56069
56183
  onSubmit: popUp
56070
- })))), openModal && /*#__PURE__*/React.createElement(Modal, {
56184
+ }))), openModal && /*#__PURE__*/React.createElement(Modal, {
56071
56185
  headerBarMain: /*#__PURE__*/React.createElement(Heading, {
56072
56186
  label: t(config.label.heading)
56073
56187
  }),
@@ -62347,9 +62461,6 @@ const OLDApplication = () => {
62347
62461
  const [canSubmit, setSubmitValve] = useState(false);
62348
62462
  const [isEnableLoader, setIsEnableLoader] = useState(false);
62349
62463
  const [showToast, setShowToast] = useState(null);
62350
- const [config, setConfig] = useState({
62351
- body: []
62352
- });
62353
62464
  const [showCheckPage, setShowCheckPage] = useState(false);
62354
62465
  const isCitizen = ((_Digit$UserService$ge = Digit.UserService.getType()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.toUpperCase()) === "CITIZEN";
62355
62466
  const timelineConfig = [{
@@ -62383,15 +62494,21 @@ const OLDApplication = () => {
62383
62494
  tenantId = (_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code;
62384
62495
  }
62385
62496
  const stateId = Digit.ULBService.getStateId();
62497
+ const mdmsOptions = useMemo(() => ({}), []);
62386
62498
  let {
62387
- data: newConfig,
62499
+ data: newConfig$1,
62388
62500
  isLoading
62389
- } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {});
62501
+ } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, mdmsOptions);
62390
62502
  const requestedPropertyId = new URLSearchParams(location.search).get("propertyId");
62391
62503
  const [propertyId, setPropertyId] = useState(requestedPropertyId);
62392
62504
  const initialPropertyId = useRef(requestedPropertyId);
62393
62505
  const verifiedPropertyId = useRef(sessionStorage.getItem("WS_OTP_VERIFIED_PROPERTY_ID"));
62394
62506
  const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {});
62507
+ const formDataRef = useRef(sessionFormData || {});
62508
+ const sessionSaveTimeoutRef = useRef(null);
62509
+ const defaultValues = useMemo(() => {
62510
+ return sessionFormData && Object.keys(sessionFormData).length > 0 ? sessionFormData : Digit.SessionStorage.get("PT_CREATE_EMP_WS_NEW_FORM") || {};
62511
+ }, []);
62395
62512
  const {
62396
62513
  data: propertyDetails
62397
62514
  } = Digit.Hooks.pt.usePropertySearch({
@@ -62416,102 +62533,106 @@ const OLDApplication = () => {
62416
62533
  useEffect(() => {
62417
62534
  sessionStorage.removeItem("FORMSTATE_ERRORS");
62418
62535
  }, []);
62419
- useEffect(() => {
62420
- if (!isLoading && newConfig) {
62421
- const config = newConfig.find(conf => conf.hideInCitizen && conf.isCreate);
62422
- if (config) {
62423
- var _config$body;
62424
- 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)) || [];
62425
- const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "WSDivyangjan", "WSDjbEmployee", "WSPropertyLocationDetails", "PropertyWaterConnection", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSDocumentsEmployee"];
62426
- const reorderedBody = [];
62427
- desiredComponentOrder.forEach(compName => {
62428
- const section = allCreateSections.find(s => {
62429
- var _s$body, _s$body$;
62430
- 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;
62431
- return bodyComp === compName || compName === "WSConnectionDetails" && bodyComp === "WSConnectionDetails";
62432
- });
62433
- if (section) {
62434
- reorderedBody.push(section);
62435
- } else if (compName === "WSPropertyLocationDetails") {
62436
- reorderedBody.push({
62437
- isCreateConnection: true,
62438
- body: [{
62439
- type: "component",
62440
- key: "propertyAddress",
62441
- component: "WSPropertyLocationDetails",
62442
- withoutLabel: true,
62443
- isAutomaticFill: true,
62444
- texts: {
62445
- header: `${t("PT_LOCATION_DETAILS_AUTOMATIC_FILL_BY_PROPERTY")}`
62446
- },
62447
- defaultOpen: false
62448
- }]
62449
- });
62450
- } else if (compName === "PropertyWaterConnection") {
62451
- reorderedBody.push({
62452
- isCreateConnection: true,
62453
- body: [{
62454
- type: "component",
62455
- key: "useDetails",
62456
- component: "PropertyWaterConnection",
62457
- withoutLabel: true,
62458
- isAutomaticFill: true
62459
- }]
62460
- });
62461
- } else if (compName === "WSDeclaration") {
62462
- reorderedBody.push({
62463
- isCreateConnection: true,
62464
- body: [{
62465
- type: "component",
62466
- key: "declarationData",
62467
- component: "WSDeclaration",
62468
- withoutLabel: true
62469
- }]
62470
- });
62471
- } else if (compName === "WSDjbEmployee") {
62472
- reorderedBody.push({
62473
- isCreateConnection: true,
62474
- body: [{
62475
- type: "component",
62476
- key: "djbEmployee",
62477
- component: "WSDjbEmployee",
62478
- withoutLabel: true
62479
- }]
62480
- });
62481
- } else if (compName === "WSDivyangjan") {
62482
- reorderedBody.push({
62483
- isCreateConnection: true,
62484
- body: [{
62485
- type: "component",
62486
- key: "disability",
62487
- component: "WSDivyangjan",
62488
- withoutLabel: true,
62489
- texts: {
62490
- header: "Divyangjan/Person with Disability?"
62491
- }
62492
- }]
62493
- });
62494
- }
62536
+ const config = useMemo(() => {
62537
+ var _configCopy$body;
62538
+ const rawConfigs = newConfig$1 && Array.isArray(newConfig$1) && newConfig$1.length > 0 ? newConfig$1 : newConfig;
62539
+ const foundConfig = rawConfigs === null || rawConfigs === void 0 ? void 0 : rawConfigs.find(conf => conf.hideInCitizen && conf.isCreate);
62540
+ if (!foundConfig) return {
62541
+ body: []
62542
+ };
62543
+ const configCopy = cloneDeep_1(foundConfig);
62544
+ 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)) || [];
62545
+ const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "WSDivyangjan", "WSDjbEmployee", "WSPropertyLocationDetails", "PropertyWaterConnection", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSDocumentsEmployee"];
62546
+ const reorderedBody = [];
62547
+ desiredComponentOrder.forEach(compName => {
62548
+ const section = allCreateSections.find(s => {
62549
+ var _s$body, _s$body$;
62550
+ 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;
62551
+ return bodyComp === compName || compName === "WSConnectionDetails" && bodyComp === "WSConnectionDetails";
62552
+ });
62553
+ if (section) {
62554
+ reorderedBody.push(section);
62555
+ } else if (compName === "WSPropertyLocationDetails") {
62556
+ reorderedBody.push({
62557
+ isCreateConnection: true,
62558
+ body: [{
62559
+ type: "component",
62560
+ key: "propertyAddress",
62561
+ component: "WSPropertyLocationDetails",
62562
+ withoutLabel: true,
62563
+ isAutomaticFill: true,
62564
+ texts: {
62565
+ header: `${t("PT_LOCATION_DETAILS_AUTOMATIC_FILL_BY_PROPERTY")}`
62566
+ },
62567
+ defaultOpen: false
62568
+ }]
62495
62569
  });
62496
- allCreateSections.forEach(section => {
62497
- var _section$body, _section$body$;
62498
- 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;
62499
- if (bodyComp !== "CPTPropertySearchNSummary" && !reorderedBody.find(r => {
62500
- var _r$body, _r$body$;
62501
- 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;
62502
- })) {
62503
- reorderedBody.push(section);
62504
- }
62570
+ } else if (compName === "PropertyWaterConnection") {
62571
+ reorderedBody.push({
62572
+ isCreateConnection: true,
62573
+ body: [{
62574
+ type: "component",
62575
+ key: "useDetails",
62576
+ component: "PropertyWaterConnection",
62577
+ withoutLabel: true,
62578
+ isAutomaticFill: true
62579
+ }]
62580
+ });
62581
+ } else if (compName === "WSDeclaration") {
62582
+ reorderedBody.push({
62583
+ isCreateConnection: true,
62584
+ body: [{
62585
+ type: "component",
62586
+ key: "declarationData",
62587
+ component: "WSDeclaration",
62588
+ withoutLabel: true
62589
+ }]
62590
+ });
62591
+ } else if (compName === "WSDjbEmployee") {
62592
+ reorderedBody.push({
62593
+ isCreateConnection: true,
62594
+ body: [{
62595
+ type: "component",
62596
+ key: "djbEmployee",
62597
+ component: "WSDjbEmployee",
62598
+ withoutLabel: true
62599
+ }]
62600
+ });
62601
+ } else if (compName === "WSDivyangjan") {
62602
+ reorderedBody.push({
62603
+ isCreateConnection: true,
62604
+ body: [{
62605
+ type: "component",
62606
+ key: "disability",
62607
+ component: "WSDivyangjan",
62608
+ withoutLabel: true,
62609
+ texts: {
62610
+ header: "Divyangjan/Person with Disability?"
62611
+ }
62612
+ }]
62505
62613
  });
62506
- config.body = reorderedBody;
62507
- setConfig(config);
62508
62614
  }
62509
- }
62510
- }, [newConfig, isLoading]);
62615
+ });
62616
+ allCreateSections.forEach(section => {
62617
+ var _section$body, _section$body$;
62618
+ 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;
62619
+ if (bodyComp !== "CPTPropertySearchNSummary" && !reorderedBody.find(r => {
62620
+ var _r$body, _r$body$;
62621
+ 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;
62622
+ })) {
62623
+ reorderedBody.push(section);
62624
+ }
62625
+ });
62626
+ configCopy.body = reorderedBody;
62627
+ return configCopy;
62628
+ }, [newConfig$1, t]);
62511
62629
  useEffect(() => {
62512
- var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
62513
- !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);
62514
- }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
62630
+ var _sessionFormData$cpt, _sessionFormData$cpt$, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4;
62631
+ 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);
62632
+ if (!propertyId && cptId) {
62633
+ setPropertyId(cptId);
62634
+ }
62635
+ }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt, propertyId]);
62515
62636
  const {
62516
62637
  isLoading: creatingWaterApplicationLoading,
62517
62638
  mutate: waterMutation
@@ -62529,29 +62650,42 @@ const OLDApplication = () => {
62529
62650
  mutate: sewerageUpdateMutation
62530
62651
  } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
62531
62652
  const onFormValueChange = (setValue, formData, formState) => {
62532
- var _djbData$document, _updatedFormData$cpt, _updatedFormData$cpt$, _propertyDetails$Prop, _propertyDetails$Prop2;
62533
- const updatedFormData = {
62534
- ...sessionFormData,
62653
+ var _formData$cpt, _formData$cpt$details, _formDataRef$current, _formDataRef$current2, _djbData$document, _formDataRef$current3, _formDataRef$current4, _formDataRef$current5, _propertyDetails$Prop, _propertyDetails$Prop2;
62654
+ formDataRef.current = {
62655
+ ...formDataRef.current,
62535
62656
  ...formData
62536
62657
  };
62537
- const cleanedFormData = JSON.parse(JSON.stringify(updatedFormData));
62538
- if (!lodash.isEqual(sessionFormData, cleanedFormData)) {
62539
- setSessionFormData(cleanedFormData);
62658
+ if (sessionSaveTimeoutRef.current) {
62659
+ clearTimeout(sessionSaveTimeoutRef.current);
62540
62660
  }
62661
+ sessionSaveTimeoutRef.current = setTimeout(() => {
62662
+ Digit.SessionStorage.set("PT_CREATE_EMP_WS_NEW_FORM", formDataRef.current);
62663
+ }, 300);
62541
62664
  sessionStorage.setItem("FORMSTATE_ERRORS", JSON.stringify((formState === null || formState === void 0 ? void 0 : formState.errors) || {}));
62542
- const djbData = (updatedFormData === null || updatedFormData === void 0 ? void 0 : updatedFormData.djbEmployee) || (updatedFormData === null || updatedFormData === void 0 ? void 0 : updatedFormData.additionalDetails);
62665
+ 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;
62666
+ if (!propertyId && cptPropId) {
62667
+ setPropertyId(cptPropId);
62668
+ }
62669
+ 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);
62543
62670
  const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
62544
62671
  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));
62545
62672
  const hasErrors = Object.keys((formState === null || formState === void 0 ? void 0 : formState.errors) || {}).length > 0 || isDjbEmpInvalid;
62546
- 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);
62547
- setSubmitValve(!hasErrors && !!hasProperty);
62673
+ 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);
62674
+ const canSubmitNow = !hasErrors && !!hasProperty;
62675
+ setSubmitValve(prev => prev !== canSubmitNow ? canSubmitNow : prev);
62548
62676
  };
62549
62677
  const onFormSubmit = data => {
62550
- var _data$cpt, _data$cpt$details, _propertyDetails$Prop3, _propertyDetails$Prop4, _data$cpt2, _propertyDetails$Prop5, _djbData$document2;
62551
- 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);
62678
+ var _combinedData$cpt, _combinedData$cpt$det, _propertyDetails$Prop3, _propertyDetails$Prop4, _combinedData$cpt2, _propertyDetails$Prop5, _djbData$document2;
62679
+ const combinedData = {
62680
+ ...formDataRef.current,
62681
+ ...data
62682
+ };
62683
+ formDataRef.current = combinedData;
62684
+ Digit.SessionStorage.set("PT_CREATE_EMP_WS_NEW_FORM", combinedData);
62685
+ 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);
62552
62686
  if (!hasProperty) {
62553
62687
  console.warn("[WS] onSubmit EXIT: invalid property", {
62554
- cpt: data === null || data === void 0 ? void 0 : data.cpt,
62688
+ cpt: combinedData === null || combinedData === void 0 ? void 0 : combinedData.cpt,
62555
62689
  propertyDetails
62556
62690
  });
62557
62691
  setShowToast({
@@ -62560,11 +62694,11 @@ const OLDApplication = () => {
62560
62694
  });
62561
62695
  return;
62562
62696
  }
62563
- 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])) {
62564
- var _data$cpt3;
62565
- if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details) || !propertyDetails) {
62697
+ 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])) {
62698
+ var _combinedData$cpt3;
62699
+ if (!(combinedData !== null && combinedData !== void 0 && (_combinedData$cpt3 = combinedData.cpt) !== null && _combinedData$cpt3 !== void 0 && _combinedData$cpt3.details) || !propertyDetails) {
62566
62700
  console.warn("[WS] onSubmit EXIT: invalid property", {
62567
- cpt: data === null || data === void 0 ? void 0 : data.cpt,
62701
+ cpt: combinedData === null || combinedData === void 0 ? void 0 : combinedData.cpt,
62568
62702
  propertyDetails
62569
62703
  });
62570
62704
  setShowToast({
@@ -62574,7 +62708,7 @@ const OLDApplication = () => {
62574
62708
  return;
62575
62709
  }
62576
62710
  }
62577
- const djbData = (data === null || data === void 0 ? void 0 : data.djbEmployee) || (data === null || data === void 0 ? void 0 : data.additionalDetails);
62711
+ const djbData = (combinedData === null || combinedData === void 0 ? void 0 : combinedData.djbEmployee) || (combinedData === null || combinedData === void 0 ? void 0 : combinedData.additionalDetails);
62578
62712
  const isDjbEmp = (djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === true || String(djbData === null || djbData === void 0 ? void 0 : djbData.isDjbEmployee) === "true";
62579
62713
  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));
62580
62714
  if (isDjbEmpInvalid) {
@@ -62588,7 +62722,7 @@ const OLDApplication = () => {
62588
62722
  };
62589
62723
  const processSubmission = function (data) {
62590
62724
  try {
62591
- 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;
62725
+ 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;
62592
62726
  const basePath = window.location.href.includes("/employee") ? "/digit-ui/employee/ws" : "/digit-ui/citizen/ws";
62593
62727
  if (data !== null && data !== void 0 && (_data$useDetails = data.useDetails) !== null && _data$useDetails !== void 0 && _data$useDetails.useDetails) {
62594
62728
  data.useDetails = {
@@ -62685,7 +62819,7 @@ const OLDApplication = () => {
62685
62819
  data.declarationData.agree = data.declaration.agree;
62686
62820
  data.declarationData.declarations = data.declaration.declarations;
62687
62821
  }
62688
- if (!(data !== null && data !== void 0 && (_data$cpt4 = data.cpt) !== null && _data$cpt4 !== void 0 && _data$cpt4.details)) {
62822
+ if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.details)) {
62689
62823
  var _propertyDetails$Prop6;
62690
62824
  data.cpt = {
62691
62825
  details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop6 = propertyDetails.Properties) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6[0]
@@ -62710,7 +62844,7 @@ const OLDApplication = () => {
62710
62844
  departmentType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.departmentType,
62711
62845
  temporaryConnection: connDetail === null || connDetail === void 0 ? void 0 : connDetail.temporaryType,
62712
62846
  waterDemandType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.waterDemandType,
62713
- 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)
62847
+ 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)
62714
62848
  };
62715
62849
  return Promise.resolve(createPayloadOfWS(data)).then(function (payload) {
62716
62850
  if (!(payload !== null && payload !== void 0 && payload.water) && !(payload !== null && payload !== void 0 && payload.sewerage)) {
@@ -62957,8 +63091,8 @@ const OLDApplication = () => {
62957
63091
  currentActiveIndex: 9,
62958
63092
  showFinalStep: false
62959
63093
  }), /*#__PURE__*/React.createElement(CheckPage$4, {
62960
- data: sessionFormData,
62961
- onSubmit: finalData => processSubmission(finalData || sessionFormData),
63094
+ data: formDataRef.current || sessionFormData,
63095
+ onSubmit: finalData => processSubmission(finalData || formDataRef.current || sessionFormData),
62962
63096
  onEdit: () => setShowCheckPage(false)
62963
63097
  })));
62964
63098
  }
@@ -62975,7 +63109,7 @@ const OLDApplication = () => {
62975
63109
  isDisabled: !canSubmit,
62976
63110
  label: creatingWaterApplicationLoading || creatingSewerageApplicationLoading || updatingWaterApplicationLoading || updatingSewerageApplicationLoading ? t("CS_COMMON_SUBMITTING") : t("CS_COMMON_NEXT"),
62977
63111
  onSubmit: onFormSubmit,
62978
- defaultValues: sessionFormData,
63112
+ defaultValues: defaultValues,
62979
63113
  noCard: true,
62980
63114
  noBreakLine: true,
62981
63115
  cardFormWrapperClassName: "new-application-card"
@@ -63064,19 +63198,26 @@ const FitterSandbox = _ref => {
63064
63198
  status: "ACTIVE",
63065
63199
  isVerified: false
63066
63200
  }];
63067
- payload.connectionExecutionDate = Date.now();
63068
- payload.disconnectionExecutionDate = Date.now();
63201
+ const currentDate = Date.now();
63202
+ const actionToExecute = (action === null || action === void 0 ? void 0 : action.action) || (typeof action === "string" ? action : "EXECUTE_DISCONNECTION");
63203
+ payload.connectionExecutionDate = currentDate;
63204
+ payload.disconnectionExecutionDate = currentDate;
63205
+ payload.action = actionToExecute;
63069
63206
  payload.wfDocuments = docArray;
63070
63207
  payload.documents = [...(payload.documents || []), ...docArray];
63071
63208
  payload.additionalDetails = {
63072
63209
  ...payload.additionalDetails,
63073
63210
  finalMeterReading: meterReading,
63211
+ disconnectionExecutionDate: currentDate,
63074
63212
  disconnectionGpsLocation: gpsLocation.replace(/<[^>]*>?/gm, ""),
63075
63213
  disconnectionTimestamp: timestamp.replace(/<[^>]*>?/gm, "")
63076
63214
  };
63215
+ if (Array.isArray(payload.disConnectionDetails) && payload.disConnectionDetails.length > 0) {
63216
+ payload.disConnectionDetails[0].disconnectionExecutionDate = currentDate;
63217
+ }
63077
63218
  payload.processInstance = {
63078
63219
  ...payload.processInstance,
63079
- action: action === null || action === void 0 ? void 0 : action.action,
63220
+ action: actionToExecute,
63080
63221
  comment: `Meter Reading: ${meterReading} m3`,
63081
63222
  documents: docArray
63082
63223
  };