@mseva/digit-ui-module-garbagecollection 1.0.31 → 1.0.33-UAT.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { CardHeader, Toast, CardLabel, TextInput, Dropdown, ActionBar, SubmitBar, MobileNumber, TextArea, FormComposer, Loader as Loader$1, CardSubHeader, StatusTable, Card, CardSectionHeader, Menu, LabelFieldPair, UploadFile, SearchField, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, Header, InboxComposer, AppContainer, BackButton, PrivateRoute, KeyNote, MultiLink, Row, Banner, Modal, CitizenHomeCard, PTIcon } from '@mseva/digit-ui-react-components';
1
+ import { CardHeader, Toast, LabelFieldPair, CardLabel, TextInput, Dropdown, ActionBar, SubmitBar, MobileNumber, TextArea, FormComposer, Loader as Loader$1, CardSubHeader, StatusTable, Card, CardSectionHeader, Menu, UploadFile, SearchField, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, Header, InboxComposer, PrivateRoute, BreadCrumb, AppContainer, KeyNote, MultiLink, Row, Banner, Modal, Table, CitizenHomeCard, PTIcon } from '@mseva/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useRef, Fragment as Fragment$1, useMemo, useReducer, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { useHistory, Link, useLocation, Switch, useRouteMatch, useParams } from 'react-router-dom';
4
+ import { useHistory, Link, useLocation, useRouteMatch, Switch, useParams } from 'react-router-dom';
5
5
  import { useDispatch, useSelector } from 'react-redux';
6
6
  import { useForm, Controller, useFormContext } from 'react-hook-form';
7
7
  import { combineReducers } from 'redux';
@@ -2820,6 +2820,8 @@ const CHBCitizenSecond = ({
2820
2820
  const [loader, setLoader] = useState(false);
2821
2821
  const [showToast, setShowToast] = useState(false);
2822
2822
  const [error, setError] = useState("");
2823
+ const [getPUnits, setPUnits] = useState([]);
2824
+ const [getActiveStatus, setActiveStatus] = useState(false);
2823
2825
  const {
2824
2826
  data: GCData = [],
2825
2827
  isLoading: GCLoading
@@ -2866,7 +2868,7 @@ const CHBCitizenSecond = ({
2866
2868
  const onSubmit = async data => {
2867
2869
  var _currentStepData$venu, _currentStepData$apiR;
2868
2870
  if (currentStepData !== null && currentStepData !== void 0 && (_currentStepData$venu = currentStepData.venueDetails) !== null && _currentStepData$venu !== void 0 && _currentStepData$venu.applicationNo || currentStepData !== null && currentStepData !== void 0 && (_currentStepData$apiR = currentStepData.apiResponseData) !== null && _currentStepData$apiR !== void 0 && _currentStepData$apiR.applicationNo) {
2869
- var _data$frequency, _data$typeOfWaste, _data$propertyType, _data$connectionCateg, _currentStepData$venu2, _data$connectionCateg2;
2871
+ var _data$frequency, _data$typeOfWaste, _data$propertyType, _data$connectionCateg, _currentStepData$venu2, _data$connectionCateg2, _propertyDetailsFetch, _propertyDetailsFetch2, _propertyDetailsFetch3, _propertyDetailsFetch4;
2870
2872
  const ownerData = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ownerDetails;
2871
2873
  const updatedDatacheck = (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData);
2872
2874
  const payload = {
@@ -2892,30 +2894,26 @@ const CHBCitizenSecond = ({
2892
2894
  action: "DRAFT"
2893
2895
  },
2894
2896
  additionalDetails: {
2895
- connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg2 = data.connectionCategory) === null || _data$connectionCateg2 === void 0 ? void 0 : _data$connectionCateg2.name
2897
+ connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg2 = data.connectionCategory) === null || _data$connectionCateg2 === void 0 ? void 0 : _data$connectionCateg2.name,
2898
+ locality: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch2 = _propertyDetailsFetch[0]) === null || _propertyDetailsFetch2 === void 0 ? void 0 : (_propertyDetailsFetch3 = _propertyDetailsFetch2.address) === null || _propertyDetailsFetch3 === void 0 ? void 0 : (_propertyDetailsFetch4 = _propertyDetailsFetch3.locality) === null || _propertyDetailsFetch4 === void 0 ? void 0 : _propertyDetailsFetch4.code
2896
2899
  }
2897
2900
  }
2898
2901
  };
2899
- console.log("payload check", payload);
2900
2902
  setLoader(true);
2901
2903
  try {
2902
2904
  var _response$GarbageConn;
2903
2905
  const response = await Digit.GCService.update(payload);
2904
2906
  setLoader(false);
2905
- console.log("response", response);
2906
2907
  goNext(response === null || response === void 0 ? void 0 : (_response$GarbageConn = response.GarbageConnection) === null || _response$GarbageConn === void 0 ? void 0 : _response$GarbageConn[0]);
2907
2908
  } catch (error) {
2908
2909
  var _error$response$data, _error$response$data$, _error$response$data$2;
2909
2910
  setLoader(false);
2910
- console.log("Response Data:", error.response.data);
2911
2911
  setShowToast(true);
2912
2912
  setError((_error$response$data = error.response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message);
2913
2913
  }
2914
2914
  } else {
2915
- var _data$frequency2, _data$typeOfWaste2, _data$propertyType2, _data$connectionCateg3, _data$connectionCateg4;
2915
+ var _data$frequency2, _data$typeOfWaste2, _data$propertyType2, _data$connectionCateg3, _data$unitId, _data$connectionCateg4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8;
2916
2916
  setLoader(true);
2917
- console.log("data", data);
2918
- console.log("currentStepData", currentStepData);
2919
2917
  const ownerData = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ownerDetails;
2920
2918
  const payload = {
2921
2919
  GarbageConnection: {
@@ -2924,10 +2922,12 @@ const CHBCitizenSecond = ({
2924
2922
  frequency: data === null || data === void 0 ? void 0 : (_data$frequency2 = data.frequency) === null || _data$frequency2 === void 0 ? void 0 : _data$frequency2.name,
2925
2923
  typeOfWaste: data === null || data === void 0 ? void 0 : (_data$typeOfWaste2 = data.typeOfWaste) === null || _data$typeOfWaste2 === void 0 ? void 0 : _data$typeOfWaste2.name,
2926
2924
  propertyType: data === null || data === void 0 ? void 0 : (_data$propertyType2 = data.propertyType) === null || _data$propertyType2 === void 0 ? void 0 : _data$propertyType2.name,
2925
+ connectionType: "Non Metered",
2927
2926
  plotSize: data === null || data === void 0 ? void 0 : data.plotSize,
2928
2927
  location: data === null || data === void 0 ? void 0 : data.location,
2929
2928
  applicationType: "NEW_GARBAGE_CONNECTION",
2930
2929
  connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg3 = data.connectionCategory) === null || _data$connectionCateg3 === void 0 ? void 0 : _data$connectionCateg3.name,
2930
+ unitId: data === null || data === void 0 ? void 0 : (_data$unitId = data.unitId) === null || _data$unitId === void 0 ? void 0 : _data$unitId.id,
2931
2931
  connectionHolders: [{
2932
2932
  name: ownerData === null || ownerData === void 0 ? void 0 : ownerData.name,
2933
2933
  mobileNumber: ownerData === null || ownerData === void 0 ? void 0 : ownerData.mobileNumber,
@@ -2941,10 +2941,12 @@ const CHBCitizenSecond = ({
2941
2941
  moduleName: "gc-services"
2942
2942
  },
2943
2943
  additionalDetails: {
2944
- connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg4 = data.connectionCategory) === null || _data$connectionCateg4 === void 0 ? void 0 : _data$connectionCateg4.name
2944
+ connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg4 = data.connectionCategory) === null || _data$connectionCateg4 === void 0 ? void 0 : _data$connectionCateg4.name,
2945
+ locality: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch5 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch5 === void 0 ? void 0 : (_propertyDetailsFetch6 = _propertyDetailsFetch5[0]) === null || _propertyDetailsFetch6 === void 0 ? void 0 : (_propertyDetailsFetch7 = _propertyDetailsFetch6.address) === null || _propertyDetailsFetch7 === void 0 ? void 0 : (_propertyDetailsFetch8 = _propertyDetailsFetch7.locality) === null || _propertyDetailsFetch8 === void 0 ? void 0 : _propertyDetailsFetch8.code
2945
2946
  }
2946
2947
  }
2947
2948
  };
2949
+ console.log("payload=====", payload);
2948
2950
  try {
2949
2951
  var _response$GarbageConn2;
2950
2952
  const response = await Digit.GCService.create(payload);
@@ -2954,7 +2956,6 @@ const CHBCitizenSecond = ({
2954
2956
  } catch (error) {
2955
2957
  var _error$response$data2, _error$response$data3, _error$response$data4;
2956
2958
  setLoader(false);
2957
- console.log("Response Data:", error.response.data);
2958
2959
  setShowToast(true);
2959
2960
  setError((_error$response$data2 = error.response.data) === null || _error$response$data2 === void 0 ? void 0 : (_error$response$data3 = _error$response$data2.Errors) === null || _error$response$data3 === void 0 ? void 0 : (_error$response$data4 = _error$response$data3[0]) === null || _error$response$data4 === void 0 ? void 0 : _error$response$data4.message);
2960
2961
  }
@@ -2976,23 +2977,50 @@ const CHBCitizenSecond = ({
2976
2977
  enabled: getPropertyId ? true : false,
2977
2978
  privacy: Digit.Utils.getPrivacyObject()
2978
2979
  });
2980
+ const checkConnection = async (propertyId, unitId) => {
2981
+ setLoader(true);
2982
+ const filters = {
2983
+ propertyId: propertyId,
2984
+ unitId: unitId,
2985
+ tenantId
2986
+ };
2987
+ try {
2988
+ const responseData = await Digit.GCService.validateConnection({
2989
+ tenantId,
2990
+ filters
2991
+ });
2992
+ setLoader(false);
2993
+ if (responseData !== null && responseData !== void 0 && responseData.canCreateConnection) {
2994
+ setActiveStatus(true);
2995
+ } else {
2996
+ setShowToast(true);
2997
+ setError(responseData === null || responseData === void 0 ? void 0 : responseData.message);
2998
+ }
2999
+ } catch (error) {
3000
+ var _error$response$data5, _error$response$data6, _error$response$data7;
3001
+ setLoader(false);
3002
+ setActiveStatus(false);
3003
+ setShowToast(true);
3004
+ setError((_error$response$data5 = error.response.data) === null || _error$response$data5 === void 0 ? void 0 : (_error$response$data6 = _error$response$data5.Errors) === null || _error$response$data6 === void 0 ? void 0 : (_error$response$data7 = _error$response$data6[0]) === null || _error$response$data7 === void 0 ? void 0 : _error$response$data7.message);
3005
+ }
3006
+ };
2979
3007
  useEffect(() => {
2980
3008
  if (propertyDetailsFetch !== null && propertyDetailsFetch !== void 0 && propertyDetailsFetch.Properties[0]) {
3009
+ var _propertyDetailsFetch9;
3010
+ setPUnits(propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch9 = propertyDetailsFetch.Properties[0]) === null || _propertyDetailsFetch9 === void 0 ? void 0 : _propertyDetailsFetch9.units);
2981
3011
  if (propertyDetailsFetch !== null && propertyDetailsFetch !== void 0 && propertyDetailsFetch.Properties || currentStepData !== null && currentStepData !== void 0 && currentStepData.venueDetails || currentStepData !== null && currentStepData !== void 0 && currentStepData.apiResponseData) {
2982
- var _propertyDetailsFetch, _propertyDetailsFetch2, _propertyDetailsFetch3, _propertyDetailsFetch4, _propertyDetailsFetch5, _propertyDetailsFetch6, _GCData$swServicesC, _FreqType$gcServices, _WasteType$gcService, _connectionCategory$g, _propertyDetailsFetch7, _propertyDetailsFetch8;
3012
+ var _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _GCData$swServicesC, _FreqType$gcServices, _WasteType$gcService, _connectionCategory$g, _propertyDetailsFetch18, _propertyDetailsFetch19;
2983
3013
  const backStepData = (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData);
2984
- const location = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch2 = _propertyDetailsFetch[0]) === null || _propertyDetailsFetch2 === void 0 ? void 0 : (_propertyDetailsFetch3 = _propertyDetailsFetch2.owners) === null || _propertyDetailsFetch3 === void 0 ? void 0 : (_propertyDetailsFetch4 = _propertyDetailsFetch3[0]) === null || _propertyDetailsFetch4 === void 0 ? void 0 : _propertyDetailsFetch4.permanentAddress) || (backStepData === null || backStepData === void 0 ? void 0 : backStepData.location);
2985
- const plotSize = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch5 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch5 === void 0 ? void 0 : (_propertyDetailsFetch6 = _propertyDetailsFetch5[0]) === null || _propertyDetailsFetch6 === void 0 ? void 0 : _propertyDetailsFetch6.landArea) || (backStepData === null || backStepData === void 0 ? void 0 : backStepData.plotSize);
3014
+ const location = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch0 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch0 === void 0 ? void 0 : (_propertyDetailsFetch1 = _propertyDetailsFetch0[0]) === null || _propertyDetailsFetch1 === void 0 ? void 0 : (_propertyDetailsFetch10 = _propertyDetailsFetch1.owners) === null || _propertyDetailsFetch10 === void 0 ? void 0 : (_propertyDetailsFetch11 = _propertyDetailsFetch10[0]) === null || _propertyDetailsFetch11 === void 0 ? void 0 : _propertyDetailsFetch11.permanentAddress) || (backStepData === null || backStepData === void 0 ? void 0 : backStepData.location) || (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch12 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch12 === void 0 ? void 0 : (_propertyDetailsFetch13 = _propertyDetailsFetch12[0]) === null || _propertyDetailsFetch13 === void 0 ? void 0 : (_propertyDetailsFetch14 = _propertyDetailsFetch13.address) === null || _propertyDetailsFetch14 === void 0 ? void 0 : (_propertyDetailsFetch15 = _propertyDetailsFetch14.locality) === null || _propertyDetailsFetch15 === void 0 ? void 0 : _propertyDetailsFetch15.name);
3015
+ const plotSize = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch16 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch16 === void 0 ? void 0 : (_propertyDetailsFetch17 = _propertyDetailsFetch16[0]) === null || _propertyDetailsFetch17 === void 0 ? void 0 : _propertyDetailsFetch17.landArea) || (backStepData === null || backStepData === void 0 ? void 0 : backStepData.plotSize);
2986
3016
  if (backStepData !== null && backStepData !== void 0 && backStepData.propertyId) setValue("propertyId", backStepData === null || backStepData === void 0 ? void 0 : backStepData.propertyId);
2987
3017
  setValue("location", location);
2988
3018
  setValue("plotSize", plotSize);
2989
3019
  const pTypeOptions = (GCData === null || GCData === void 0 ? void 0 : (_GCData$swServicesC = GCData["sw-services-calculation"]) === null || _GCData$swServicesC === void 0 ? void 0 : _GCData$swServicesC.PropertyUsageType) || [];
2990
- console.log("pTypeOptions", pTypeOptions);
2991
3020
  const freqTypeOptions = (FreqType === null || FreqType === void 0 ? void 0 : (_FreqType$gcServices = FreqType["gc-services-masters"]) === null || _FreqType$gcServices === void 0 ? void 0 : _FreqType$gcServices.GarbageCollectionFrequency) || [];
2992
3021
  const wasteTypeOptions = (WasteType === null || WasteType === void 0 ? void 0 : (_WasteType$gcService = WasteType["gc-services-masters"]) === null || _WasteType$gcService === void 0 ? void 0 : _WasteType$gcService.TypeOfWaste) || [];
2993
3022
  const connectionCatoptions = (connectionCategory === null || connectionCategory === void 0 ? void 0 : (_connectionCategory$g = connectionCategory["gc-services-masters"]) === null || _connectionCategory$g === void 0 ? void 0 : _connectionCategory$g.connectionCategory) || [];
2994
- console.log("connectionCatoptions", connectionCatoptions);
2995
- const usage = propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch7 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch7 === void 0 ? void 0 : (_propertyDetailsFetch8 = _propertyDetailsFetch7[0]) === null || _propertyDetailsFetch8 === void 0 ? void 0 : _propertyDetailsFetch8.usageCategory;
3023
+ const usage = propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch18 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch18 === void 0 ? void 0 : (_propertyDetailsFetch19 = _propertyDetailsFetch18[0]) === null || _propertyDetailsFetch19 === void 0 ? void 0 : _propertyDetailsFetch19.usageCategory;
2996
3024
  const frequency = backStepData === null || backStepData === void 0 ? void 0 : backStepData.frequency;
2997
3025
  const typeOfWaste = backStepData === null || backStepData === void 0 ? void 0 : backStepData.typeOfWaste;
2998
3026
  const connetionType = backStepData === null || backStepData === void 0 ? void 0 : backStepData.connectionCategory;
@@ -3031,27 +3059,60 @@ const CHBCitizenSecond = ({
3031
3059
  setValue("connectionCategory", null);
3032
3060
  setPropertyId(null);
3033
3061
  };
3062
+ const uniqueFloors = React.useMemo(() => {
3063
+ if (!(getPUnits !== null && getPUnits !== void 0 && getPUnits.length)) return [];
3064
+ const map = new Map();
3065
+ getPUnits.forEach(item => {
3066
+ if (!map.has(item.floorNo)) {
3067
+ map.set(item.floorNo, item);
3068
+ }
3069
+ });
3070
+ return Array.from(map.values()).sort((a, b) => a.floorNo - b.floorNo);
3071
+ }, [getPUnits]);
3072
+ const selectedFloorUnits = React.useMemo(() => {
3073
+ if (!watch("floorNo")) return [];
3074
+ return getPUnits.filter(unit => {
3075
+ var _watch;
3076
+ return unit.floorNo === ((_watch = watch("floorNo")) === null || _watch === void 0 ? void 0 : _watch.floorNo);
3077
+ });
3078
+ }, [watch("floorNo"), getPUnits]);
3079
+ const uniqueUsageCategories = React.useMemo(() => {
3080
+ if (!(selectedFloorUnits !== null && selectedFloorUnits !== void 0 && selectedFloorUnits.length)) return [];
3081
+ const map = new Map();
3082
+ selectedFloorUnits.forEach(unit => {
3083
+ if (!map.has(unit.usageCategory)) {
3084
+ map.set(unit.usageCategory, unit);
3085
+ }
3086
+ });
3087
+ return Array.from(map.values());
3088
+ }, [selectedFloorUnits]);
3034
3089
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("form", {
3035
3090
  style: {
3036
3091
  paddingBottom: "150px"
3037
3092
  },
3038
3093
  onSubmit: handleSubmit(onSubmit)
3039
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
3094
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
3040
3095
  style: {
3041
- marginBottom: "20px"
3096
+ marginBottom: "16px"
3042
3097
  }
3043
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NDC_MSG_PROPERTY_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
3098
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3099
+ className: "card-label-smaller"
3100
+ }, `${t("NDC_MSG_PROPERTY_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
3044
3101
  style: {
3045
3102
  color: "red"
3046
3103
  }
3047
3104
  }, "*")), /*#__PURE__*/React.createElement("div", {
3105
+ className: "form-field"
3106
+ }, /*#__PURE__*/React.createElement("div", {
3048
3107
  style: {
3049
- display: "flex",
3050
- gap: "15px",
3051
- alignItems: "center"
3108
+ display: "block",
3109
+ gap: "8px",
3110
+ alignItems: "flex-start"
3052
3111
  }
3053
3112
  }, /*#__PURE__*/React.createElement("div", {
3054
- className: "form-field"
3113
+ style: {
3114
+ flex: 1
3115
+ }
3055
3116
  }, /*#__PURE__*/React.createElement(Controller, {
3056
3117
  control: control,
3057
3118
  name: "propertyId",
@@ -3070,27 +3131,28 @@ const CHBCitizenSecond = ({
3070
3131
  t: t
3071
3132
  })
3072
3133
  })), /*#__PURE__*/React.createElement("button", {
3073
- className: "submit-bar",
3134
+ className: "submit-bar gcButton",
3074
3135
  type: "button",
3075
- style: {
3076
- color: "white",
3077
- width: "100%",
3078
- maxWidth: "100px"
3079
- },
3080
3136
  onClick: searchProperty
3081
3137
  }, `${t("PT_SEARCH")}`)), (errors === null || errors === void 0 ? void 0 : errors.propertyId) && /*#__PURE__*/React.createElement("p", {
3082
3138
  style: {
3083
- color: "red"
3139
+ color: "red",
3140
+ marginTop: "4px",
3141
+ marginBottom: "0"
3084
3142
  }
3085
- }, errors.propertyId.message)), ((propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
3143
+ }, errors.propertyId.message))), ((propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
3086
3144
  style: {
3087
- marginBottom: "20px"
3145
+ marginBottom: "16px"
3088
3146
  }
3089
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NDC_MSG_PROPERTY_TYPE_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
3147
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3148
+ className: "card-label-smaller"
3149
+ }, `${t("NDC_MSG_PROPERTY_TYPE_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
3090
3150
  style: {
3091
3151
  color: "red"
3092
3152
  }
3093
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
3153
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3154
+ className: "form-field"
3155
+ }, /*#__PURE__*/React.createElement(Controller, {
3094
3156
  control: control,
3095
3157
  name: "propertyType",
3096
3158
  rules: {
@@ -3113,18 +3175,23 @@ const CHBCitizenSecond = ({
3113
3175
  }
3114
3176
  }), (errors === null || errors === void 0 ? void 0 : errors.propertyType) && /*#__PURE__*/React.createElement("p", {
3115
3177
  style: {
3116
- color: "red"
3178
+ color: "red",
3179
+ marginTop: "4px",
3180
+ marginBottom: "0"
3117
3181
  }
3118
- }, errors.propertyType.message)), /*#__PURE__*/React.createElement("div", {
3119
- className: "form-field",
3182
+ }, errors.propertyType.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3120
3183
  style: {
3121
- marginBottom: "20px"
3184
+ marginBottom: "16px"
3122
3185
  }
3123
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_PLOT_SIZE")}`, " ", /*#__PURE__*/React.createElement("span", {
3186
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3187
+ className: "card-label-smaller"
3188
+ }, `${t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_PLOT_SIZE")}`, " ", /*#__PURE__*/React.createElement("span", {
3124
3189
  style: {
3125
3190
  color: "red"
3126
3191
  }
3127
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
3192
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3193
+ className: "form-field"
3194
+ }, /*#__PURE__*/React.createElement(Controller, {
3128
3195
  control: control,
3129
3196
  name: "plotSize",
3130
3197
  rules: {
@@ -3142,18 +3209,23 @@ const CHBCitizenSecond = ({
3142
3209
  })
3143
3210
  }), (errors === null || errors === void 0 ? void 0 : errors.plotSize) && /*#__PURE__*/React.createElement("p", {
3144
3211
  style: {
3145
- color: "red"
3212
+ color: "red",
3213
+ marginTop: "4px",
3214
+ marginBottom: "0"
3146
3215
  }
3147
- }, errors.plotSize.message)), /*#__PURE__*/React.createElement("div", {
3148
- className: "form-field",
3216
+ }, errors.plotSize.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3149
3217
  style: {
3150
- marginBottom: "20px"
3218
+ marginBottom: "16px"
3151
3219
  }
3152
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("GC_LOCATION")}`, " ", /*#__PURE__*/React.createElement("span", {
3220
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3221
+ className: "card-label-smaller"
3222
+ }, `${t("GC_LOCATION")}`, " ", /*#__PURE__*/React.createElement("span", {
3153
3223
  style: {
3154
3224
  color: "red"
3155
3225
  }
3156
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
3226
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3227
+ className: "form-field"
3228
+ }, /*#__PURE__*/React.createElement(Controller, {
3157
3229
  control: control,
3158
3230
  name: "location",
3159
3231
  rules: {
@@ -3171,17 +3243,23 @@ const CHBCitizenSecond = ({
3171
3243
  })
3172
3244
  }), (errors === null || errors === void 0 ? void 0 : errors.location) && /*#__PURE__*/React.createElement("p", {
3173
3245
  style: {
3174
- color: "red"
3246
+ color: "red",
3247
+ marginTop: "4px",
3248
+ marginBottom: "0"
3175
3249
  }
3176
- }, errors.location.message)), /*#__PURE__*/React.createElement("div", {
3250
+ }, errors.location.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3177
3251
  style: {
3178
- marginBottom: "20px"
3252
+ marginBottom: "16px"
3179
3253
  }
3180
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("GC_FREQUENCY")}`, " ", /*#__PURE__*/React.createElement("span", {
3254
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3255
+ className: "card-label-smaller"
3256
+ }, `${t("GC_FREQUENCY")}`, " ", /*#__PURE__*/React.createElement("span", {
3181
3257
  style: {
3182
3258
  color: "red"
3183
3259
  }
3184
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
3260
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3261
+ className: "form-field"
3262
+ }, /*#__PURE__*/React.createElement(Controller, {
3185
3263
  control: control,
3186
3264
  name: "frequency",
3187
3265
  rules: {
@@ -3204,17 +3282,23 @@ const CHBCitizenSecond = ({
3204
3282
  }
3205
3283
  }), (errors === null || errors === void 0 ? void 0 : errors.frequency) && /*#__PURE__*/React.createElement("p", {
3206
3284
  style: {
3207
- color: "red"
3285
+ color: "red",
3286
+ marginTop: "4px",
3287
+ marginBottom: "0"
3208
3288
  }
3209
- }, errors.frequency.message)), /*#__PURE__*/React.createElement("div", {
3289
+ }, errors.frequency.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3210
3290
  style: {
3211
- marginBottom: "20px"
3291
+ marginBottom: "16px"
3212
3292
  }
3213
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("GC_WASTE_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
3293
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3294
+ className: "card-label-smaller"
3295
+ }, `${t("GC_WASTE_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
3214
3296
  style: {
3215
3297
  color: "red"
3216
3298
  }
3217
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
3299
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3300
+ className: "form-field"
3301
+ }, /*#__PURE__*/React.createElement(Controller, {
3218
3302
  control: control,
3219
3303
  name: "typeOfWaste",
3220
3304
  rules: {
@@ -3237,17 +3321,23 @@ const CHBCitizenSecond = ({
3237
3321
  }
3238
3322
  }), (errors === null || errors === void 0 ? void 0 : errors.typeOfWaste) && /*#__PURE__*/React.createElement("p", {
3239
3323
  style: {
3240
- color: "red"
3324
+ color: "red",
3325
+ marginTop: "4px",
3326
+ marginBottom: "0"
3241
3327
  }
3242
- }, errors.typeOfWaste.message)), /*#__PURE__*/React.createElement("div", {
3328
+ }, errors.typeOfWaste.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3243
3329
  style: {
3244
- marginBottom: "20px"
3330
+ marginBottom: "16px"
3245
3331
  }
3246
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("GC_CONNECTION_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
3332
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3333
+ className: "card-label-smaller"
3334
+ }, `${t("GC_CONNECTION_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
3247
3335
  style: {
3248
3336
  color: "red"
3249
3337
  }
3250
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
3338
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3339
+ className: "form-field"
3340
+ }, /*#__PURE__*/React.createElement(Controller, {
3251
3341
  control: control,
3252
3342
  name: "connectionCategory",
3253
3343
  rules: {
@@ -3269,10 +3359,89 @@ const CHBCitizenSecond = ({
3269
3359
  });
3270
3360
  }
3271
3361
  }), (errors === null || errors === void 0 ? void 0 : errors.connectionCategory) && /*#__PURE__*/React.createElement("p", {
3362
+ style: {
3363
+ color: "red",
3364
+ marginTop: "4px",
3365
+ marginBottom: "0"
3366
+ }
3367
+ }, errors.connectionCategory.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3368
+ style: {
3369
+ marginBottom: "16px"
3370
+ }
3371
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3372
+ className: "card-label-smaller"
3373
+ }, `${t("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
3272
3374
  style: {
3273
3375
  color: "red"
3274
3376
  }
3275
- }, errors.connectionCategory.message)))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
3377
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3378
+ className: "form-field"
3379
+ }, /*#__PURE__*/React.createElement(Controller, {
3380
+ control: control,
3381
+ name: "floorNo",
3382
+ rules: {
3383
+ required: t("units is required")
3384
+ },
3385
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
3386
+ style: {
3387
+ marginBottom: 0
3388
+ },
3389
+ className: "form-field",
3390
+ select: e => {
3391
+ props.onChange(e);
3392
+ },
3393
+ selected: props.value,
3394
+ option: uniqueFloors,
3395
+ optionKey: "floorNo",
3396
+ t: t
3397
+ })
3398
+ }), (errors === null || errors === void 0 ? void 0 : errors.floorNo) && /*#__PURE__*/React.createElement("p", {
3399
+ style: {
3400
+ color: "red",
3401
+ marginTop: "4px",
3402
+ marginBottom: "0"
3403
+ }
3404
+ }, errors.floorNo.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
3405
+ style: {
3406
+ marginBottom: "16px"
3407
+ }
3408
+ }, /*#__PURE__*/React.createElement(CardLabel, {
3409
+ className: "card-label-smaller"
3410
+ }, `${t("Select Unit")}`, " ", /*#__PURE__*/React.createElement("span", {
3411
+ style: {
3412
+ color: "red"
3413
+ }
3414
+ }, "*")), /*#__PURE__*/React.createElement("div", {
3415
+ className: "form-field"
3416
+ }, /*#__PURE__*/React.createElement(Controller, {
3417
+ control: control,
3418
+ name: "unitId",
3419
+ rules: {
3420
+ required: t("Usage category is required")
3421
+ },
3422
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
3423
+ style: {
3424
+ marginBottom: 0
3425
+ },
3426
+ className: "form-field",
3427
+ select: e => {
3428
+ var _propertyDetailsFetch20;
3429
+ props.onChange(e);
3430
+ const pID = propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch20 = propertyDetailsFetch.Properties[0]) === null || _propertyDetailsFetch20 === void 0 ? void 0 : _propertyDetailsFetch20.propertyId;
3431
+ checkConnection(pID, e === null || e === void 0 ? void 0 : e.id);
3432
+ },
3433
+ selected: props.value,
3434
+ option: uniqueUsageCategories,
3435
+ optionKey: "usageCategory",
3436
+ t: t
3437
+ })
3438
+ }), (errors === null || errors === void 0 ? void 0 : errors.unitId) && /*#__PURE__*/React.createElement("p", {
3439
+ style: {
3440
+ color: "red",
3441
+ marginTop: "4px",
3442
+ marginBottom: "0"
3443
+ }
3444
+ }, errors.unitId.message))))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
3276
3445
  style: {
3277
3446
  background: " white",
3278
3447
  color: "black",
@@ -3283,7 +3452,8 @@ const CHBCitizenSecond = ({
3283
3452
  onSubmit: onGoBack
3284
3453
  }), /*#__PURE__*/React.createElement(SubmitBar, {
3285
3454
  label: "Next",
3286
- submit: "submit"
3455
+ submit: "submit",
3456
+ disabled: !getActiveStatus
3287
3457
  }))), showToast && /*#__PURE__*/React.createElement(Toast, {
3288
3458
  isDleteBtn: true,
3289
3459
  error: true,
@@ -9126,6 +9296,7 @@ const NewADSStepFormOne = ({
9126
9296
  onGoNext,
9127
9297
  onBackClick
9128
9298
  }) => {
9299
+ var _window$location, _window$location$href;
9129
9300
  const dispatch = useDispatch();
9130
9301
  const {
9131
9302
  t
@@ -9147,12 +9318,15 @@ const NewADSStepFormOne = ({
9147
9318
  setShowToast(false);
9148
9319
  setError("");
9149
9320
  };
9150
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CHBCitizenSecond, {
9321
+ const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
9322
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9323
+ className: !isCitizen ? "employeeCard" : ""
9324
+ }, /*#__PURE__*/React.createElement(CHBCitizenSecond, {
9151
9325
  onGoBack: onGoBack,
9152
9326
  goNext: goNext,
9153
9327
  currentStepData: currentStepData,
9154
9328
  t: t
9155
- }), showToast && /*#__PURE__*/React.createElement(Toast, {
9329
+ })), showToast && /*#__PURE__*/React.createElement(Toast, {
9156
9330
  isDleteBtn: true,
9157
9331
  error: true,
9158
9332
  label: error,
@@ -9266,17 +9440,17 @@ const CHBCitizenDetailsNew = ({
9266
9440
  onSubmit: handleSubmit(onSubmit)
9267
9441
  }, /*#__PURE__*/React.createElement("div", {
9268
9442
  style: {
9269
- width: "100%"
9270
- }
9271
- }, /*#__PURE__*/React.createElement("div", {
9272
- style: {
9273
- marginBottom: "20px"
9443
+ maxWidth: !isCitizen ? "100%" : "100%"
9274
9444
  }
9275
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_APPLICANT_MOBILE_NO_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
9445
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
9446
+ className: "card-label-smaller"
9447
+ }, `${t("NOC_APPLICANT_MOBILE_NO_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
9276
9448
  style: {
9277
9449
  color: "red"
9278
9450
  }
9279
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
9451
+ }, "*")), /*#__PURE__*/React.createElement("div", {
9452
+ className: "form-field"
9453
+ }, /*#__PURE__*/React.createElement(Controller, {
9280
9454
  control: control,
9281
9455
  name: "mobileNumber",
9282
9456
  rules: {
@@ -9289,7 +9463,6 @@ const CHBCitizenDetailsNew = ({
9289
9463
  render: props => /*#__PURE__*/React.createElement(MobileNumber, {
9290
9464
  value: props.value,
9291
9465
  onChange: e => {
9292
- console.log("eee", e);
9293
9466
  props.onChange(e);
9294
9467
  setValue("name", "");
9295
9468
  if (e.length === 10) {
@@ -9301,17 +9474,19 @@ const CHBCitizenDetailsNew = ({
9301
9474
  })
9302
9475
  }), (errors === null || errors === void 0 ? void 0 : errors.mobileNumber) && /*#__PURE__*/React.createElement("p", {
9303
9476
  style: {
9304
- color: "red"
9305
- }
9306
- }, errors.mobileNumber.message)), /*#__PURE__*/React.createElement("div", {
9307
- style: {
9308
- marginBottom: "20px"
9477
+ color: "red",
9478
+ marginTop: "4px",
9479
+ marginBottom: "0"
9309
9480
  }
9310
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
9481
+ }, errors.mobileNumber.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
9482
+ className: "card-label-smaller"
9483
+ }, `${t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
9311
9484
  style: {
9312
9485
  color: "red"
9313
9486
  }
9314
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
9487
+ }, "*")), /*#__PURE__*/React.createElement("div", {
9488
+ className: "form-field"
9489
+ }, /*#__PURE__*/React.createElement(Controller, {
9315
9490
  control: control,
9316
9491
  name: "name",
9317
9492
  rules: {
@@ -9337,17 +9512,19 @@ const CHBCitizenDetailsNew = ({
9337
9512
  }
9338
9513
  }), (errors === null || errors === void 0 ? void 0 : errors.name) && /*#__PURE__*/React.createElement("p", {
9339
9514
  style: {
9340
- color: "red"
9341
- }
9342
- }, errors.name.message)), /*#__PURE__*/React.createElement("div", {
9343
- style: {
9344
- marginBottom: "20px"
9515
+ color: "red",
9516
+ marginTop: "4px",
9517
+ marginBottom: "0"
9345
9518
  }
9346
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_APPLICANT_EMAIL_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
9519
+ }, errors.name.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
9520
+ className: "card-label-smaller"
9521
+ }, `${t("NOC_APPLICANT_EMAIL_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
9347
9522
  style: {
9348
9523
  color: "red"
9349
9524
  }
9350
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
9525
+ }, "*")), /*#__PURE__*/React.createElement("div", {
9526
+ className: "form-field"
9527
+ }, /*#__PURE__*/React.createElement(Controller, {
9351
9528
  control: control,
9352
9529
  name: "emailId",
9353
9530
  rules: {
@@ -9369,17 +9546,19 @@ const CHBCitizenDetailsNew = ({
9369
9546
  })
9370
9547
  }), (errors === null || errors === void 0 ? void 0 : errors.emailId) && /*#__PURE__*/React.createElement("p", {
9371
9548
  style: {
9372
- color: "red"
9373
- }
9374
- }, errors.emailId.message)), /*#__PURE__*/React.createElement("div", {
9375
- style: {
9376
- marginBottom: "20px"
9549
+ color: "red",
9550
+ marginTop: "4px",
9551
+ marginBottom: "0"
9377
9552
  }
9378
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_COMMON_COL_ADDRESS")}`, " ", /*#__PURE__*/React.createElement("span", {
9553
+ }, errors.emailId.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
9554
+ className: "card-label-smaller"
9555
+ }, `${t("PT_COMMON_COL_ADDRESS")}`, " ", /*#__PURE__*/React.createElement("span", {
9379
9556
  style: {
9380
9557
  color: "red"
9381
9558
  }
9382
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
9559
+ }, "*")), /*#__PURE__*/React.createElement("div", {
9560
+ className: "form-field"
9561
+ }, /*#__PURE__*/React.createElement(Controller, {
9383
9562
  control: control,
9384
9563
  name: "address",
9385
9564
  rules: {
@@ -9402,9 +9581,11 @@ const CHBCitizenDetailsNew = ({
9402
9581
  })
9403
9582
  }), (errors === null || errors === void 0 ? void 0 : errors.address) && /*#__PURE__*/React.createElement("p", {
9404
9583
  style: {
9405
- color: "red"
9584
+ color: "red",
9585
+ marginTop: "4px",
9586
+ marginBottom: "0"
9406
9587
  }
9407
- }, errors.address.message))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
9588
+ }, errors.address.message)))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
9408
9589
  label: "Next",
9409
9590
  submit: "submit"
9410
9591
  }))), loader && /*#__PURE__*/React.createElement(Loader, {
@@ -9417,6 +9598,7 @@ const NewADSStepFormTwo = ({
9417
9598
  onBackClick,
9418
9599
  onGoNext
9419
9600
  }) => {
9601
+ var _window$location, _window$location$href;
9420
9602
  const {
9421
9603
  t
9422
9604
  } = useTranslation();
@@ -9438,12 +9620,15 @@ const NewADSStepFormTwo = ({
9438
9620
  setShowToast(false);
9439
9621
  setError("");
9440
9622
  };
9441
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CHBCitizenDetailsNew, {
9623
+ const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
9624
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9625
+ className: !isCitizen ? "employeeCard" : ""
9626
+ }, /*#__PURE__*/React.createElement(CHBCitizenDetailsNew, {
9442
9627
  onGoBack: onGoBack,
9443
9628
  goNext: goNext,
9444
9629
  currentStepData: currentStepData,
9445
9630
  t: t
9446
- }), showToast && /*#__PURE__*/React.createElement(Toast, {
9631
+ })), showToast && /*#__PURE__*/React.createElement(Toast, {
9447
9632
  isDleteBtn: true,
9448
9633
  error: true,
9449
9634
  label: error,
@@ -10212,7 +10397,8 @@ const SearchFormFieldsComponents = ({
10212
10397
  }, /*#__PURE__*/React.createElement("div", {
10213
10398
  className: "complaint-input-container",
10214
10399
  style: {
10215
- textAlign: "start"
10400
+ textAlign: "start",
10401
+ display: "flex"
10216
10402
  }
10217
10403
  }, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10218
10404
  name: "applicationNumber",
@@ -10227,11 +10413,11 @@ const SearchFormFieldsComponents = ({
10227
10413
  }
10228
10414
  }, searchFieldComponents)))));
10229
10415
  }
10230
- return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_APPLICATION_NUMBER_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10416
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10231
10417
  name: "applicationNumber",
10232
10418
  inputRef: registerRef({})
10233
- })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_BPA_APPLICATION_NUMBER_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10234
- name: "sourceRefId",
10419
+ })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("CORE_COMMON_PHONE_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
10420
+ name: "mobileNumber",
10235
10421
  inputRef: registerRef({})
10236
10422
  })));
10237
10423
  };
@@ -10730,6 +10916,39 @@ const Inbox = ({
10730
10916
  }))));
10731
10917
  };
10732
10918
 
10919
+ const GCBreadCrumbs = ({
10920
+ location,
10921
+ t
10922
+ }) => {
10923
+ const crumbs = [{
10924
+ path: "/digit-ui/employee",
10925
+ content: t("ES_COMMON_HOME"),
10926
+ show: true
10927
+ }, {
10928
+ path: "/digit-ui/employee/garbagecollection/inbox",
10929
+ content: t("CS_COMMON_INBOX"),
10930
+ show: location.pathname.includes("/garbagecollection/inbox") ? true : false
10931
+ }, {
10932
+ path: "/digit-ui/employee/garbagecollection/create-application",
10933
+ content: "Create Application",
10934
+ show: location.pathname.includes("/garbagecollection/create-application") ? true : false
10935
+ }, {
10936
+ path: "/digit-ui/employee/garbagecollection/applicationsearch/application-details",
10937
+ content: "Application Overview",
10938
+ show: location.pathname.includes("/garbagecollection/applicationsearch/application-details") ? true : false
10939
+ }, {
10940
+ path: "/digit-ui/employee/garbagecollection/generate-bill",
10941
+ content: "Generate Bill",
10942
+ show: location.pathname.includes("/garbagecollection/generate-bill") ? true : false
10943
+ }, {
10944
+ path: "/digit-ui/employee/garbagecollection/bill-genie",
10945
+ content: "Bill-Genie",
10946
+ show: location.pathname.includes("/garbagecollection/bill-genie") ? true : false
10947
+ }];
10948
+ return /*#__PURE__*/React.createElement(BreadCrumb, {
10949
+ crumbs: crumbs
10950
+ });
10951
+ };
10733
10952
  const EmployeeApp = ({
10734
10953
  path,
10735
10954
  url,
@@ -10761,20 +10980,15 @@ const EmployeeApp = ({
10761
10980
  const BillGenie = (_Digit5 = Digit) === null || _Digit5 === void 0 ? void 0 : (_Digit5$ComponentRegi = _Digit5.ComponentRegistryService) === null || _Digit5$ComponentRegi === void 0 ? void 0 : _Digit5$ComponentRegi.getComponent("BillGenie");
10762
10981
  const isRes = window.location.href.includes("garbagecollection/response");
10763
10982
  const isNewRegistration = window.location.href.includes("searchhall") || window.location.href.includes("modify-application") || window.location.href.includes("garbagecollection/application-details");
10764
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10983
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10765
10984
  className: "ground-container"
10766
10985
  }, !isRes ? /*#__PURE__*/React.createElement("div", {
10767
- style: isNewRegistration ? {
10768
- marginLeft: "12px",
10769
- display: "flex",
10770
- alignItems: "center"
10771
- } : {
10772
- marginLeft: "-4px",
10773
- display: "flex",
10774
- alignItems: "center"
10986
+ style: {
10987
+ marginLeft: "10px"
10775
10988
  }
10776
- }, /*#__PURE__*/React.createElement(BackButton, {
10777
- location: location
10989
+ }, /*#__PURE__*/React.createElement(GCBreadCrumbs, {
10990
+ location: location,
10991
+ t: t
10778
10992
  })) : null, /*#__PURE__*/React.createElement(PrivateRoute, {
10779
10993
  path: `${path}/inbox`,
10780
10994
  component: () => /*#__PURE__*/React.createElement(Inbox, {
@@ -10802,11 +11016,35 @@ const EmployeeApp = ({
10802
11016
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
10803
11017
  path: `${path}/response/:id`,
10804
11018
  component: GCResponseCitizen
10805
- })))));
11019
+ })));
10806
11020
  };
10807
11021
 
11022
+ const GCBreadCrumbs$1 = ({
11023
+ location
11024
+ }) => {
11025
+ const {
11026
+ t
11027
+ } = useTranslation();
11028
+ const crumbs = [{
11029
+ path: "/digit-ui/citizen",
11030
+ content: t("ES_COMMON_HOME"),
11031
+ show: true
11032
+ }, {
11033
+ path: "/digit-ui/citizen/garbagecollection-home",
11034
+ content: `${t("Garbage Collection")} Home`,
11035
+ show: location.pathname.includes("garbagecollection/") ? true : false
11036
+ }, {
11037
+ path: "/digit-ui/citizen/ptr-home",
11038
+ content: t("PET_NDCSERVICE"),
11039
+ show: location.pathname.includes("ptr/petservice/test") ? true : false
11040
+ }];
11041
+ return /*#__PURE__*/React.createElement(BreadCrumb, {
11042
+ crumbs: crumbs
11043
+ });
11044
+ };
10808
11045
  const App = () => {
10809
11046
  var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi;
11047
+ const location = useLocation();
10810
11048
  const {
10811
11049
  path,
10812
11050
  url,
@@ -10816,13 +11054,22 @@ const App = () => {
10816
11054
  const GCMyApplications = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("GCMyApplications");
10817
11055
  const GCApplicationDetails = (_Digit3 = Digit) === null || _Digit3 === void 0 ? void 0 : (_Digit3$ComponentRegi = _Digit3.ComponentRegistryService) === null || _Digit3$ComponentRegi === void 0 ? void 0 : _Digit3$ComponentRegi.getComponent("GCApplicationDetails");
10818
11056
  const GCResponseCitizen = (_Digit4 = Digit) === null || _Digit4 === void 0 ? void 0 : (_Digit4$ComponentRegi = _Digit4.ComponentRegistryService) === null || _Digit4$ComponentRegi === void 0 ? void 0 : _Digit4$ComponentRegi.getComponent("GCResponseCitizen");
11057
+ const isResponse = window.location.href.includes("/response");
11058
+ const isMobile = window.Digit.Utils.browser.isMobile();
10819
11059
  return /*#__PURE__*/React.createElement("span", {
10820
- className: "mcollect-citizen"
10821
- }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(BackButton, {
11060
+ className: "chb-citizen",
10822
11061
  style: {
10823
- top: "55px"
10824
- }
10825
- }, "Back"), /*#__PURE__*/React.createElement(PrivateRoute, {
11062
+ width: "100%",
11063
+ paddingRight: "25px",
11064
+ paddingLeft: "25px"
11065
+ }
11066
+ }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, !isResponse ? /*#__PURE__*/React.createElement("div", {
11067
+ style: window.location.href.includes("application-overview") || isMobile ? {
11068
+ marginLeft: "10px"
11069
+ } : {}
11070
+ }, /*#__PURE__*/React.createElement(GCBreadCrumbs$1, {
11071
+ location: location
11072
+ })) : null, " ", /*#__PURE__*/React.createElement(PrivateRoute, {
10826
11073
  path: `${path}/my-applications`,
10827
11074
  component: GCMyApplications
10828
11075
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
@@ -11363,8 +11610,8 @@ ListCache.prototype.has = _listCacheHas;
11363
11610
  ListCache.prototype.set = _listCacheSet;
11364
11611
  var _ListCache = ListCache;
11365
11612
 
11366
- var Map = _getNative(_root, 'Map');
11367
- var _Map = Map;
11613
+ var Map$1 = _getNative(_root, 'Map');
11614
+ var _Map = Map$1;
11368
11615
 
11369
11616
  function mapCacheClear() {
11370
11617
  this.size = 0;
@@ -11478,6 +11725,86 @@ var stringToPath = _memoizeCapped(function (string) {
11478
11725
  return result;
11479
11726
  });
11480
11727
 
11728
+ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles = {}, t) => {
11729
+ var _workflowDetails$data, _workflowDetails$data2, _processInstances$, _processInstances$2, _processInstances$3, _timeline$, _timeline$2, _timeline$3, _timeline$4;
11730
+ console.log('pdfFiles', pdfFiles);
11731
+ const timeline = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.timeline) || [];
11732
+ const processInstances = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.processInstances) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.processInstances) || [];
11733
+ const businessId = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$ = processInstances[0]) === null || _processInstances$ === void 0 ? void 0 : _processInstances$.businessId) || "N/A";
11734
+ const businessService = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$2 = processInstances[0]) === null || _processInstances$2 === void 0 ? void 0 : _processInstances$2.businessService) || "N/A";
11735
+ const moduleName = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$3 = processInstances[0]) === null || _processInstances$3 === void 0 ? void 0 : _processInstances$3.moduleName) || "N/A";
11736
+ const pdfDownloadLink = (documents, fileStoreId) => {
11737
+ var _downloadLink$split;
11738
+ const downloadLink = (documents === null || documents === void 0 ? void 0 : documents[fileStoreId]) || "";
11739
+ const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
11740
+ return (formats === null || formats === void 0 ? void 0 : formats.find(link => !(link !== null && link !== void 0 && link.includes("large")) && !(link !== null && link !== void 0 && link.includes("medium")) && !(link !== null && link !== void 0 && link.includes("small")))) || (formats === null || formats === void 0 ? void 0 : formats[0]) || "";
11741
+ };
11742
+ const pattern = /\[#\?.*?\*\*\]/;
11743
+ const timelineRows = timeline.map((item, index) => {
11744
+ var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment;
11745
+ const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
11746
+ const timing = (item === null || item === void 0 ? void 0 : (_item$auditDetails2 = item.auditDetails) === null || _item$auditDetails2 === void 0 ? void 0 : _item$auditDetails2.timing) || "N/A";
11747
+ const assignerName = (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || "N/A";
11748
+ const assignerType = (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.type) || "N/A";
11749
+ const mobileNumber = (item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.mobileNumber) || "N/A";
11750
+ const action = (item === null || item === void 0 ? void 0 : item.performedAction) || "N/A";
11751
+ const status = (item === null || item === void 0 ? void 0 : item.status) || (item === null || item === void 0 ? void 0 : item.state) || "N/A";
11752
+ const rawComment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
11753
+ const comment = typeof rawComment === "string" ? rawComment.split(pattern)[0] : rawComment;
11754
+ const documents = (item === null || item === void 0 ? void 0 : item.wfDocuments) || [];
11755
+ const sla = (item === null || item === void 0 ? void 0 : item.sla) || "N/A";
11756
+ const assignedTo = Array.isArray(item === null || item === void 0 ? void 0 : item.assignes) ? item.assignes.map(a => a === null || a === void 0 ? void 0 : a.name).filter(Boolean).join(", ") : "";
11757
+ return {
11758
+ sNo: index + 1,
11759
+ action: t ? t(action) : action,
11760
+ status: t ? t(status) : status,
11761
+ assignerName,
11762
+ assignerType,
11763
+ mobileNumber,
11764
+ designation: assignerType,
11765
+ date: createdDate,
11766
+ time: timing,
11767
+ dateTime: `${createdDate} ${timing !== "N/A" ? timing : ""}`.trim(),
11768
+ comment,
11769
+ documents: documents.map(doc => ({
11770
+ name: (doc === null || doc === void 0 ? void 0 : doc.fileName) || (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
11771
+ type: (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
11772
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
11773
+ link: pdfDownloadLink(pdfFiles, doc === null || doc === void 0 ? void 0 : doc.fileStoreId)
11774
+ })),
11775
+ hasDocuments: documents.length > 0,
11776
+ sla,
11777
+ assignedTo
11778
+ };
11779
+ });
11780
+ return {
11781
+ t,
11782
+ tenantId: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code) || "",
11783
+ tenantName: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.i18nKey) || "Government Department",
11784
+ name: t ? t("TIMELINE_PDF_TITLE") : "Application Timeline",
11785
+ heading: t ? t("TIMELINE_PDF_HEADING") : "File Movement Report",
11786
+ businessId,
11787
+ businessService: t ? t(`CS_COMMON_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`) : businessService,
11788
+ moduleName,
11789
+ currentStatus: t ? t((timeline === null || timeline === void 0 ? void 0 : (_timeline$ = timeline[0]) === null || _timeline$ === void 0 ? void 0 : _timeline$.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$2 = timeline[0]) === null || _timeline$2 === void 0 ? void 0 : _timeline$2.state) || "N/A") : (timeline === null || timeline === void 0 ? void 0 : (_timeline$3 = timeline[0]) === null || _timeline$3 === void 0 ? void 0 : _timeline$3.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$4 = timeline[0]) === null || _timeline$4 === void 0 ? void 0 : _timeline$4.state) || "N/A",
11790
+ generatedDate: new Date().toLocaleDateString("en-IN", {
11791
+ day: "2-digit",
11792
+ month: "long",
11793
+ year: "numeric"
11794
+ }),
11795
+ generatedDateTime: new Date().toLocaleString("en-IN", {
11796
+ day: "2-digit",
11797
+ month: "2-digit",
11798
+ year: "numeric",
11799
+ hour: "2-digit",
11800
+ minute: "2-digit",
11801
+ hour12: true
11802
+ }),
11803
+ timelineRows,
11804
+ totalSteps: timelineRows.length
11805
+ };
11806
+ };
11807
+
11481
11808
  const PDFSvg$1 = React.memo(({
11482
11809
  width: _width = 20,
11483
11810
  height: _height = 20,
@@ -11520,7 +11847,7 @@ const TimelineDocument = React.memo(({
11520
11847
  return /*#__PURE__*/React.createElement("div", {
11521
11848
  className: "custom-doc-container"
11522
11849
  }, documents === null || documents === void 0 ? void 0 : documents.map((document, idx) => {
11523
- const documentLink = pdfDownloadLink$1(data === null || data === void 0 ? void 0 : data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
11850
+ const documentLink = pdfDownloadLink$1(data === null || data === void 0 ? void 0 : data.pdfFiles, (document === null || document === void 0 ? void 0 : document.fileStoreId) || (document === null || document === void 0 ? void 0 : document.documentUid));
11524
11851
  if (!documentLink) return null;
11525
11852
  return /*#__PURE__*/React.createElement("a", {
11526
11853
  key: idx,
@@ -11533,8 +11860,28 @@ const TimelineDocument = React.memo(({
11533
11860
  });
11534
11861
  function NewApplicationTimeline({
11535
11862
  workflowDetails,
11536
- t
11863
+ t,
11864
+ tenantId = Digit.ULBService.getCurrentTenantId(),
11865
+ timeObj,
11866
+ empUserName = null,
11867
+ handleSetEmpDesignation = () => {}
11537
11868
  }) {
11869
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _employeeData$data, _employeeData$data$Em;
11870
+ const {
11871
+ isLoading,
11872
+ data: docData
11873
+ } = Digit.Hooks.ads.useADSDocumentSearch({
11874
+ value: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : (_workflowDetails$data2 = _workflowDetails$data.timeline) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.flatMap(item => item === null || item === void 0 ? void 0 : item.wfDocuments)) || []
11875
+ }, {
11876
+ value: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.flatMap(item => item === null || item === void 0 ? void 0 : item.wfDocuments)) || []
11877
+ }, null, 0);
11878
+ const handleDownloadPDF = React.useCallback(() => {
11879
+ if (!isLoading) {
11880
+ const tenantInfo = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY") || {};
11881
+ const acknowledgementData = getTimelineAcknowledgementData(workflowDetails, tenantInfo, (docData === null || docData === void 0 ? void 0 : docData.pdfFiles) || {}, t);
11882
+ Digit.Utils.pdf.generateTimelinePDF(acknowledgementData);
11883
+ }
11884
+ }, [workflowDetails, docData, t, isLoading]);
11538
11885
  const parseActionDateTime = auditDetails => {
11539
11886
  if (!(auditDetails !== null && auditDetails !== void 0 && auditDetails.created) || !(auditDetails !== null && auditDetails !== void 0 && auditDetails.timing)) return null;
11540
11887
  const [day, month, year] = auditDetails.created.split("/");
@@ -11573,11 +11920,37 @@ function NewApplicationTimeline({
11573
11920
  return normalized.reverse();
11574
11921
  };
11575
11922
  const data = useMemo(() => normalizeTimeline(workflowDetails), [workflowDetails]);
11576
- const sortedData = data || [];
11577
- console.log("sortedData", sortedData);
11923
+ const sortedData = (data === null || data === void 0 ? void 0 : data.filter(val => !((val === null || val === void 0 ? void 0 : val.performedAction) === "SAVE_AS_DRAFT"))) || [];
11924
+ const codesArray = sortedData.map(item => {
11925
+ var _item$assigner;
11926
+ return item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.userName;
11927
+ }).filter(Boolean);
11928
+ const uniqueCodes = [...new Set(codesArray)].join(",");
11929
+ const employeeData = Digit.Hooks.useEmployeeSearch(tenantId, {
11930
+ codes: uniqueCodes,
11931
+ isActive: true
11932
+ }, {
11933
+ enabled: !!uniqueCodes
11934
+ });
11935
+ const deptMap = {};
11936
+ employeeData === null || employeeData === void 0 ? void 0 : (_employeeData$data = employeeData.data) === null || _employeeData$data === void 0 ? void 0 : (_employeeData$data$Em = _employeeData$data.Employees) === null || _employeeData$data$Em === void 0 ? void 0 : _employeeData$data$Em.forEach(emp => {
11937
+ var _emp$assignments;
11938
+ const assignment = emp === null || emp === void 0 ? void 0 : (_emp$assignments = emp.assignments) === null || _emp$assignments === void 0 ? void 0 : _emp$assignments[0];
11939
+ const translationKey = `COMMON_MASTERS_DESIGNATION_${assignment === null || assignment === void 0 ? void 0 : assignment.designation}`;
11940
+ deptMap[emp === null || emp === void 0 ? void 0 : emp.code] = translationKey;
11941
+ });
11942
+ if (employeeData && empUserName) {
11943
+ handleSetEmpDesignation(t(deptMap[empUserName]));
11944
+ }
11945
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader$1, null);
11578
11946
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11579
11947
  className: "custom-timeline-container"
11580
- }, /*#__PURE__*/React.createElement("div", {
11948
+ }, timeObj && /*#__PURE__*/React.createElement("div", {
11949
+ style: {
11950
+ marginBottom: "8px",
11951
+ fontStyle: "italic"
11952
+ }
11953
+ }, t("TOTAL_TIME_TAKEN"), ": ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.days, " ", t("DAYS"), " ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.hours, " ", t("HOURS"), " ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.minutes, " ", t("MINUTES"), " ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.seconds, " ", t("SECONDS")), /*#__PURE__*/React.createElement("div", {
11581
11954
  className: "custom-timeline-header"
11582
11955
  }, /*#__PURE__*/React.createElement("div", {
11583
11956
  className: "custom-tracking-status-header"
@@ -11591,12 +11964,15 @@ function NewApplicationTimeline({
11591
11964
  className: "custom-title-bar-row"
11592
11965
  }, /*#__PURE__*/React.createElement("h2", {
11593
11966
  className: "custom-timeline-title"
11594
- }, t("Application History")), /*#__PURE__*/React.createElement("div", {
11967
+ }, t("Application History")), /*#__PURE__*/React.createElement("span", {
11968
+ onClick: handleDownloadPDF,
11969
+ className: "download-button"
11970
+ }, t("CS_COMMON_DOWNLOAD")), /*#__PURE__*/React.createElement("div", {
11595
11971
  className: "custom-blue-bar"
11596
11972
  }))), /*#__PURE__*/React.createElement("div", {
11597
11973
  className: "custom-timeline-entries"
11598
11974
  }, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map((item, index) => {
11599
- var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$wfDocuments, _item$wfDocuments2;
11975
+ var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$assigner5, _item$assigner6, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
11600
11976
  return /*#__PURE__*/React.createElement("div", {
11601
11977
  key: index,
11602
11978
  className: "custom-timeline-entry"
@@ -11626,46 +12002,58 @@ function NewApplicationTimeline({
11626
12002
  }, /*#__PURE__*/React.createElement("div", {
11627
12003
  className: "custom-card-top"
11628
12004
  }, /*#__PURE__*/React.createElement("div", {
11629
- className: "custom-card-left"
12005
+ className: "custom-card-column"
11630
12006
  }, /*#__PURE__*/React.createElement("h3", {
11631
12007
  className: "custom-action-title"
11632
12008
  }, t("Action taken by")), (item === null || item === void 0 ? void 0 : item.assigner) && /*#__PURE__*/React.createElement("div", {
11633
12009
  className: "custom-officer-info"
11634
12010
  }, /*#__PURE__*/React.createElement("div", {
11635
12011
  className: "custom-officer-name"
11636
- }, (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || t("CS_COMMON_NA")), (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.emailId) && /*#__PURE__*/React.createElement("div", {
12012
+ }, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA"), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("span", {
12013
+ className: "custom-officer-name"
12014
+ }, "- ", t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName]))), (item === null || item === void 0 ? void 0 : (_item$assigner5 = item.assigner) === null || _item$assigner5 === void 0 ? void 0 : _item$assigner5.emailId) && /*#__PURE__*/React.createElement("div", {
11637
12015
  className: "custom-officer-email"
11638
12016
  }, /*#__PURE__*/React.createElement("span", {
11639
12017
  className: "custom-email-label"
11640
- }, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.emailId))), (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement("div", {
11641
- className: "custom-card-left"
11642
- }, /*#__PURE__*/React.createElement("h3", {
12018
+ }, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.emailId))), /*#__PURE__*/React.createElement("div", {
12019
+ className: "custom-card-column custom-card-column-mid"
12020
+ }, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
11643
12021
  className: "custom-action-title"
11644
12022
  }, t("Time Taken")), /*#__PURE__*/React.createElement("div", {
11645
12023
  className: "custom-officer-email"
11646
12024
  }, /*#__PURE__*/React.createElement("span", {
11647
12025
  className: "custom-email-label"
11648
- }, item === null || item === void 0 ? void 0 : item.sla))), /*#__PURE__*/React.createElement("div", {
11649
- className: "custom-card-right"
12026
+ }, item === null || item === void 0 ? void 0 : item.sla)))), /*#__PURE__*/React.createElement("div", {
12027
+ className: "custom-card-column custom-card-column-right"
11650
12028
  }, /*#__PURE__*/React.createElement("h3", {
11651
12029
  className: "custom-action-title"
11652
12030
  }, t("Action")), /*#__PURE__*/React.createElement("div", {
11653
12031
  className: "custom-status-text"
11654
12032
  }, t((item === null || item === void 0 ? void 0 : item.performedAction) || "CS_COMMON_NA")))), (item === null || item === void 0 ? void 0 : item.wfComment) && (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment.length) > 0 && (item === null || item === void 0 ? void 0 : (_item$wfComment2 = item.wfComment) === null || _item$wfComment2 === void 0 ? void 0 : _item$wfComment2.some(c => c === null || c === void 0 ? void 0 : c.trim())) && /*#__PURE__*/React.createElement("div", {
11655
- className: "custom-comments-section"
12033
+ className: "custom-comments-section container-full-width"
11656
12034
  }, /*#__PURE__*/React.createElement("div", {
11657
- className: "custom-comment-text"
12035
+ className: "custom-comments-content"
11658
12036
  }, /*#__PURE__*/React.createElement("h4", {
11659
12037
  className: "custom-comments-title"
11660
- }, t("Officer Comments")), item === null || item === void 0 ? void 0 : (_item$wfComment3 = item.wfComment) === null || _item$wfComment3 === void 0 ? void 0 : _item$wfComment3.map((comment, idx) => /*#__PURE__*/React.createElement("p", {
11661
- key: idx
11662
- }, comment))), (item === null || item === void 0 ? void 0 : (_item$assignes = item.assignes) === null || _item$assignes === void 0 ? void 0 : _item$assignes.length) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", {
12038
+ }, t("Officer Comments")), /*#__PURE__*/React.createElement("div", {
12039
+ className: "custom-comment-text"
12040
+ }, item === null || item === void 0 ? void 0 : (_item$wfComment3 = item.wfComment) === null || _item$wfComment3 === void 0 ? void 0 : _item$wfComment3.map((comment, idx) => {
12041
+ const pattern = /\[#\?.*?\*\*\]/;
12042
+ const truncatedComment = typeof comment === "string" ? comment === null || comment === void 0 ? void 0 : comment.split(pattern)[0] : comment;
12043
+ return /*#__PURE__*/React.createElement("p", {
12044
+ key: idx
12045
+ }, truncatedComment);
12046
+ }))), (item === null || item === void 0 ? void 0 : (_item$assignes = item.assignes) === null || _item$assignes === void 0 ? void 0 : _item$assignes.length) > 0 && /*#__PURE__*/React.createElement("div", {
12047
+ className: "custom-assigned-to-footer"
12048
+ }, /*#__PURE__*/React.createElement("h3", {
11663
12049
  className: "custom-comments-title"
11664
12050
  }, t("Assigned To")), /*#__PURE__*/React.createElement("div", {
11665
12051
  className: "custom-officer-info"
11666
12052
  }, /*#__PURE__*/React.createElement("div", {
11667
12053
  className: "custom-officer-name"
11668
- }, (_item$assignes$ = item.assignes[0]) === null || _item$assignes$ === void 0 ? void 0 : _item$assignes$.name)))), (item === null || item === void 0 ? void 0 : item.wfDocuments) && (item === null || item === void 0 ? void 0 : (_item$wfDocuments = item.wfDocuments) === null || _item$wfDocuments === void 0 ? void 0 : _item$wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", {
12054
+ }, (_item$assignes$ = item.assignes[0]) === null || _item$assignes$ === void 0 ? void 0 : _item$assignes$.name, deptMap[(_item$assignes$2 = item.assignes[0]) === null || _item$assignes$2 === void 0 ? void 0 : _item$assignes$2.userName] && /*#__PURE__*/React.createElement("span", {
12055
+ className: "custom-officer-email"
12056
+ }, "- ", t(deptMap[(_item$assignes$3 = item.assignes[0]) === null || _item$assignes$3 === void 0 ? void 0 : _item$assignes$3.userName])))))), (item === null || item === void 0 ? void 0 : item.wfDocuments) && (item === null || item === void 0 ? void 0 : (_item$wfDocuments = item.wfDocuments) === null || _item$wfDocuments === void 0 ? void 0 : _item$wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", {
11669
12057
  className: "custom-comments-section-no-border"
11670
12058
  }, /*#__PURE__*/React.createElement("h4", {
11671
12059
  className: "custom-comments-title"
@@ -12263,6 +12651,7 @@ const NDCModal = ({
12263
12651
  formId: "modal-action"
12264
12652
  }, /*#__PURE__*/React.createElement(FormComposer, {
12265
12653
  config: config.form,
12654
+ className: "BPAemployeeCard bpa-workflow-modal-form",
12266
12655
  noBoxShadow: true,
12267
12656
  inline: true,
12268
12657
  childrenAtTheBottom: true,
@@ -12279,7 +12668,7 @@ const NDCModal = ({
12279
12668
  };
12280
12669
 
12281
12670
  const ChallanApplicationDetails$1 = () => {
12282
- var _getChallanData$proce, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _getChallanData$conne, _getChallanData$conne2, _getChallanData$conne3, _getChallanData$conne4, _getChallanData$conne5, _getChallanData$conne6, _getChallanData$conne7, _getChallanData$conne8, _getChallanData$conne9, _getChallanData$conne0, _getChallanData$docum, _getChallanData$docum2, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12;
12671
+ var _getChallanData$proce, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _user$info2, _user$info2$roles$fin, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _getChallanData$conne, _getChallanData$conne2, _getChallanData$conne3, _getChallanData$conne4, _getChallanData$conne5, _getChallanData$conne6, _getChallanData$conne7, _getChallanData$conne8, _getChallanData$conne9, _getChallanData$conne0, _getChallanData$docum, _getChallanData$docum2, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12;
12283
12672
  const {
12284
12673
  t
12285
12674
  } = useTranslation();
@@ -12302,6 +12691,13 @@ const ChallanApplicationDetails$1 = () => {
12302
12691
  const [getEmployees, setEmployees] = useState([]);
12303
12692
  const [errorOne, setErrorOne] = useState(null);
12304
12693
  const menuRef = useRef();
12694
+ const [showOptions, setShowOptions] = useState(false);
12695
+ const {
12696
+ data: storeData
12697
+ } = Digit.Hooks.useStore.getInitData();
12698
+ const {
12699
+ tenants
12700
+ } = storeData || {};
12305
12701
  const fetchChallans = async filters => {
12306
12702
  setLoader(true);
12307
12703
  try {
@@ -12356,6 +12752,82 @@ const ChallanApplicationDetails$1 = () => {
12356
12752
  console.log("workflowDetails", workflowDetails);
12357
12753
  let user = Digit.UserService.getUser();
12358
12754
  const userRoles = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.map(e => e.code);
12755
+ const isCemp = user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : (_user$info2$roles$fin = _user$info2.roles.find(role => role.code === "GC_CEMP")) === null || _user$info2$roles$fin === void 0 ? void 0 : _user$info2$roles$fin.code;
12756
+ const getAcknowledgement = async () => {
12757
+ setLoader(true);
12758
+ try {
12759
+ const applications = getChallanData;
12760
+ const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
12761
+ const acknowldgementDataAPI = await getAcknowledgementData({
12762
+ ...applications
12763
+ }, tenantInfo, t);
12764
+ setTimeout(() => {
12765
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
12766
+ setLoader(false);
12767
+ }, 0);
12768
+ } catch (error) {
12769
+ console.error("Error generating acknowledgement:", error);
12770
+ setLoader(false);
12771
+ }
12772
+ };
12773
+ const {
12774
+ data: reciept_data,
12775
+ isLoading: recieptDataLoading
12776
+ } = Digit.Hooks.useRecieptSearch({
12777
+ tenantId: tenantId,
12778
+ businessService: "GC.ONE_TIME_FEE",
12779
+ consumerCodes: id,
12780
+ isEmployee: true
12781
+ }, {
12782
+ enabled: id ? true : false
12783
+ });
12784
+ const dowloadOptions = [];
12785
+ dowloadOptions.push({
12786
+ label: t("CHB_DOWNLOAD_ACK_FORM"),
12787
+ onClick: () => getAcknowledgement()
12788
+ });
12789
+ async function getRecieptSearch({
12790
+ tenantId,
12791
+ payments,
12792
+ ...params
12793
+ }) {
12794
+ setLoader(true);
12795
+ try {
12796
+ var _response;
12797
+ let response = null;
12798
+ if (payments !== null && payments !== void 0 && payments.fileStoreId) {
12799
+ response = {
12800
+ filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
12801
+ };
12802
+ } else {
12803
+ response = await Digit.PaymentService.generatePdf(tenantId, {
12804
+ Payments: [{
12805
+ ...payments
12806
+ }]
12807
+ }, "garbage-receipt");
12808
+ }
12809
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
12810
+ fileStoreIds: response.filestoreIds[0]
12811
+ });
12812
+ setLoader(false);
12813
+ window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
12814
+ } catch (error) {
12815
+ console.error(error);
12816
+ setLoader(false);
12817
+ }
12818
+ }
12819
+ if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
12820
+ dowloadOptions.push({
12821
+ label: t("PTR_FEE_RECIEPT"),
12822
+ onClick: () => {
12823
+ var _reciept_data$Payment;
12824
+ return getRecieptSearch({
12825
+ tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
12826
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
12827
+ });
12828
+ }
12829
+ });
12830
+ }
12359
12831
  let actions = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : (_workflowDetails$data7 = _workflowDetails$data6.actionState) === null || _workflowDetails$data7 === void 0 ? void 0 : (_workflowDetails$data8 = _workflowDetails$data7.nextActions) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.filter(e => {
12360
12832
  return (userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => {
12361
12833
  var _e$roles;
@@ -12433,7 +12905,16 @@ const ChallanApplicationDetails$1 = () => {
12433
12905
  setLoader(false);
12434
12906
  }
12435
12907
  };
12436
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
12908
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
12909
+ className: "cardHeaderWithOptions ral-app-details-header"
12910
+ }, /*#__PURE__*/React.createElement(Header, {
12911
+ className: "ral-header-32"
12912
+ }, t("Application Details")), isCemp && ((getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus) === "APPROVED" || (getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus) === "CONNECTION_ACTIVATED") && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
12913
+ className: "multilinkWrapper",
12914
+ onHeadClick: () => setShowOptions(!showOptions),
12915
+ displayOptions: showOptions,
12916
+ options: dowloadOptions
12917
+ })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
12437
12918
  style: {
12438
12919
  fontSize: "24px",
12439
12920
  margin: "30px 0 5px"
@@ -12580,6 +13061,15 @@ const GenerateBill = () => {
12580
13061
  const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
12581
13062
  const [loader, setLoader] = useState(false);
12582
13063
  const [getData, setData] = useState();
13064
+ const [showToast, setShowToast] = useState(false);
13065
+ const [error, setError] = useState("");
13066
+ const [getLable, setLable] = useState(false);
13067
+ const {
13068
+ data: FreqType = [],
13069
+ isLoading: FreqTypeLoading
13070
+ } = Digit.Hooks.useCustomMDMS(tenantId, "gc-services-masters", [{
13071
+ name: "GarbageCollectionFrequency"
13072
+ }]);
12583
13073
  const {
12584
13074
  control,
12585
13075
  handleSubmit,
@@ -12592,7 +13082,32 @@ const GenerateBill = () => {
12592
13082
  clearErrors
12593
13083
  } = useForm();
12594
13084
  const onSubmit = async data => {
12595
- console.log("data===", data);
13085
+ var _data$batch, _data$locality, _data$frequency, _data$batchOrLocality;
13086
+ setLoader(true);
13087
+ const payload = {
13088
+ billScheduler: {
13089
+ tenantId: tenantId,
13090
+ locality: (data === null || data === void 0 ? void 0 : (_data$batch = data.batch) === null || _data$batch === void 0 ? void 0 : _data$batch.code) || (data === null || data === void 0 ? void 0 : (_data$locality = data.locality) === null || _data$locality === void 0 ? void 0 : _data$locality.code),
13091
+ billingcycleStartdate: 0,
13092
+ transactionType: data === null || data === void 0 ? void 0 : (_data$frequency = data.frequency) === null || _data$frequency === void 0 ? void 0 : _data$frequency.name,
13093
+ billingcycleEnddate: 0,
13094
+ isBatch: (data === null || data === void 0 ? void 0 : (_data$batchOrLocality = data.batchOrLocality) === null || _data$batchOrLocality === void 0 ? void 0 : _data$batchOrLocality.name) == "Batch" ? true : false,
13095
+ isGroup: false
13096
+ }
13097
+ };
13098
+ try {
13099
+ const response = await Digit.GCService.schedulerCreate(payload);
13100
+ setLoader(false);
13101
+ setLable("Bill Generated Successfully");
13102
+ setError(false);
13103
+ setShowToast(true);
13104
+ console.log("response", response);
13105
+ } catch (error) {
13106
+ setLoader(false);
13107
+ }
13108
+ };
13109
+ const closeToast = () => {
13110
+ setShowToast(null);
12596
13111
  };
12597
13112
  const batchLocality = [{
12598
13113
  name: "Batch",
@@ -12648,7 +13163,7 @@ const GenerateBill = () => {
12648
13163
  control: control,
12649
13164
  name: "batchOrLocality",
12650
13165
  rules: {
12651
- required: t("GC_BATCH_LOCALITY_REQUIRED")
13166
+ required: t("This field is required")
12652
13167
  },
12653
13168
  render: props => /*#__PURE__*/React.createElement(Dropdown, {
12654
13169
  style: {
@@ -12721,7 +13236,39 @@ const GenerateBill = () => {
12721
13236
  style: {
12722
13237
  color: "red"
12723
13238
  }
12724
- }, errors.batch.message))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
13239
+ }, errors.batch.message)), /*#__PURE__*/React.createElement("div", {
13240
+ style: {
13241
+ flex: "0 0 20%",
13242
+ maxWidth: "20%"
13243
+ }
13244
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("GC_FREQUENCY")}`, "*"), /*#__PURE__*/React.createElement(Controller, {
13245
+ control: control,
13246
+ name: "frequency",
13247
+ rules: {
13248
+ required: t("GC_FREQUENCY_REQUIRED")
13249
+ },
13250
+ render: props => {
13251
+ var _FreqType$gcServices;
13252
+ return /*#__PURE__*/React.createElement(Dropdown, {
13253
+ style: {
13254
+ marginBottom: 0,
13255
+ width: "100%"
13256
+ },
13257
+ className: "form-field",
13258
+ select: e => {
13259
+ props.onChange(e);
13260
+ },
13261
+ selected: props.value,
13262
+ option: FreqType === null || FreqType === void 0 ? void 0 : (_FreqType$gcServices = FreqType["gc-services-masters"]) === null || _FreqType$gcServices === void 0 ? void 0 : _FreqType$gcServices.GarbageCollectionFrequency,
13263
+ optionKey: "name",
13264
+ t: t
13265
+ });
13266
+ }
13267
+ }), (errors === null || errors === void 0 ? void 0 : errors.frequency) && /*#__PURE__*/React.createElement("p", {
13268
+ style: {
13269
+ color: "red"
13270
+ }
13271
+ }, errors.frequency.message))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
12725
13272
  style: {
12726
13273
  background: "#eee",
12727
13274
  color: "black",
@@ -12732,11 +13279,55 @@ const GenerateBill = () => {
12732
13279
  }), /*#__PURE__*/React.createElement(SubmitBar, {
12733
13280
  label: "Generate Bill",
12734
13281
  submit: "submit"
12735
- }))), loader && /*#__PURE__*/React.createElement(Loader, {
13282
+ }))), showToast && /*#__PURE__*/React.createElement(Toast, {
13283
+ isDleteBtn: true,
13284
+ error: error,
13285
+ label: getLable,
13286
+ onClose: closeToast
13287
+ }), (loader || FreqTypeLoading) && /*#__PURE__*/React.createElement(Loader, {
12736
13288
  page: true
12737
13289
  }));
12738
13290
  };
12739
13291
 
13292
+ const ApplicationTable = ({
13293
+ t,
13294
+ currentPage,
13295
+ columns,
13296
+ data,
13297
+ getCellProps,
13298
+ disableSort,
13299
+ onSort,
13300
+ onNextPage,
13301
+ onPrevPage,
13302
+ onPageSizeChange,
13303
+ isPaginationRequired,
13304
+ pageSizeLimit,
13305
+ sortParams,
13306
+ totalRecords
13307
+ }) => {
13308
+ return /*#__PURE__*/React.createElement(Table, {
13309
+ t: t,
13310
+ data: data,
13311
+ currentPage: currentPage,
13312
+ columns: columns,
13313
+ getCellProps: getCellProps,
13314
+ onNextPage: onNextPage,
13315
+ onPrevPage: onPrevPage,
13316
+ pageSizeLimit: pageSizeLimit,
13317
+ disableSort: disableSort,
13318
+ isPaginationRequired: isPaginationRequired,
13319
+ onPageSizeChange: onPageSizeChange,
13320
+ onSort: onSort,
13321
+ sortParams: sortParams,
13322
+ totalRecords: totalRecords
13323
+ });
13324
+ };
13325
+
13326
+ const defaultValues = {
13327
+ locality: null,
13328
+ billNo: "",
13329
+ mobileNumber: ""
13330
+ };
12740
13331
  const BillGenie = () => {
12741
13332
  const dispatch = useDispatch();
12742
13333
  const history = useHistory();
@@ -12746,6 +13337,10 @@ const BillGenie = () => {
12746
13337
  const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
12747
13338
  const [loader, setLoader] = useState(false);
12748
13339
  const [getData, setData] = useState();
13340
+ const [getBills, setBills] = useState([]);
13341
+ const GetCell = value => /*#__PURE__*/React.createElement("span", {
13342
+ className: "cell-text styled-cell"
13343
+ }, value);
12749
13344
  const {
12750
13345
  control,
12751
13346
  handleSubmit,
@@ -12755,10 +13350,117 @@ const BillGenie = () => {
12755
13350
  },
12756
13351
  getValues,
12757
13352
  watch,
12758
- clearErrors
12759
- } = useForm();
13353
+ clearErrors,
13354
+ reset
13355
+ } = useForm({
13356
+ defaultValues
13357
+ });
12760
13358
  const onSubmit = async data => {
12761
- console.log("data===", data);
13359
+ var _data$billNo, _data$mobileNumber, _data$locality;
13360
+ const hasAtLeastOneField = (data === null || data === void 0 ? void 0 : data.locality) || (data === null || data === void 0 ? void 0 : (_data$billNo = data.billNo) === null || _data$billNo === void 0 ? void 0 : _data$billNo.trim()) || (data === null || data === void 0 ? void 0 : (_data$mobileNumber = data.mobileNumber) === null || _data$mobileNumber === void 0 ? void 0 : _data$mobileNumber.trim());
13361
+ if (!hasAtLeastOneField) {
13362
+ alert(t("Please select at least one search criteria"));
13363
+ return;
13364
+ }
13365
+ setLoader(true);
13366
+ const payload = {
13367
+ searchCriteria: {
13368
+ tenantId: tenantId,
13369
+ url: "egov-searcher/bill-genie/garbagecollectionbills/_get",
13370
+ businesService: "GC",
13371
+ ...((data === null || data === void 0 ? void 0 : (_data$locality = data.locality) === null || _data$locality === void 0 ? void 0 : _data$locality.code) && {
13372
+ locality: data.locality.code
13373
+ }),
13374
+ ...((data === null || data === void 0 ? void 0 : data.billNo) && {
13375
+ consumerCode: data.billNo
13376
+ }),
13377
+ ...((data === null || data === void 0 ? void 0 : data.mobileNumber) && {
13378
+ mobileNumber: data.mobileNumber
13379
+ })
13380
+ }
13381
+ };
13382
+ try {
13383
+ const response = await Digit.GCService.billGenieSearch(payload);
13384
+ setLoader(false);
13385
+ setBills(response === null || response === void 0 ? void 0 : response.Bills);
13386
+ } catch (error) {
13387
+ setLoader(false);
13388
+ }
13389
+ };
13390
+ const handleApiData = async () => {
13391
+ setLoader(true);
13392
+ const filters = {};
13393
+ filters.hierarchyTypeCode = "REVENUE";
13394
+ filters.boundaryType = "Locality";
13395
+ try {
13396
+ var _response$TenantBound, _response$TenantBound2;
13397
+ const response = await Digit.GCService.location({
13398
+ tenantId,
13399
+ filters
13400
+ });
13401
+ setLoader(false);
13402
+ setData(response === null || response === void 0 ? void 0 : (_response$TenantBound = response.TenantBoundary) === null || _response$TenantBound === void 0 ? void 0 : (_response$TenantBound2 = _response$TenantBound[0]) === null || _response$TenantBound2 === void 0 ? void 0 : _response$TenantBound2.boundary);
13403
+ } catch (error) {
13404
+ setLoader(false);
13405
+ }
13406
+ };
13407
+ useEffect(() => {
13408
+ handleApiData();
13409
+ }, []);
13410
+ const columns = [{
13411
+ Header: `${t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")}`,
13412
+ accessor: "uuid"
13413
+ }, {
13414
+ Header: `${t("TL_COMMON_TABLE_COL_APP_DATE")}`,
13415
+ accessor: "createdtime",
13416
+ Cell: ({
13417
+ row
13418
+ }) => {
13419
+ var _row$original, _row$original2;
13420
+ console.log("row", row);
13421
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, (_row$original = row.original) !== null && _row$original !== void 0 && _row$original.createdtime ? GetCell(format(new Date((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.createdtime), "dd/MM/yyyy")) : ""));
13422
+ }
13423
+ }, {
13424
+ Header: `${t("PT_COMMON_TABLE_COL_STATUS_LABEL")}`,
13425
+ accessor: "status"
13426
+ }, {
13427
+ Header: `${t("Action")}`,
13428
+ accessor: "action",
13429
+ Cell: ({
13430
+ row
13431
+ }) => {
13432
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SubmitBar, {
13433
+ label: "Download",
13434
+ onSubmit: () => getRecieptSearch({
13435
+ tenantId,
13436
+ bills: getBills
13437
+ })
13438
+ }));
13439
+ }
13440
+ }];
13441
+ const slotlistRows = (getBills === null || getBills === void 0 ? void 0 : getBills.map(bills => ({
13442
+ uuid: bills === null || bills === void 0 ? void 0 : bills.consumerCode,
13443
+ createdtime: bills === null || bills === void 0 ? void 0 : bills.billDate,
13444
+ status: t(bills.status)
13445
+ }))) || [];
13446
+ const getRecieptSearch = async ({
13447
+ tenantId,
13448
+ bills
13449
+ }) => {
13450
+ try {
13451
+ setLoader(true);
13452
+ const response = await Digit.PaymentService.generatePdf(tenantId, {
13453
+ Bills: [...bills]
13454
+ }, "garbage-bill");
13455
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
13456
+ fileStoreIds: response.filestoreIds[0]
13457
+ });
13458
+ window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
13459
+ } catch (error) {
13460
+ console.error("Receipt generation failed", error);
13461
+ } finally {
13462
+ setLoader(false);
13463
+ }
12762
13464
  };
12763
13465
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, {
12764
13466
  style: {
@@ -12779,7 +13481,7 @@ const BillGenie = () => {
12779
13481
  flex: "0 0 20%",
12780
13482
  maxWidth: "20%"
12781
13483
  }
12782
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("ULB")}`), /*#__PURE__*/React.createElement(Controller, {
13484
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CS_SWACH_LOCALITY")}`, "*"), /*#__PURE__*/React.createElement(Controller, {
12783
13485
  control: control,
12784
13486
  name: "locality",
12785
13487
  render: props => /*#__PURE__*/React.createElement(Dropdown, {
@@ -12792,33 +13494,7 @@ const BillGenie = () => {
12792
13494
  props.onChange(e);
12793
13495
  },
12794
13496
  selected: props.value,
12795
- option: [],
12796
- optionKey: "name",
12797
- t: t
12798
- })
12799
- }), (errors === null || errors === void 0 ? void 0 : errors.locality) && /*#__PURE__*/React.createElement("p", {
12800
- style: {
12801
- color: "red"
12802
- }
12803
- }, errors.locality.message)), /*#__PURE__*/React.createElement("div", {
12804
- style: {
12805
- flex: "0 0 20%",
12806
- maxWidth: "20%"
12807
- }
12808
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Service Category")}`), /*#__PURE__*/React.createElement(Controller, {
12809
- control: control,
12810
- name: "locality",
12811
- render: props => /*#__PURE__*/React.createElement(Dropdown, {
12812
- style: {
12813
- marginBottom: 0,
12814
- width: "100%"
12815
- },
12816
- className: "form-field",
12817
- select: e => {
12818
- props.onChange(e);
12819
- },
12820
- selected: props.value,
12821
- option: [],
13497
+ option: getData,
12822
13498
  optionKey: "name",
12823
13499
  t: t
12824
13500
  })
@@ -12831,40 +13507,7 @@ const BillGenie = () => {
12831
13507
  flex: "0 0 20%",
12832
13508
  maxWidth: "20%"
12833
13509
  }
12834
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NDC_MSG_PROPERTY_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
12835
- style: {
12836
- color: "red"
12837
- }
12838
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
12839
- control: control,
12840
- name: "propertyId",
12841
- render: props => {
12842
- var _errors$name;
12843
- return /*#__PURE__*/React.createElement(TextInput, {
12844
- style: {
12845
- marginBottom: 0
12846
- },
12847
- value: props.value,
12848
- error: errors === null || errors === void 0 ? void 0 : (_errors$name = errors.name) === null || _errors$name === void 0 ? void 0 : _errors$name.message,
12849
- onChange: e => {
12850
- props.onChange(e.target.value);
12851
- },
12852
- onBlur: e => {
12853
- props.onBlur(e);
12854
- },
12855
- t: t
12856
- });
12857
- }
12858
- })), /*#__PURE__*/React.createElement("div", {
12859
- style: {
12860
- flex: "0 0 20%",
12861
- maxWidth: "20%"
12862
- }
12863
- }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Bill No.")}`, " ", /*#__PURE__*/React.createElement("span", {
12864
- style: {
12865
- color: "red"
12866
- }
12867
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
13510
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Bill No.")}`), /*#__PURE__*/React.createElement(Controller, {
12868
13511
  control: control,
12869
13512
  name: "billNo",
12870
13513
  render: props => /*#__PURE__*/React.createElement(TextInput, {
@@ -12905,14 +13548,33 @@ const BillGenie = () => {
12905
13548
  onBlur: props.onBlur,
12906
13549
  t: t
12907
13550
  })
12908
- }))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
13551
+ }))), getBills.length > 0 && /*#__PURE__*/React.createElement("div", {
13552
+ className: "tableClass"
13553
+ }, /*#__PURE__*/React.createElement(ApplicationTable, {
13554
+ t: t,
13555
+ data: slotlistRows,
13556
+ columns: columns,
13557
+ getCellProps: cellInfo => ({
13558
+ style: {
13559
+ minWidth: "150px",
13560
+ padding: "10px",
13561
+ fontSize: "16px",
13562
+ paddingLeft: "20px"
13563
+ }
13564
+ }),
13565
+ isPaginationRequired: false,
13566
+ totalRecords: slotlistRows.length
13567
+ })), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
12909
13568
  style: {
12910
13569
  background: "#eee",
12911
13570
  color: "black",
12912
13571
  border: "1px solid"
12913
13572
  },
12914
13573
  label: "Reset",
12915
- submit: "submit"
13574
+ onSubmit: () => {
13575
+ reset(defaultValues);
13576
+ setBills([]);
13577
+ }
12916
13578
  }), /*#__PURE__*/React.createElement(SubmitBar, {
12917
13579
  label: "Search",
12918
13580
  submit: "submit"