@djb25/digit-ui-module-ekyc 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1338 -591
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/Module.js +25 -7
- package/src/components/AadhaarVerification.js +415 -0
- package/src/components/AddressDetails.js +207 -0
- package/src/components/CeoDashboard.js +205 -0
- package/src/components/DesktopInbox.js +1 -1
- package/src/components/EKYCCard.js +4 -0
- package/src/components/MeterDetails.js +372 -0
- package/src/components/PropertyInfo.js +303 -0
- package/src/components/Review.js +572 -0
- package/src/components/SearchFormFieldsComponent.js +3 -3
- package/src/components/analytics/charts/ClusterHeatmap.js +88 -0
- package/src/components/analytics/charts/TaskStatusChart.js +92 -0
- package/src/components/analytics/components/AnalyticsTable.js +106 -0
- package/src/components/analytics/components/DashboardLayout.js +72 -0
- package/src/components/analytics/components/EmptyState.js +27 -0
- package/src/components/analytics/components/ErrorBoundary.js +27 -0
- package/src/components/analytics/components/FilterBar.js +73 -0
- package/src/components/analytics/components/NotificationPanel.js +77 -0
- package/src/components/analytics/components/SLAWidget.js +56 -0
- package/src/components/analytics/components/SkeletonLoader.js +53 -0
- package/src/components/analytics/components/SummaryCard.js +74 -0
- package/src/components/analytics/components/WorkflowTimeline.js +55 -0
- package/src/components/analytics/styles/Dashboard.css +54 -0
- package/src/components/analytics/utils/exportUtils.js +64 -0
- package/src/components/analytics/utils/filterSerializer.js +50 -0
- package/src/config/config.js +1 -1
- package/src/pages/citizen/index.js +74 -18
- package/src/pages/employee/ConsumerDetails.js +10 -281
- package/src/pages/employee/Inbox.js +6 -4
- package/src/pages/employee/index.js +44 -8
- package/src/pages/employee/AadhaarVerification.js +0 -512
- package/src/pages/employee/AddressDetails.js +0 -548
- package/src/pages/employee/MeterDetails.js +0 -496
- package/src/pages/employee/PropertyInfo.js +0 -489
- package/src/pages/employee/Review.js +0 -314
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useMemo, useState, createContext, isValidElement, cloneElement, createElement, useContext, useCallback, useReducer, Fragment } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { useHistory, Link, useLocation, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
|
|
4
|
-
import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label,
|
|
4
|
+
import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, InboxComposer, Toast, Modal, RadioButtons, CardHeader, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, ActionBar, LinkButton, EditIcon as EditIcon$1, FormStep, CardLabel, UploadFile, VerticalTimeline, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, ModuleLinksView, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
|
|
5
5
|
import * as Chartjs from 'chart.js/auto';
|
|
6
6
|
import Chartjs__default, { Chart } from 'chart.js/auto';
|
|
7
7
|
import 'react-dom';
|
|
@@ -24,6 +24,9 @@ const EKYCCard = () => {
|
|
|
24
24
|
}, {
|
|
25
25
|
label: t("EKYC_INBOX"),
|
|
26
26
|
link: `/digit-ui/employee/ekyc/inbox`
|
|
27
|
+
}, {
|
|
28
|
+
label: t("CEO_M.F_DOR_FINANCE_VIEW"),
|
|
29
|
+
link: `/digit-ui/employee/ekyc/ceo-dashboard`
|
|
27
30
|
}, {
|
|
28
31
|
label: t("EKYC_MAPPING"),
|
|
29
32
|
link: `/digit-ui/employee/ekyc/mapping`
|
|
@@ -332,7 +335,7 @@ const DesktopInbox = ({
|
|
|
332
335
|
}
|
|
333
336
|
}], [t, parentRoute]);
|
|
334
337
|
const tableData = useMemo(() => {
|
|
335
|
-
return (data === null || data === void 0 ? void 0 : data.items) || [];
|
|
338
|
+
return (data === null || data === void 0 ? void 0 : data.items) || (Array.isArray(data) ? data : []);
|
|
336
339
|
}, [data]);
|
|
337
340
|
return /*#__PURE__*/React.createElement("div", {
|
|
338
341
|
className: "app-container"
|
|
@@ -1080,7 +1083,7 @@ const SearchFormFieldsComponents = ({
|
|
|
1080
1083
|
className: "mobile-input"
|
|
1081
1084
|
}, /*#__PURE__*/React.createElement(Label, {
|
|
1082
1085
|
className: "flex-roww flex-gap-2"
|
|
1083
|
-
}, t("EKYC_K_NUMBER") || "K Number", /*#__PURE__*/React.createElement(
|
|
1086
|
+
}, t("EKYC_K_NUMBER") || "K Number", /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
1084
1087
|
message: t("EKYC_K_NUMBER_MESSAGE")
|
|
1085
1088
|
})), /*#__PURE__*/React.createElement(Controller, {
|
|
1086
1089
|
name: "kNumber",
|
|
@@ -1180,13 +1183,14 @@ const Inbox = ({
|
|
|
1180
1183
|
sla: 0
|
|
1181
1184
|
};
|
|
1182
1185
|
}
|
|
1186
|
+
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
1183
1187
|
return {
|
|
1184
1188
|
...item,
|
|
1185
1189
|
applicationNo: item.kno || item.applicationNumber || "",
|
|
1186
|
-
connectionNo: item.
|
|
1187
|
-
owner: item.consumerName || item.citizenName || "",
|
|
1190
|
+
connectionNo: item.kno || "",
|
|
1191
|
+
owner: fullName || item.consumerName || item.citizenName || "",
|
|
1188
1192
|
applicationNumber: item.kno || item.applicationNumber || "",
|
|
1189
|
-
citizenName: item.consumerName || item.citizenName || "",
|
|
1193
|
+
citizenName: fullName || item.consumerName || item.citizenName || "",
|
|
1190
1194
|
status: item.status || "",
|
|
1191
1195
|
sla: item.sla ?? 0
|
|
1192
1196
|
};
|
|
@@ -1195,7 +1199,7 @@ const Inbox = ({
|
|
|
1195
1199
|
const totalRecords = (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo2 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo2 === void 0 ? void 0 : _dashboardData$dashbo2.totalRecords) || (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.totalCount) || 0;
|
|
1196
1200
|
const checkPathName = location.pathname.includes("ekyc/inbox");
|
|
1197
1201
|
const PropsForInboxLinks = {
|
|
1198
|
-
headerText: checkPathName ? "
|
|
1202
|
+
headerText: checkPathName ? "EKYC_MODULE" : "MODULE_SW"
|
|
1199
1203
|
};
|
|
1200
1204
|
const SearchFormFields = useCallback(({
|
|
1201
1205
|
registerRef,
|
|
@@ -1359,7 +1363,8 @@ const Inbox = ({
|
|
|
1359
1363
|
PropsForInboxLinks
|
|
1360
1364
|
}, propsForSearchForm, propsForFilterForm, {
|
|
1361
1365
|
propsForInboxTable,
|
|
1362
|
-
formState
|
|
1366
|
+
formState,
|
|
1367
|
+
countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo
|
|
1363
1368
|
})));
|
|
1364
1369
|
};
|
|
1365
1370
|
|
|
@@ -2720,9 +2725,6 @@ const ActionButton = ({
|
|
|
2720
2725
|
jumpTo,
|
|
2721
2726
|
state
|
|
2722
2727
|
}) => {
|
|
2723
|
-
const {
|
|
2724
|
-
t
|
|
2725
|
-
} = useTranslation();
|
|
2726
2728
|
const history = useHistory();
|
|
2727
2729
|
function routeTo() {
|
|
2728
2730
|
history.push(jumpTo, {
|
|
@@ -2733,13 +2735,15 @@ const ActionButton = ({
|
|
|
2733
2735
|
return /*#__PURE__*/React.createElement(LinkButton, {
|
|
2734
2736
|
label: /*#__PURE__*/React.createElement(EditIcon$1, {
|
|
2735
2737
|
style: {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
bottom: "32px"
|
|
2738
|
+
width: "20px",
|
|
2739
|
+
height: "20px",
|
|
2740
|
+
fill: "#F47738"
|
|
2740
2741
|
}
|
|
2741
2742
|
}),
|
|
2742
|
-
|
|
2743
|
+
style: {
|
|
2744
|
+
margin: 0,
|
|
2745
|
+
padding: 0
|
|
2746
|
+
},
|
|
2743
2747
|
onClick: routeTo
|
|
2744
2748
|
});
|
|
2745
2749
|
};
|
|
@@ -2747,16 +2751,145 @@ const checkForNA = value => value !== null && value !== undefined && value !== "
|
|
|
2747
2751
|
const boolToYesNo = (value, t) => {
|
|
2748
2752
|
if (value === true || value === "true" || String(value).toLowerCase() === "yes") return t("CORE_COMMON_YES");
|
|
2749
2753
|
if (value === false || value === "false" || String(value).toLowerCase() === "no") return t("CORE_COMMON_NO");
|
|
2754
|
+
if (value === "true") return t("CORE_COMMON_YES");
|
|
2755
|
+
if (value === "false") return t("CORE_COMMON_NO");
|
|
2750
2756
|
return "N/A";
|
|
2751
2757
|
};
|
|
2752
|
-
const
|
|
2758
|
+
const extractReviewData = (searchData, flowState) => {
|
|
2753
2759
|
const rawData = searchData && Object.keys(searchData).length > 0 ? searchData : (flowState === null || flowState === void 0 ? void 0 : flowState.reviewData) || {};
|
|
2754
|
-
const reviewWrapper = (rawData === null || rawData === void 0 ? void 0 : rawData.applicationReview) || rawData;
|
|
2760
|
+
const reviewWrapper = (rawData === null || rawData === void 0 ? void 0 : rawData.applicationReviewInfo) || (rawData === null || rawData === void 0 ? void 0 : rawData.applicationReview) || rawData;
|
|
2755
2761
|
const applicationData = (Array.isArray(reviewWrapper) ? reviewWrapper[0] : reviewWrapper) || {};
|
|
2756
|
-
return
|
|
2762
|
+
return {
|
|
2763
|
+
newData: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.newData) || applicationData,
|
|
2764
|
+
oldData: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.oldData) || null
|
|
2765
|
+
};
|
|
2766
|
+
};
|
|
2767
|
+
const ReviewSection = ({
|
|
2768
|
+
title,
|
|
2769
|
+
fields,
|
|
2770
|
+
newData,
|
|
2771
|
+
oldData,
|
|
2772
|
+
t,
|
|
2773
|
+
jumpTo,
|
|
2774
|
+
state
|
|
2775
|
+
}) => {
|
|
2776
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2777
|
+
className: "review-section-wrapper",
|
|
2778
|
+
style: {
|
|
2779
|
+
marginBottom: "48px",
|
|
2780
|
+
background: "#fff",
|
|
2781
|
+
borderRadius: "12px",
|
|
2782
|
+
border: "1px solid #EAECF0",
|
|
2783
|
+
overflow: "hidden"
|
|
2784
|
+
}
|
|
2785
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2786
|
+
style: {
|
|
2787
|
+
padding: "20px 24px",
|
|
2788
|
+
background: "#F9FAFB",
|
|
2789
|
+
borderBottom: "1px solid #EAECF0",
|
|
2790
|
+
display: "flex",
|
|
2791
|
+
justifyContent: "space-between",
|
|
2792
|
+
alignItems: "center"
|
|
2793
|
+
}
|
|
2794
|
+
}, /*#__PURE__*/React.createElement(CardSubHeader, {
|
|
2795
|
+
style: {
|
|
2796
|
+
margin: 0,
|
|
2797
|
+
fontSize: "18px",
|
|
2798
|
+
color: "#101828",
|
|
2799
|
+
fontWeight: "700"
|
|
2800
|
+
}
|
|
2801
|
+
}, title), jumpTo && /*#__PURE__*/React.createElement(ActionButton, {
|
|
2802
|
+
jumpTo: jumpTo,
|
|
2803
|
+
state: state
|
|
2804
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2805
|
+
style: {
|
|
2806
|
+
padding: "0 24px"
|
|
2807
|
+
}
|
|
2808
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
2809
|
+
style: {
|
|
2810
|
+
width: "100%",
|
|
2811
|
+
borderCollapse: "collapse",
|
|
2812
|
+
tableLayout: "fixed"
|
|
2813
|
+
}
|
|
2814
|
+
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
2815
|
+
style: {
|
|
2816
|
+
padding: "16px 0",
|
|
2817
|
+
textAlign: "left",
|
|
2818
|
+
color: "#667085",
|
|
2819
|
+
fontSize: "12px",
|
|
2820
|
+
fontWeight: "600",
|
|
2821
|
+
textTransform: "uppercase",
|
|
2822
|
+
width: "30%"
|
|
2823
|
+
}
|
|
2824
|
+
}, t("EKYC_FIELD_NAME")), /*#__PURE__*/React.createElement("th", {
|
|
2825
|
+
style: {
|
|
2826
|
+
padding: "16px 0",
|
|
2827
|
+
textAlign: "left",
|
|
2828
|
+
color: "#667085",
|
|
2829
|
+
fontSize: "12px",
|
|
2830
|
+
fontWeight: "600",
|
|
2831
|
+
textTransform: "uppercase",
|
|
2832
|
+
width: "35%"
|
|
2833
|
+
}
|
|
2834
|
+
}, t("EKYC_EXISTING_INFORMATION")), /*#__PURE__*/React.createElement("th", {
|
|
2835
|
+
style: {
|
|
2836
|
+
padding: "16px 0",
|
|
2837
|
+
textAlign: "left",
|
|
2838
|
+
color: "#667085",
|
|
2839
|
+
fontSize: "12px",
|
|
2840
|
+
fontWeight: "600",
|
|
2841
|
+
textTransform: "uppercase",
|
|
2842
|
+
width: "35%"
|
|
2843
|
+
}
|
|
2844
|
+
}, t("EKYC_PROPOSED_UPDATES")))), /*#__PURE__*/React.createElement("tbody", null, fields.map((field, idx) => {
|
|
2845
|
+
const valNew = newData === null || newData === void 0 ? void 0 : newData[field.key];
|
|
2846
|
+
const valOld = oldData === null || oldData === void 0 ? void 0 : oldData[field.key];
|
|
2847
|
+
const isChanged = oldData && String(valNew) !== String(valOld) && valOld !== undefined && valOld !== null;
|
|
2848
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
2849
|
+
key: idx,
|
|
2850
|
+
style: {
|
|
2851
|
+
borderTop: "1px solid #F2F4F7"
|
|
2852
|
+
}
|
|
2853
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
2854
|
+
style: {
|
|
2855
|
+
padding: "16px 0",
|
|
2856
|
+
fontSize: "14px",
|
|
2857
|
+
color: "#344054",
|
|
2858
|
+
fontWeight: "500"
|
|
2859
|
+
}
|
|
2860
|
+
}, t(field.label)), /*#__PURE__*/React.createElement("td", {
|
|
2861
|
+
style: {
|
|
2862
|
+
padding: "16px 0",
|
|
2863
|
+
fontSize: "14px",
|
|
2864
|
+
color: "#667085"
|
|
2865
|
+
}
|
|
2866
|
+
}, field.isBool ? boolToYesNo(valOld, t) : checkForNA(valOld)), /*#__PURE__*/React.createElement("td", {
|
|
2867
|
+
style: {
|
|
2868
|
+
padding: "16px 0",
|
|
2869
|
+
fontSize: "14px",
|
|
2870
|
+
color: isChanged ? "#1B8B32" : "#101828",
|
|
2871
|
+
fontWeight: isChanged ? "700" : "400"
|
|
2872
|
+
}
|
|
2873
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2874
|
+
style: {
|
|
2875
|
+
display: "flex",
|
|
2876
|
+
alignItems: "center",
|
|
2877
|
+
gap: "8px"
|
|
2878
|
+
}
|
|
2879
|
+
}, field.isBool ? boolToYesNo(valNew, t) : checkForNA(valNew), isChanged && /*#__PURE__*/React.createElement("span", {
|
|
2880
|
+
style: {
|
|
2881
|
+
background: "#ECFDF3",
|
|
2882
|
+
color: "#067647",
|
|
2883
|
+
padding: "2px 8px",
|
|
2884
|
+
borderRadius: "12px",
|
|
2885
|
+
fontSize: "10px",
|
|
2886
|
+
fontWeight: "600"
|
|
2887
|
+
}
|
|
2888
|
+
}, t("EKYC_CHANGED")))));
|
|
2889
|
+
})))));
|
|
2757
2890
|
};
|
|
2758
2891
|
const Review = () => {
|
|
2759
|
-
var _editedProperty$conne, _editedProperty$conne2, _editedProperty$userT, _editedProperty$noOfF, _editedMeter$meterSta, _editedMeter$workingS, _editedMeter$lastBill;
|
|
2892
|
+
var _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8;
|
|
2760
2893
|
const {
|
|
2761
2894
|
t
|
|
2762
2895
|
} = useTranslation();
|
|
@@ -2764,6 +2897,8 @@ const Review = () => {
|
|
|
2764
2897
|
const location = useLocation();
|
|
2765
2898
|
const [agree, setAgree] = useState(false);
|
|
2766
2899
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
2900
|
+
const [showPreview, setShowPreview] = useState(false);
|
|
2901
|
+
const [previewUrl, setPreviewUrl] = useState("");
|
|
2767
2902
|
const flowState = location.state || {};
|
|
2768
2903
|
const {
|
|
2769
2904
|
kNumber,
|
|
@@ -2778,6 +2913,8 @@ const Review = () => {
|
|
|
2778
2913
|
meterDetails: editedMeter = {}
|
|
2779
2914
|
} = edits;
|
|
2780
2915
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
2916
|
+
const workflowMutation = Digit.Hooks.ekyc.useEkycWorkflow(tenantId);
|
|
2917
|
+
const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
|
|
2781
2918
|
const {
|
|
2782
2919
|
data: searchData,
|
|
2783
2920
|
isLoading: isSearchLoading
|
|
@@ -2787,67 +2924,308 @@ const Review = () => {
|
|
|
2787
2924
|
}, tenantId, {
|
|
2788
2925
|
enabled: !!activeKno
|
|
2789
2926
|
});
|
|
2790
|
-
const
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
const
|
|
2927
|
+
const {
|
|
2928
|
+
newData: apiNewData,
|
|
2929
|
+
oldData: apiOldData
|
|
2930
|
+
} = extractReviewData(searchData, flowState);
|
|
2931
|
+
const prepareConsolidatedData = data => {
|
|
2932
|
+
if (!data) return null;
|
|
2933
|
+
const apiConn = (data === null || data === void 0 ? void 0 : data.connectionDetails) || data || {};
|
|
2934
|
+
const apiAddr = (data === null || data === void 0 ? void 0 : data.addressDetails) || data || {};
|
|
2935
|
+
const apiProp = (data === null || data === void 0 ? void 0 : data.propertyInfo) || data || {};
|
|
2936
|
+
const apiMeter = (data === null || data === void 0 ? void 0 : data.meterDetails) || data || {};
|
|
2937
|
+
return {
|
|
2938
|
+
connection: {
|
|
2939
|
+
consumerName: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.consumerName) || (apiConn !== null && apiConn !== void 0 && apiConn.firstName ? [apiConn.firstName, apiConn.middleName, apiConn.lastName].filter(Boolean).join(" ") : null),
|
|
2940
|
+
address: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.address) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.addressRaw),
|
|
2941
|
+
connectionType: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.connectionType) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.connectionCategory),
|
|
2942
|
+
meterNumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.meterNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.meterNo),
|
|
2943
|
+
phoneNumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.phoneNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.mobileNo) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.mobileNumber),
|
|
2944
|
+
email: apiConn === null || apiConn === void 0 ? void 0 : apiConn.email,
|
|
2945
|
+
statusflag: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusflag) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusFlag),
|
|
2946
|
+
ekycStatus: apiConn === null || apiConn === void 0 ? void 0 : apiConn.ekycStatus,
|
|
2947
|
+
knumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.knumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.kno)
|
|
2948
|
+
},
|
|
2949
|
+
address: {
|
|
2950
|
+
fullAddress: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.fullAddress) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.addressRaw),
|
|
2951
|
+
flatHouseNumber: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.flatHouseNumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.flatNo),
|
|
2952
|
+
buildingTower: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.buildingTower) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.building),
|
|
2953
|
+
landmark: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.landmark,
|
|
2954
|
+
pinCode: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.pinCode) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.pincode),
|
|
2955
|
+
ward: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.ward) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.locality),
|
|
2956
|
+
assembly: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.assembly,
|
|
2957
|
+
gpsValid: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.gpsValid,
|
|
2958
|
+
latitude: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.latitude,
|
|
2959
|
+
longitude: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.longitude,
|
|
2960
|
+
mobileNo: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.mobileNo) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.mobileNumber),
|
|
2961
|
+
whatsappNo: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.whatsappNo,
|
|
2962
|
+
email: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.email,
|
|
2963
|
+
noOfPerson: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPerson) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPersons),
|
|
2964
|
+
knumber: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.knumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.kno),
|
|
2965
|
+
doorPhotoFilestoreId: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId
|
|
2966
|
+
},
|
|
2967
|
+
property: {
|
|
2968
|
+
kno: apiProp === null || apiProp === void 0 ? void 0 : apiProp.kno,
|
|
2969
|
+
pidNumber: apiProp === null || apiProp === void 0 ? void 0 : apiProp.pidNumber,
|
|
2970
|
+
typeOfConnection: apiProp === null || apiProp === void 0 ? void 0 : apiProp.typeOfConnection,
|
|
2971
|
+
connectionCategory: apiProp === null || apiProp === void 0 ? void 0 : apiProp.connectionCategory,
|
|
2972
|
+
userType: apiProp === null || apiProp === void 0 ? void 0 : apiProp.userType,
|
|
2973
|
+
numberOfFloors: (apiProp === null || apiProp === void 0 ? void 0 : apiProp.numberOfFloors) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.noOfFloor),
|
|
2974
|
+
tenantName: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantName,
|
|
2975
|
+
tenantMobile: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantMobile,
|
|
2976
|
+
ekycStatus: apiProp === null || apiProp === void 0 ? void 0 : apiProp.ekycStatus,
|
|
2977
|
+
propertyDocumentFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.propertyDocumentFileStoreId,
|
|
2978
|
+
buildingImageFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId
|
|
2979
|
+
},
|
|
2980
|
+
meter: {
|
|
2981
|
+
kno: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.kno,
|
|
2982
|
+
metered: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterStatus) === "METERED" || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.metered),
|
|
2983
|
+
meterNumber: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterNumber) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterNo),
|
|
2984
|
+
meterMake: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterMake,
|
|
2985
|
+
meterLocationAddress: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLocationAddress,
|
|
2986
|
+
meterLatitude: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLatitude,
|
|
2987
|
+
meterLongitude: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLongitude,
|
|
2988
|
+
workingStatus: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.workingStatus,
|
|
2989
|
+
lastBillRaised: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.lastBillRaised,
|
|
2990
|
+
systemMeterId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.systemMeterId,
|
|
2991
|
+
meterPhotoFileStoreId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId
|
|
2992
|
+
}
|
|
2993
|
+
};
|
|
2994
|
+
};
|
|
2995
|
+
const newDataRaw = prepareConsolidatedData(apiNewData);
|
|
2996
|
+
const oldDataRaw = prepareConsolidatedData(apiOldData);
|
|
2795
2997
|
const connectionData = {
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
phoneNumber: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.phoneNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.mobileNo),
|
|
2801
|
-
email: apiConn === null || apiConn === void 0 ? void 0 : apiConn.email,
|
|
2802
|
-
statusflag: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusflag) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusFlag),
|
|
2803
|
-
ekycStatus: apiConn === null || apiConn === void 0 ? void 0 : apiConn.ekycStatus,
|
|
2804
|
-
knumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.knumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.kno) || activeKno
|
|
2998
|
+
...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.connection),
|
|
2999
|
+
consumerName: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.name) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio = newDataRaw.connection) === null || _newDataRaw$connectio === void 0 ? void 0 : _newDataRaw$connectio.consumerName),
|
|
3000
|
+
phoneNumber: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio2 = newDataRaw.connection) === null || _newDataRaw$connectio2 === void 0 ? void 0 : _newDataRaw$connectio2.phoneNumber),
|
|
3001
|
+
knumber: (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio3 = newDataRaw.connection) === null || _newDataRaw$connectio3 === void 0 ? void 0 : _newDataRaw$connectio3.knumber) || activeKno
|
|
2805
3002
|
};
|
|
2806
3003
|
const addressData = {
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
3004
|
+
...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.address),
|
|
3005
|
+
fullAddress: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.fullAddress) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address = newDataRaw.address) === null || _newDataRaw$address === void 0 ? void 0 : _newDataRaw$address.fullAddress),
|
|
3006
|
+
flatHouseNumber: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.flatHouseNumber) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.flatNo) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address2 = newDataRaw.address) === null || _newDataRaw$address2 === void 0 ? void 0 : _newDataRaw$address2.flatHouseNumber),
|
|
3007
|
+
buildingTower: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.buildingTower) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.building) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address3 = newDataRaw.address) === null || _newDataRaw$address3 === void 0 ? void 0 : _newDataRaw$address3.buildingTower),
|
|
3008
|
+
landmark: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.landmark) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address4 = newDataRaw.address) === null || _newDataRaw$address4 === void 0 ? void 0 : _newDataRaw$address4.landmark),
|
|
3009
|
+
pinCode: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.pinCode) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.pincode) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address5 = newDataRaw.address) === null || _newDataRaw$address5 === void 0 ? void 0 : _newDataRaw$address5.pinCode),
|
|
3010
|
+
ward: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.ward) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address6 = newDataRaw.address) === null || _newDataRaw$address6 === void 0 ? void 0 : _newDataRaw$address6.ward),
|
|
3011
|
+
assembly: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.assembly) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address7 = newDataRaw.address) === null || _newDataRaw$address7 === void 0 ? void 0 : _newDataRaw$address7.assembly),
|
|
3012
|
+
gpsValid: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.gpsValid) !== undefined ? editedAddress.gpsValid : newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address8 = newDataRaw.address) === null || _newDataRaw$address8 === void 0 ? void 0 : _newDataRaw$address8.gpsValid,
|
|
3013
|
+
latitude: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.latitude) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address9 = newDataRaw.address) === null || _newDataRaw$address9 === void 0 ? void 0 : _newDataRaw$address9.latitude),
|
|
3014
|
+
longitude: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.longitude) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address0 = newDataRaw.address) === null || _newDataRaw$address0 === void 0 ? void 0 : _newDataRaw$address0.longitude),
|
|
3015
|
+
mobileNo: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.mobileNo) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address1 = newDataRaw.address) === null || _newDataRaw$address1 === void 0 ? void 0 : _newDataRaw$address1.mobileNo),
|
|
3016
|
+
whatsappNo: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.whatsappNo) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.whatsappNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address10 = newDataRaw.address) === null || _newDataRaw$address10 === void 0 ? void 0 : _newDataRaw$address10.whatsappNo),
|
|
3017
|
+
email: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.email) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address11 = newDataRaw.address) === null || _newDataRaw$address11 === void 0 ? void 0 : _newDataRaw$address11.email),
|
|
3018
|
+
noOfPerson: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.noOfPerson) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.noOfPersons) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address12 = newDataRaw.address) === null || _newDataRaw$address12 === void 0 ? void 0 : _newDataRaw$address12.noOfPerson),
|
|
3019
|
+
knumber: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.knumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address13 = newDataRaw.address) === null || _newDataRaw$address13 === void 0 ? void 0 : _newDataRaw$address13.knumber) || activeKno,
|
|
3020
|
+
doorPhotoFilestoreId: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.doorPhotoFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address14 = newDataRaw.address) === null || _newDataRaw$address14 === void 0 ? void 0 : _newDataRaw$address14.doorPhotoFilestoreId)
|
|
2823
3021
|
};
|
|
2824
3022
|
const propertyData = {
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
ekycStatus: apiProp === null || apiProp === void 0 ? void 0 : apiProp.ekycStatus,
|
|
2834
|
-
propertyDocumentFileStoreId: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.propertyDocumentFileStoreId) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.propertyDocumentFileStoreId),
|
|
2835
|
-
buildingImageFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId
|
|
3023
|
+
...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.property),
|
|
3024
|
+
kno: (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property = newDataRaw.property) === null || _newDataRaw$property === void 0 ? void 0 : _newDataRaw$property.kno) || activeKno,
|
|
3025
|
+
pidNumber: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.pidNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property2 = newDataRaw.property) === null || _newDataRaw$property2 === void 0 ? void 0 : _newDataRaw$property2.pidNumber),
|
|
3026
|
+
typeOfConnection: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$conne = editedProperty.connectionTypeData) === null || _editedProperty$conne === void 0 ? void 0 : _editedProperty$conne.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property3 = newDataRaw.property) === null || _newDataRaw$property3 === void 0 ? void 0 : _newDataRaw$property3.typeOfConnection),
|
|
3027
|
+
connectionCategory: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$conne2 = editedProperty.connectionCategoryData) === null || _editedProperty$conne2 === void 0 ? void 0 : _editedProperty$conne2.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property4 = newDataRaw.property) === null || _newDataRaw$property4 === void 0 ? void 0 : _newDataRaw$property4.connectionCategory),
|
|
3028
|
+
userType: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$userT = editedProperty.userTypeData) === null || _editedProperty$userT === void 0 ? void 0 : _editedProperty$userT.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property5 = newDataRaw.property) === null || _newDataRaw$property5 === void 0 ? void 0 : _newDataRaw$property5.userType),
|
|
3029
|
+
numberOfFloors: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$noOfF = editedProperty.noOfFloorsData) === null || _editedProperty$noOfF === void 0 ? void 0 : _editedProperty$noOfF.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property6 = newDataRaw.property) === null || _newDataRaw$property6 === void 0 ? void 0 : _newDataRaw$property6.numberOfFloors),
|
|
3030
|
+
propertyDocumentFileStoreId: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.propertyDocumentFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property7 = newDataRaw.property) === null || _newDataRaw$property7 === void 0 ? void 0 : _newDataRaw$property7.propertyDocumentFileStoreId)
|
|
2836
3031
|
};
|
|
2837
3032
|
const meterData = {
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
systemMeterId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.systemMeterId,
|
|
2848
|
-
meterPhotoFileStoreId: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterPhotoFileStoreId) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId)
|
|
3033
|
+
...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.meter),
|
|
3034
|
+
kno: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.kno) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter = newDataRaw.meter) === null || _newDataRaw$meter === void 0 ? void 0 : _newDataRaw$meter.kno) || activeKno,
|
|
3035
|
+
metered: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$meterSta = editedMeter.meterStatusData) === null || _editedMeter$meterSta === void 0 ? void 0 : _editedMeter$meterSta.value) === "Metered" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter2 = newDataRaw.meter) === null || _newDataRaw$meter2 === void 0 ? void 0 : _newDataRaw$meter2.metered),
|
|
3036
|
+
meterNumber: newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter3 = newDataRaw.meter) === null || _newDataRaw$meter3 === void 0 ? void 0 : _newDataRaw$meter3.meterNumber,
|
|
3037
|
+
meterMake: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterMake) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter4 = newDataRaw.meter) === null || _newDataRaw$meter4 === void 0 ? void 0 : _newDataRaw$meter4.meterMake),
|
|
3038
|
+
meterLocationAddress: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterLocation) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter5 = newDataRaw.meter) === null || _newDataRaw$meter5 === void 0 ? void 0 : _newDataRaw$meter5.meterLocationAddress),
|
|
3039
|
+
workingStatus: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$workingS = editedMeter.workingStatusData) === null || _editedMeter$workingS === void 0 ? void 0 : _editedMeter$workingS.value) === "Working" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter6 = newDataRaw.meter) === null || _newDataRaw$meter6 === void 0 ? void 0 : _newDataRaw$meter6.workingStatus),
|
|
3040
|
+
lastBillRaised: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$lastBill = editedMeter.lastBillRaisedData) === null || _editedMeter$lastBill === void 0 ? void 0 : _editedMeter$lastBill.value) === "Yes" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter7 = newDataRaw.meter) === null || _newDataRaw$meter7 === void 0 ? void 0 : _newDataRaw$meter7.lastBillRaised),
|
|
3041
|
+
meterPhotoFileStoreId: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterPhotoFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter8 = newDataRaw.meter) === null || _newDataRaw$meter8 === void 0 ? void 0 : _newDataRaw$meter8.meterPhotoFileStoreId)
|
|
2849
3042
|
};
|
|
3043
|
+
const connectionFields = [{
|
|
3044
|
+
label: "EKYC_K_NUMBER",
|
|
3045
|
+
key: "knumber"
|
|
3046
|
+
}, {
|
|
3047
|
+
label: "EKYC_CONSUMER_NAME",
|
|
3048
|
+
key: "consumerName"
|
|
3049
|
+
}, {
|
|
3050
|
+
label: "EKYC_ADDRESS",
|
|
3051
|
+
key: "address"
|
|
3052
|
+
}, {
|
|
3053
|
+
label: "EKYC_CONNECTION_TYPE",
|
|
3054
|
+
key: "connectionType"
|
|
3055
|
+
}, {
|
|
3056
|
+
label: "EKYC_METER_NO",
|
|
3057
|
+
key: "meterNumber"
|
|
3058
|
+
}, {
|
|
3059
|
+
label: "EKYC_MOBILE_NO",
|
|
3060
|
+
key: "phoneNumber"
|
|
3061
|
+
}, {
|
|
3062
|
+
label: "EKYC_EMAIL",
|
|
3063
|
+
key: "email"
|
|
3064
|
+
}, {
|
|
3065
|
+
label: "EKYC_STATUS_FLAG",
|
|
3066
|
+
key: "statusflag"
|
|
3067
|
+
}, {
|
|
3068
|
+
label: "EKYC_STATUS",
|
|
3069
|
+
key: "ekycStatus"
|
|
3070
|
+
}];
|
|
3071
|
+
const addressFields = [{
|
|
3072
|
+
label: "EKYC_FULL_ADDRESS",
|
|
3073
|
+
key: "fullAddress"
|
|
3074
|
+
}, {
|
|
3075
|
+
label: "EKYC_FLAT_HOUSE_NO",
|
|
3076
|
+
key: "flatHouseNumber"
|
|
3077
|
+
}, {
|
|
3078
|
+
label: "EKYC_BUILDING_TOWER",
|
|
3079
|
+
key: "buildingTower"
|
|
3080
|
+
}, {
|
|
3081
|
+
label: "EKYC_LANDMARK",
|
|
3082
|
+
key: "landmark"
|
|
3083
|
+
}, {
|
|
3084
|
+
label: "EKYC_PINCODE",
|
|
3085
|
+
key: "pinCode"
|
|
3086
|
+
}, {
|
|
3087
|
+
label: "EKYC_LOCALITY",
|
|
3088
|
+
key: "ward"
|
|
3089
|
+
}, {
|
|
3090
|
+
label: "EKYC_ASSEMBLY",
|
|
3091
|
+
key: "assembly"
|
|
3092
|
+
}, {
|
|
3093
|
+
label: "EKYC_GPS_VALID",
|
|
3094
|
+
key: "gpsValid",
|
|
3095
|
+
isBool: true
|
|
3096
|
+
}, {
|
|
3097
|
+
label: "EKYC_LATITUDE",
|
|
3098
|
+
key: "latitude"
|
|
3099
|
+
}, {
|
|
3100
|
+
label: "EKYC_LONGITUDE",
|
|
3101
|
+
key: "longitude"
|
|
3102
|
+
}, {
|
|
3103
|
+
label: "EKYC_MOBILE_NO",
|
|
3104
|
+
key: "mobileNo"
|
|
3105
|
+
}, {
|
|
3106
|
+
label: "EKYC_WHATSAPP_NO",
|
|
3107
|
+
key: "whatsappNo"
|
|
3108
|
+
}, {
|
|
3109
|
+
label: "EKYC_EMAIL",
|
|
3110
|
+
key: "email"
|
|
3111
|
+
}, {
|
|
3112
|
+
label: "EKYC_NO_OF_PERSONS",
|
|
3113
|
+
key: "noOfPerson"
|
|
3114
|
+
}, {
|
|
3115
|
+
label: "EKYC_K_NUMBER",
|
|
3116
|
+
key: "knumber"
|
|
3117
|
+
}];
|
|
3118
|
+
const propertyFields = [{
|
|
3119
|
+
label: "EKYC_CONNECTION_CATEGORY",
|
|
3120
|
+
key: "connectionCategory"
|
|
3121
|
+
}, {
|
|
3122
|
+
label: "EKYC_PID_NUMBER",
|
|
3123
|
+
key: "pidNumber"
|
|
3124
|
+
}, {
|
|
3125
|
+
label: "EKYC_TYPE_OF_CONNECTION",
|
|
3126
|
+
key: "typeOfConnection"
|
|
3127
|
+
}, {
|
|
3128
|
+
label: "EKYC_USER_TYPE",
|
|
3129
|
+
key: "userType"
|
|
3130
|
+
}, {
|
|
3131
|
+
label: "EKYC_FLOOR_COUNT",
|
|
3132
|
+
key: "numberOfFloors"
|
|
3133
|
+
}, {
|
|
3134
|
+
label: "EKYC_TENANT_NAME",
|
|
3135
|
+
key: "tenantName"
|
|
3136
|
+
}, {
|
|
3137
|
+
label: "EKYC_TENANT_MOBILE",
|
|
3138
|
+
key: "tenantMobile"
|
|
3139
|
+
}, {
|
|
3140
|
+
label: "EKYC_STATUS",
|
|
3141
|
+
key: "ekycStatus"
|
|
3142
|
+
}];
|
|
3143
|
+
const meterFields = [{
|
|
3144
|
+
label: "EKYC_METERED",
|
|
3145
|
+
key: "metered",
|
|
3146
|
+
isBool: true
|
|
3147
|
+
}, {
|
|
3148
|
+
label: "EKYC_METER_NO",
|
|
3149
|
+
key: "meterNumber"
|
|
3150
|
+
}, {
|
|
3151
|
+
label: "EKYC_METER_MAKE",
|
|
3152
|
+
key: "meterMake"
|
|
3153
|
+
}, {
|
|
3154
|
+
label: "EKYC_METER_LOCATION_ADDRESS",
|
|
3155
|
+
key: "meterLocationAddress"
|
|
3156
|
+
}, {
|
|
3157
|
+
label: "EKYC_METER_LATITUDE",
|
|
3158
|
+
key: "meterLatitude"
|
|
3159
|
+
}, {
|
|
3160
|
+
label: "EKYC_METER_LONGITUDE",
|
|
3161
|
+
key: "meterLongitude"
|
|
3162
|
+
}, {
|
|
3163
|
+
label: "EKYC_WORKING_STATUS",
|
|
3164
|
+
key: "workingStatus",
|
|
3165
|
+
isBool: true
|
|
3166
|
+
}, {
|
|
3167
|
+
label: "EKYC_LAST_BILL_RAISED",
|
|
3168
|
+
key: "lastBillRaised",
|
|
3169
|
+
isBool: true
|
|
3170
|
+
}, {
|
|
3171
|
+
label: "EKYC_SYSTEM_METER_ID",
|
|
3172
|
+
key: "systemMeterId"
|
|
3173
|
+
}];
|
|
2850
3174
|
const handleDeclaration = () => setAgree(!agree);
|
|
3175
|
+
const handleReject = async () => {
|
|
3176
|
+
var _Digit$UserService$ge, _Digit$UserService$ge2, _Digit$UserService$ge3;
|
|
3177
|
+
const payload = {
|
|
3178
|
+
RequestInfo: {
|
|
3179
|
+
apiId: "Rainmaker",
|
|
3180
|
+
ver: "1.0",
|
|
3181
|
+
msgId: "message-id",
|
|
3182
|
+
authToken: (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.access_token
|
|
3183
|
+
},
|
|
3184
|
+
kno: activeKno,
|
|
3185
|
+
action: "REJECTED",
|
|
3186
|
+
remarks: "Application rejected by reviewer",
|
|
3187
|
+
reviewedBy: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.userName,
|
|
3188
|
+
role: "ZRO"
|
|
3189
|
+
};
|
|
3190
|
+
try {
|
|
3191
|
+
const result = await workflowMutation.mutateAsync(payload);
|
|
3192
|
+
if (result) {
|
|
3193
|
+
history.push("/digit-ui/employee/ekyc/response", {
|
|
3194
|
+
success: true,
|
|
3195
|
+
result
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
} catch (err) {
|
|
3199
|
+
console.error("Reject Error:", err);
|
|
3200
|
+
}
|
|
3201
|
+
};
|
|
3202
|
+
const handleApprove = async () => {
|
|
3203
|
+
var _Digit$UserService$ge4, _Digit$UserService$ge5, _Digit$UserService$ge6;
|
|
3204
|
+
const payload = {
|
|
3205
|
+
RequestInfo: {
|
|
3206
|
+
apiId: "Rainmaker",
|
|
3207
|
+
ver: "1.0",
|
|
3208
|
+
msgId: "message-id",
|
|
3209
|
+
authToken: (_Digit$UserService$ge4 = Digit.UserService.getUser()) === null || _Digit$UserService$ge4 === void 0 ? void 0 : _Digit$UserService$ge4.access_token
|
|
3210
|
+
},
|
|
3211
|
+
kno: activeKno,
|
|
3212
|
+
action: "APPROVED",
|
|
3213
|
+
remarks: "All documents verified",
|
|
3214
|
+
reviewedBy: (_Digit$UserService$ge5 = Digit.UserService.getUser()) === null || _Digit$UserService$ge5 === void 0 ? void 0 : (_Digit$UserService$ge6 = _Digit$UserService$ge5.info) === null || _Digit$UserService$ge6 === void 0 ? void 0 : _Digit$UserService$ge6.userName,
|
|
3215
|
+
role: "ZRO"
|
|
3216
|
+
};
|
|
3217
|
+
try {
|
|
3218
|
+
const result = await workflowMutation.mutateAsync(payload);
|
|
3219
|
+
if (result) {
|
|
3220
|
+
history.push("/digit-ui/employee/ekyc/response", {
|
|
3221
|
+
success: true,
|
|
3222
|
+
result
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
} catch (err) {
|
|
3226
|
+
console.error("Approve Error:", err);
|
|
3227
|
+
}
|
|
3228
|
+
};
|
|
2851
3229
|
const handleFinalSubmit = async () => {
|
|
2852
3230
|
setIsSubmitting(true);
|
|
2853
3231
|
try {
|
|
@@ -2861,7 +3239,7 @@ const Review = () => {
|
|
|
2861
3239
|
meterDetails: meterData
|
|
2862
3240
|
}
|
|
2863
3241
|
};
|
|
2864
|
-
const result = await
|
|
3242
|
+
const result = await updateMutation.mutateAsync(payload);
|
|
2865
3243
|
if (result) {
|
|
2866
3244
|
history.push("/digit-ui/employee/ekyc/response", {
|
|
2867
3245
|
success: true,
|
|
@@ -2874,258 +3252,254 @@ const Review = () => {
|
|
|
2874
3252
|
setIsSubmitting(false);
|
|
2875
3253
|
}
|
|
2876
3254
|
};
|
|
3255
|
+
const handleViewDocument = fileStoreId => {
|
|
3256
|
+
if (!fileStoreId) return;
|
|
3257
|
+
const documentUrl = `https://dev-djb.nitcon.in/filestore/v1/files/id?tenantId=dl.djb&fileStoreId=${fileStoreId}`;
|
|
3258
|
+
setPreviewUrl(documentUrl);
|
|
3259
|
+
setShowPreview(true);
|
|
3260
|
+
};
|
|
2877
3261
|
if (isSearchLoading || isSubmitting) return /*#__PURE__*/React.createElement(Loader, null);
|
|
2878
3262
|
const baseUrl = "/digit-ui/employee/ekyc";
|
|
2879
3263
|
return /*#__PURE__*/React.createElement("div", {
|
|
2880
|
-
className: "
|
|
2881
|
-
}, /*#__PURE__*/React.createElement(Card,
|
|
3264
|
+
className: "employeeCard overflow-y-scroll"
|
|
3265
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
3266
|
+
style: {
|
|
3267
|
+
padding: "32px"
|
|
3268
|
+
}
|
|
3269
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2882
3270
|
style: {
|
|
2883
3271
|
display: "flex",
|
|
2884
3272
|
justifyContent: "space-between",
|
|
2885
3273
|
alignItems: "center",
|
|
2886
|
-
marginBottom: "
|
|
3274
|
+
marginBottom: "40px",
|
|
3275
|
+
borderBottom: "1px solid #EAECF0",
|
|
3276
|
+
paddingBottom: "20px"
|
|
2887
3277
|
}
|
|
2888
3278
|
}, /*#__PURE__*/React.createElement(CardHeader, {
|
|
2889
3279
|
style: {
|
|
2890
|
-
margin: 0
|
|
3280
|
+
margin: 0,
|
|
3281
|
+
fontSize: "28px"
|
|
2891
3282
|
}
|
|
2892
3283
|
}, t("EKYC_REVIEW_APPLICATION")), /*#__PURE__*/React.createElement("div", {
|
|
2893
3284
|
style: {
|
|
2894
3285
|
background: "#F9FAFB",
|
|
2895
|
-
border: "
|
|
2896
|
-
borderRadius: "
|
|
2897
|
-
padding: "
|
|
2898
|
-
fontSize: "
|
|
2899
|
-
color: "#
|
|
3286
|
+
border: "1px solid #EAECF0",
|
|
3287
|
+
borderRadius: "24px",
|
|
3288
|
+
padding: "8px 20px",
|
|
3289
|
+
fontSize: "14px",
|
|
3290
|
+
color: "#475467",
|
|
3291
|
+
fontWeight: "500"
|
|
2900
3292
|
}
|
|
2901
3293
|
}, t("EKYC_K_NUMBER"), ": ", /*#__PURE__*/React.createElement("span", {
|
|
2902
3294
|
style: {
|
|
2903
|
-
color: "#
|
|
2904
|
-
fontWeight: "
|
|
2905
|
-
}
|
|
2906
|
-
}, activeKno))), /*#__PURE__*/React.createElement(
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
3295
|
+
color: "#101828",
|
|
3296
|
+
fontWeight: "700"
|
|
3297
|
+
}
|
|
3298
|
+
}, activeKno))), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
3299
|
+
title: t("EKYC_CONNECTION_DETAILS"),
|
|
3300
|
+
fields: connectionFields,
|
|
3301
|
+
newData: connectionData,
|
|
3302
|
+
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.connection,
|
|
3303
|
+
t: t,
|
|
3304
|
+
jumpTo: `${baseUrl}/consumer-details`,
|
|
3305
|
+
state: {
|
|
3306
|
+
...flowState,
|
|
3307
|
+
reviewData: searchData,
|
|
3308
|
+
edits
|
|
3309
|
+
}
|
|
3310
|
+
}), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
3311
|
+
title: t("EKYC_ADDRESS_DETAILS"),
|
|
3312
|
+
fields: addressFields,
|
|
3313
|
+
newData: addressData,
|
|
3314
|
+
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.address,
|
|
3315
|
+
t: t,
|
|
3316
|
+
jumpTo: `${baseUrl}/address-details`,
|
|
3317
|
+
state: {
|
|
3318
|
+
...flowState,
|
|
3319
|
+
reviewData: searchData,
|
|
3320
|
+
edits
|
|
3321
|
+
}
|
|
3322
|
+
}), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
3323
|
+
title: t("EKYC_PROPERTY_INFO"),
|
|
3324
|
+
fields: propertyFields,
|
|
3325
|
+
newData: propertyData,
|
|
3326
|
+
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.property,
|
|
3327
|
+
t: t,
|
|
3328
|
+
jumpTo: `${baseUrl}/property-info`,
|
|
3329
|
+
state: {
|
|
3330
|
+
...flowState,
|
|
3331
|
+
reviewData: searchData,
|
|
3332
|
+
edits
|
|
3333
|
+
}
|
|
3334
|
+
}), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
3335
|
+
title: t("EKYC_METER_DETAILS"),
|
|
3336
|
+
fields: meterFields,
|
|
3337
|
+
newData: meterData,
|
|
3338
|
+
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.meter,
|
|
3339
|
+
t: t,
|
|
3340
|
+
jumpTo: `${baseUrl}/meter-details`,
|
|
3341
|
+
state: {
|
|
3342
|
+
...flowState,
|
|
3343
|
+
reviewData: searchData,
|
|
3344
|
+
edits
|
|
2942
3345
|
}
|
|
2943
|
-
}, /*#__PURE__*/React.createElement(
|
|
2944
|
-
label: t("EKYC_FULL_ADDRESS"),
|
|
2945
|
-
text: checkForNA(addressData.fullAddress),
|
|
2946
|
-
actionButton: /*#__PURE__*/React.createElement(ActionButton, {
|
|
2947
|
-
jumpTo: `${baseUrl}/address-details`,
|
|
2948
|
-
state: {
|
|
2949
|
-
...flowState,
|
|
2950
|
-
reviewData: searchData,
|
|
2951
|
-
edits
|
|
2952
|
-
}
|
|
2953
|
-
})
|
|
2954
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2955
|
-
label: t("EKYC_FLAT_HOUSE_NO"),
|
|
2956
|
-
text: checkForNA(addressData.flatHouseNumber)
|
|
2957
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2958
|
-
label: t("EKYC_BUILDING_TOWER"),
|
|
2959
|
-
text: checkForNA(addressData.buildingTower)
|
|
2960
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2961
|
-
label: t("EKYC_LANDMARK"),
|
|
2962
|
-
text: checkForNA(addressData.landmark)
|
|
2963
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2964
|
-
label: t("EKYC_PINCODE"),
|
|
2965
|
-
text: checkForNA(addressData.pinCode)
|
|
2966
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2967
|
-
label: t("EKYC_LOCALITY"),
|
|
2968
|
-
text: checkForNA(addressData.ward)
|
|
2969
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2970
|
-
label: t("EKYC_ASSEMBLY"),
|
|
2971
|
-
text: checkForNA(addressData.assembly)
|
|
2972
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2973
|
-
label: t("EKYC_GPS_VALID"),
|
|
2974
|
-
text: boolToYesNo(addressData.gpsValid, t)
|
|
2975
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2976
|
-
label: t("EKYC_LATITUDE"),
|
|
2977
|
-
text: checkForNA(addressData.latitude)
|
|
2978
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2979
|
-
label: t("EKYC_LONGITUDE"),
|
|
2980
|
-
text: checkForNA(addressData.longitude)
|
|
2981
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2982
|
-
label: t("EKYC_MOBILE_NO"),
|
|
2983
|
-
text: checkForNA(addressData.mobileNo)
|
|
2984
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2985
|
-
label: t("EKYC_WHATSAPP_NO"),
|
|
2986
|
-
text: checkForNA(addressData.whatsappNo)
|
|
2987
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2988
|
-
label: t("EKYC_EMAIL"),
|
|
2989
|
-
text: checkForNA(addressData.email)
|
|
2990
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2991
|
-
label: t("EKYC_NO_OF_PERSONS"),
|
|
2992
|
-
text: checkForNA(addressData.noOfPerson)
|
|
2993
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
2994
|
-
label: t("EKYC_K_NUMBER"),
|
|
2995
|
-
text: checkForNA(addressData.knumber)
|
|
2996
|
-
})), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_PROPERTY_INFO")), /*#__PURE__*/React.createElement(StatusTable, {
|
|
3346
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
2997
3347
|
style: {
|
|
2998
|
-
marginTop: "
|
|
2999
|
-
marginBottom: "30px"
|
|
3348
|
+
marginTop: "40px"
|
|
3000
3349
|
}
|
|
3001
|
-
}, /*#__PURE__*/React.createElement(
|
|
3002
|
-
label: t("EKYC_CONNECTION_CATEGORY"),
|
|
3003
|
-
text: checkForNA(propertyData.connectionCategory),
|
|
3004
|
-
actionButton: /*#__PURE__*/React.createElement(ActionButton, {
|
|
3005
|
-
jumpTo: `${baseUrl}/property-info`,
|
|
3006
|
-
state: {
|
|
3007
|
-
...flowState,
|
|
3008
|
-
reviewData: searchData,
|
|
3009
|
-
edits
|
|
3010
|
-
}
|
|
3011
|
-
})
|
|
3012
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3013
|
-
label: t("EKYC_PID_NUMBER"),
|
|
3014
|
-
text: checkForNA(propertyData.pidNumber)
|
|
3015
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3016
|
-
label: t("EKYC_TYPE_OF_CONNECTION"),
|
|
3017
|
-
text: checkForNA(propertyData.typeOfConnection)
|
|
3018
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3019
|
-
label: t("EKYC_USER_TYPE"),
|
|
3020
|
-
text: checkForNA(propertyData.userType)
|
|
3021
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3022
|
-
label: t("EKYC_FLOOR_COUNT"),
|
|
3023
|
-
text: checkForNA(propertyData.numberOfFloors)
|
|
3024
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3025
|
-
label: t("EKYC_TENANT_NAME"),
|
|
3026
|
-
text: checkForNA(propertyData.tenantName)
|
|
3027
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3028
|
-
label: t("EKYC_TENANT_MOBILE"),
|
|
3029
|
-
text: checkForNA(propertyData.tenantMobile)
|
|
3030
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3031
|
-
label: t("EKYC_STATUS"),
|
|
3032
|
-
text: checkForNA(propertyData.ekycStatus)
|
|
3033
|
-
})), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_METER_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
|
|
3350
|
+
}, /*#__PURE__*/React.createElement(CardSubHeader, {
|
|
3034
3351
|
style: {
|
|
3035
|
-
|
|
3036
|
-
marginBottom: "30px"
|
|
3352
|
+
marginBottom: "20px"
|
|
3037
3353
|
}
|
|
3038
|
-
}, /*#__PURE__*/React.createElement(
|
|
3039
|
-
label: t("EKYC_METERED"),
|
|
3040
|
-
text: boolToYesNo(meterData.metered, t),
|
|
3041
|
-
actionButton: /*#__PURE__*/React.createElement(ActionButton, {
|
|
3042
|
-
jumpTo: `${baseUrl}/meter-details`,
|
|
3043
|
-
state: {
|
|
3044
|
-
...flowState,
|
|
3045
|
-
reviewData: searchData,
|
|
3046
|
-
edits
|
|
3047
|
-
}
|
|
3048
|
-
})
|
|
3049
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3050
|
-
label: t("EKYC_METER_NO"),
|
|
3051
|
-
text: checkForNA(meterData.meterNumber)
|
|
3052
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3053
|
-
label: t("EKYC_METER_MAKE"),
|
|
3054
|
-
text: checkForNA(meterData.meterMake)
|
|
3055
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3056
|
-
label: t("EKYC_METER_LOCATION_ADDRESS"),
|
|
3057
|
-
text: checkForNA(meterData.meterLocationAddress)
|
|
3058
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3059
|
-
label: t("EKYC_METER_LATITUDE"),
|
|
3060
|
-
text: checkForNA(meterData.meterLatitude)
|
|
3061
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3062
|
-
label: t("EKYC_METER_LONGITUDE"),
|
|
3063
|
-
text: checkForNA(meterData.meterLongitude)
|
|
3064
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3065
|
-
label: t("EKYC_WORKING_STATUS"),
|
|
3066
|
-
text: boolToYesNo(meterData.workingStatus, t)
|
|
3067
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3068
|
-
label: t("EKYC_LAST_BILL_RAISED"),
|
|
3069
|
-
text: boolToYesNo(meterData.lastBillRaised, t)
|
|
3070
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
3071
|
-
label: t("EKYC_SYSTEM_METER_ID"),
|
|
3072
|
-
text: checkForNA(meterData.systemMeterId)
|
|
3073
|
-
})), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_DOCUMENTS")), /*#__PURE__*/React.createElement(StatusTable, {
|
|
3354
|
+
}, t("EKYC_DOCUMENTS")), /*#__PURE__*/React.createElement(StatusTable, {
|
|
3074
3355
|
style: {
|
|
3075
|
-
|
|
3076
|
-
marginBottom: "30px"
|
|
3356
|
+
maxWidth: "600px"
|
|
3077
3357
|
}
|
|
3078
3358
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
3079
3359
|
label: t("EKYC_DOOR_PHOTO"),
|
|
3080
3360
|
text: addressData.doorPhotoFilestoreId ? t("EKYC_PHOTO_AVAILABLE") : t("CS_NA"),
|
|
3081
|
-
actionButton: addressData.doorPhotoFilestoreId && /*#__PURE__*/React.createElement(
|
|
3361
|
+
actionButton: addressData.doorPhotoFilestoreId && /*#__PURE__*/React.createElement("div", {
|
|
3362
|
+
onClick: () => handleViewDocument(addressData.doorPhotoFilestoreId)
|
|
3363
|
+
}, /*#__PURE__*/React.createElement(GenericFileIcon, {
|
|
3082
3364
|
style: {
|
|
3083
|
-
cursor: "pointer"
|
|
3365
|
+
cursor: "pointer",
|
|
3366
|
+
fill: "#F47738"
|
|
3084
3367
|
}
|
|
3085
|
-
})
|
|
3368
|
+
}))
|
|
3086
3369
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
3087
3370
|
label: t("EKYC_METER_PHOTO"),
|
|
3088
3371
|
text: meterData.meterPhotoFileStoreId ? t("EKYC_PHOTO_AVAILABLE") : t("CS_NA"),
|
|
3089
|
-
actionButton: meterData.meterPhotoFileStoreId && /*#__PURE__*/React.createElement(
|
|
3372
|
+
actionButton: meterData.meterPhotoFileStoreId && /*#__PURE__*/React.createElement("div", {
|
|
3373
|
+
onClick: () => handleViewDocument(meterData.meterPhotoFileStoreId)
|
|
3374
|
+
}, /*#__PURE__*/React.createElement(GenericFileIcon, {
|
|
3090
3375
|
style: {
|
|
3091
|
-
cursor: "pointer"
|
|
3376
|
+
cursor: "pointer",
|
|
3377
|
+
fill: "#F47738"
|
|
3092
3378
|
}
|
|
3093
|
-
})
|
|
3379
|
+
}))
|
|
3094
3380
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
3095
3381
|
label: t("EKYC_BUILDING_IMAGE"),
|
|
3096
3382
|
text: propertyData.buildingImageFileStoreId ? t("EKYC_PHOTO_AVAILABLE") : t("CS_NA"),
|
|
3097
|
-
actionButton: propertyData.buildingImageFileStoreId && /*#__PURE__*/React.createElement(
|
|
3383
|
+
actionButton: propertyData.buildingImageFileStoreId && /*#__PURE__*/React.createElement("div", {
|
|
3384
|
+
onClick: () => handleViewDocument(propertyData.buildingImageFileStoreId)
|
|
3385
|
+
}, /*#__PURE__*/React.createElement(GenericFileIcon, {
|
|
3098
3386
|
style: {
|
|
3099
|
-
cursor: "pointer"
|
|
3387
|
+
cursor: "pointer",
|
|
3388
|
+
fill: "#F47738"
|
|
3100
3389
|
}
|
|
3101
|
-
})
|
|
3390
|
+
}))
|
|
3102
3391
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
3103
3392
|
label: t("EKYC_PROPERTY_DOCUMENTS"),
|
|
3104
3393
|
text: propertyData.propertyDocumentFileStoreId ? t("EKYC_DOCS_AVAILABLE") : t("CS_NA"),
|
|
3105
|
-
actionButton: propertyData.propertyDocumentFileStoreId && /*#__PURE__*/React.createElement(
|
|
3394
|
+
actionButton: propertyData.propertyDocumentFileStoreId && /*#__PURE__*/React.createElement("div", {
|
|
3395
|
+
onClick: () => handleViewDocument(propertyData.propertyDocumentFileStoreId)
|
|
3396
|
+
}, /*#__PURE__*/React.createElement(GenericFileIcon, {
|
|
3106
3397
|
style: {
|
|
3107
|
-
cursor: "pointer"
|
|
3398
|
+
cursor: "pointer",
|
|
3399
|
+
fill: "#F47738"
|
|
3108
3400
|
}
|
|
3109
|
-
})
|
|
3110
|
-
})), /*#__PURE__*/React.createElement(
|
|
3401
|
+
}))
|
|
3402
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
3403
|
+
style: {
|
|
3404
|
+
marginTop: "40px",
|
|
3405
|
+
paddingTop: "30px",
|
|
3406
|
+
borderTop: "1px solid #EAECF0"
|
|
3407
|
+
}
|
|
3408
|
+
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
3111
3409
|
id: "agreeDeclaration",
|
|
3112
3410
|
name: "agreeDeclaration",
|
|
3113
|
-
label:
|
|
3411
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
3412
|
+
style: {
|
|
3413
|
+
fontSize: "16px",
|
|
3414
|
+
color: "#344054"
|
|
3415
|
+
}
|
|
3416
|
+
}, t("EKYC_FINAL_DECLARATION")),
|
|
3114
3417
|
onChange: handleDeclaration,
|
|
3115
|
-
checked: agree
|
|
3116
|
-
|
|
3117
|
-
marginTop: "20px"
|
|
3118
|
-
}
|
|
3119
|
-
})), /*#__PURE__*/React.createElement(ActionBar, {
|
|
3418
|
+
checked: agree
|
|
3419
|
+
}))), /*#__PURE__*/React.createElement(ActionBar, {
|
|
3120
3420
|
style: {
|
|
3121
3421
|
position: "static",
|
|
3122
|
-
marginTop: "
|
|
3422
|
+
marginTop: "32px",
|
|
3423
|
+
display: "flex",
|
|
3424
|
+
justifyContent: "flex-end"
|
|
3123
3425
|
}
|
|
3124
3426
|
}, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
3427
|
+
label: t("EKYC_REJECT"),
|
|
3428
|
+
onSubmit: handleReject,
|
|
3429
|
+
disabled: !agree
|
|
3430
|
+
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
3431
|
+
label: t("EKYC_APPROVE"),
|
|
3432
|
+
onSubmit: handleApprove,
|
|
3433
|
+
disabled: !agree
|
|
3434
|
+
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
3125
3435
|
label: t("EKYC_SUBMIT_APPLICATION"),
|
|
3126
3436
|
onSubmit: handleFinalSubmit,
|
|
3127
3437
|
disabled: !agree
|
|
3128
|
-
}))
|
|
3438
|
+
})), showPreview && /*#__PURE__*/React.createElement("div", {
|
|
3439
|
+
style: {
|
|
3440
|
+
position: "fixed",
|
|
3441
|
+
top: 0,
|
|
3442
|
+
left: 0,
|
|
3443
|
+
width: "100%",
|
|
3444
|
+
height: "100%",
|
|
3445
|
+
backgroundColor: "rgba(0,0,0,0.7)",
|
|
3446
|
+
display: "flex",
|
|
3447
|
+
justifyContent: "center",
|
|
3448
|
+
alignItems: "center",
|
|
3449
|
+
zIndex: 10000
|
|
3450
|
+
}
|
|
3451
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3452
|
+
style: {
|
|
3453
|
+
position: "relative",
|
|
3454
|
+
backgroundColor: "#fff",
|
|
3455
|
+
padding: "30px",
|
|
3456
|
+
borderRadius: "12px",
|
|
3457
|
+
maxWidth: "600px",
|
|
3458
|
+
width: "100%",
|
|
3459
|
+
maxHeight: "70vh",
|
|
3460
|
+
overflow: "auto",
|
|
3461
|
+
boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)"
|
|
3462
|
+
}
|
|
3463
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3464
|
+
onClick: () => setShowPreview(false),
|
|
3465
|
+
style: {
|
|
3466
|
+
position: "absolute",
|
|
3467
|
+
top: "10px",
|
|
3468
|
+
right: "10px",
|
|
3469
|
+
cursor: "pointer",
|
|
3470
|
+
fontWeight: "bold",
|
|
3471
|
+
fontSize: "20px",
|
|
3472
|
+
color: "#333",
|
|
3473
|
+
background: "#eee",
|
|
3474
|
+
width: "30px",
|
|
3475
|
+
height: "30px",
|
|
3476
|
+
display: "flex",
|
|
3477
|
+
justifyContent: "center",
|
|
3478
|
+
alignItems: "center",
|
|
3479
|
+
borderRadius: "50%"
|
|
3480
|
+
}
|
|
3481
|
+
}, "\xD7"), /*#__PURE__*/React.createElement("img", {
|
|
3482
|
+
src: previewUrl,
|
|
3483
|
+
alt: "Document Preview",
|
|
3484
|
+
style: {
|
|
3485
|
+
maxWidth: "100%",
|
|
3486
|
+
height: "auto",
|
|
3487
|
+
display: "block"
|
|
3488
|
+
},
|
|
3489
|
+
onError: e => {
|
|
3490
|
+
e.target.style.display = "none";
|
|
3491
|
+
e.target.nextSibling.style.display = "block";
|
|
3492
|
+
}
|
|
3493
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
3494
|
+
style: {
|
|
3495
|
+
display: "none",
|
|
3496
|
+
padding: "40px",
|
|
3497
|
+
textAlign: "center"
|
|
3498
|
+
}
|
|
3499
|
+
}, /*#__PURE__*/React.createElement("p", null, t("EKYC_DOCUMENT_PREVIEW_NOT_AVAILABLE")), /*#__PURE__*/React.createElement(LinkButton, {
|
|
3500
|
+
label: t("EKYC_OPEN_IN_NEW_TAB"),
|
|
3501
|
+
onClick: () => window.open(previewUrl, "_blank")
|
|
3502
|
+
})))));
|
|
3129
3503
|
};
|
|
3130
3504
|
|
|
3131
3505
|
var QueryClientContext = function () {
|
|
@@ -3149,41 +3523,117 @@ var useQueryClient = function useQueryClient() {
|
|
|
3149
3523
|
|
|
3150
3524
|
const AadhaarVerification = ({
|
|
3151
3525
|
config,
|
|
3152
|
-
onSelect
|
|
3526
|
+
onSelect,
|
|
3527
|
+
formData
|
|
3153
3528
|
}) => {
|
|
3154
|
-
const
|
|
3155
|
-
const
|
|
3156
|
-
const
|
|
3157
|
-
const
|
|
3158
|
-
const
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
const
|
|
3171
|
-
const
|
|
3172
|
-
const [
|
|
3173
|
-
const [
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
const [
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
const [
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
const [
|
|
3183
|
-
const [
|
|
3184
|
-
const [
|
|
3185
|
-
const [
|
|
3529
|
+
const location = useLocation();
|
|
3530
|
+
const flowState = location.state || {};
|
|
3531
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3532
|
+
const searchKno = (flowState === null || flowState === void 0 ? void 0 : flowState.kNumber) || (flowState === null || flowState === void 0 ? void 0 : flowState.kno) || (formData === null || formData === void 0 ? void 0 : formData.kNumber) || (formData === null || formData === void 0 ? void 0 : formData.kno) || sessionStorage.getItem("EKYC_K_NUMBER");
|
|
3533
|
+
const {
|
|
3534
|
+
isLoading,
|
|
3535
|
+
data: searchData
|
|
3536
|
+
} = Digit.Hooks.ekyc.useSearchConnection({
|
|
3537
|
+
tenantId,
|
|
3538
|
+
details: {
|
|
3539
|
+
kno: searchKno
|
|
3540
|
+
}
|
|
3541
|
+
}, {
|
|
3542
|
+
enabled: !!searchKno,
|
|
3543
|
+
cacheTime: 0
|
|
3544
|
+
});
|
|
3545
|
+
const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
|
|
3546
|
+
const savedData = (formData === null || formData === void 0 ? void 0 : formData.aadhaarVerification) || {};
|
|
3547
|
+
const [kno, setKno] = useState(savedData.kno || searchKno || "");
|
|
3548
|
+
const [consumerType, setConsumerType] = useState(savedData.consumerType ? {
|
|
3549
|
+
name: savedData.consumerType
|
|
3550
|
+
} : null);
|
|
3551
|
+
const [occupantType, setOccupantType] = useState(savedData.occupantType ? {
|
|
3552
|
+
name: savedData.occupantType
|
|
3553
|
+
} : null);
|
|
3554
|
+
const [categoryType, setCategoryType] = useState(savedData.categoryType ? {
|
|
3555
|
+
name: savedData.categoryType
|
|
3556
|
+
} : null);
|
|
3557
|
+
const [consumerName, setConsumerName] = useState(savedData.consumerName || "");
|
|
3558
|
+
const [firstName, setFirstName] = useState(savedData.firstName || "");
|
|
3559
|
+
const [middleName, setMiddleName] = useState(savedData.middleName || "");
|
|
3560
|
+
const [lastName, setLastName] = useState(savedData.lastName || "");
|
|
3561
|
+
const [gender, setGender] = useState(savedData.gender ? {
|
|
3562
|
+
name: savedData.gender
|
|
3563
|
+
} : null);
|
|
3564
|
+
const [parentSpouseName, setParentSpouseName] = useState(savedData.parentSpouseName || "");
|
|
3565
|
+
const [relation, setRelation] = useState(savedData.relation || "");
|
|
3566
|
+
const [mobile, setMobile] = useState(savedData.mobile || "");
|
|
3567
|
+
const [whatsapp, setWhatsapp] = useState(savedData.whatsapp || "");
|
|
3568
|
+
const [email, setEmail] = useState(savedData.email || "");
|
|
3569
|
+
const [residents, setResidents] = useState(savedData.residents || "");
|
|
3570
|
+
const [documentProof, setDocumentProof] = useState(savedData.documentProof || null);
|
|
3571
|
+
const [documentId, setDocumentId] = useState(savedData.documentId || null);
|
|
3572
|
+
const [ownerMobile, setOwnerMobile] = useState(savedData.ownerMobile || "");
|
|
3573
|
+
const [tenantVerification, setTenantVerification] = useState(savedData.tenantVerification || "");
|
|
3574
|
+
const [designation, setDesignation] = useState(savedData.designation || "");
|
|
3575
|
+
const [department, setDepartment] = useState(savedData.department || "");
|
|
3576
|
+
const [employeeId, setEmployeeId] = useState(savedData.employeeId || "");
|
|
3577
|
+
const [landline, setLandline] = useState(savedData.landline || "");
|
|
3578
|
+
const [entityRelation, setEntityRelation] = useState(savedData.entityRelation || "");
|
|
3579
|
+
const [contactPerson, setContactPerson] = useState(savedData.contactPerson || "");
|
|
3580
|
+
const [entityName, setEntityName] = useState(savedData.entityName || "");
|
|
3581
|
+
const [idProof, setIdProof] = useState(savedData.idProof ? {
|
|
3582
|
+
name: savedData.idProof
|
|
3583
|
+
} : null);
|
|
3584
|
+
const [idNumber, setIdNumber] = useState(savedData.idNumber || "");
|
|
3585
|
+
const [documentNumber, setDocumentNumber] = useState(savedData.documentNumber || "");
|
|
3586
|
+
const [identityType, setIdentityType] = useState(savedData.identityType ? {
|
|
3587
|
+
name: savedData.identityType
|
|
3588
|
+
} : null);
|
|
3589
|
+
const [idFile, setIdFile] = useState(savedData.idFile || null);
|
|
3590
|
+
const [consent, setConsent] = useState(savedData.consent || false);
|
|
3591
|
+
const [informantIsConsumer, setInformantIsConsumer] = useState(savedData.informantIsConsumer ?? true);
|
|
3592
|
+
const [informantName, setInformantName] = useState(savedData.informantName || "");
|
|
3593
|
+
const [informantRelation, setInformantRelation] = useState(savedData.informantRelation || "");
|
|
3186
3594
|
const [toast, setToast] = useState(null);
|
|
3595
|
+
useEffect(() => {
|
|
3596
|
+
const rawData = searchData || (formData === null || formData === void 0 ? void 0 : formData.connectionDetails);
|
|
3597
|
+
const details = (rawData === null || rawData === void 0 ? void 0 : rawData.connectionDetails) || rawData || {};
|
|
3598
|
+
const addrDetails = (rawData === null || rawData === void 0 ? void 0 : rawData.addressDetails) || {};
|
|
3599
|
+
if (details && Object.keys(details).length > 0 && !savedData.firstName) {
|
|
3600
|
+
if (!kno && searchKno) setKno(searchKno);
|
|
3601
|
+
if (details.firstName) {
|
|
3602
|
+
setFirstName(details.firstName);
|
|
3603
|
+
if (details.middleName) setMiddleName(details.middleName);
|
|
3604
|
+
if (details.lastName) setLastName(details.lastName);
|
|
3605
|
+
} else if (details.consumerName) {
|
|
3606
|
+
setConsumerName(details.consumerName);
|
|
3607
|
+
const parts = details.consumerName.trim().split(/\s+/);
|
|
3608
|
+
setFirstName(parts[0] || "");
|
|
3609
|
+
if (parts.length === 2) setLastName(parts[1]);
|
|
3610
|
+
if (parts.length > 2) {
|
|
3611
|
+
setMiddleName(parts.slice(1, -1).join(" "));
|
|
3612
|
+
setLastName(parts[parts.length - 1]);
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3615
|
+
if (details.phoneNumber || addrDetails.mobileNo) setMobile(details.phoneNumber || addrDetails.mobileNo);
|
|
3616
|
+
if (details.email || addrDetails.email) setEmail(details.email || addrDetails.email);
|
|
3617
|
+
if (addrDetails.whatsappNo) setWhatsapp(addrDetails.whatsappNo);
|
|
3618
|
+
if (addrDetails.noOfPerson) setResidents(String(addrDetails.noOfPerson));
|
|
3619
|
+
if (details.consumerType) setConsumerType({
|
|
3620
|
+
name: details.consumerType
|
|
3621
|
+
});
|
|
3622
|
+
if (details.occupantType) setOccupantType({
|
|
3623
|
+
name: details.occupantType
|
|
3624
|
+
});
|
|
3625
|
+
if (details.gender) setGender({
|
|
3626
|
+
name: details.gender
|
|
3627
|
+
});
|
|
3628
|
+
if (details.parentSpouse) setParentSpouseName(details.parentSpouse);
|
|
3629
|
+
if (details.documentNumber) {
|
|
3630
|
+
setDocumentId(details.documentNumber);
|
|
3631
|
+
setIdNumber(details.documentNumber);
|
|
3632
|
+
}
|
|
3633
|
+
if (details.informantName) setInformantName(details.informantName);
|
|
3634
|
+
if (details.informantRelation) setInformantRelation(details.informantRelation);
|
|
3635
|
+
}
|
|
3636
|
+
}, [searchData, formData === null || formData === void 0 ? void 0 : formData.connectionDetails, searchKno]);
|
|
3187
3637
|
const consumerTypeOptions = [{
|
|
3188
3638
|
name: "Individual"
|
|
3189
3639
|
}, {
|
|
@@ -3205,6 +3655,15 @@ const AadhaarVerification = ({
|
|
|
3205
3655
|
}, {
|
|
3206
3656
|
name: "Not prefer to say"
|
|
3207
3657
|
}];
|
|
3658
|
+
const identityTypeOptions = [{
|
|
3659
|
+
name: "Aadhaar Card"
|
|
3660
|
+
}, {
|
|
3661
|
+
name: "Driving License"
|
|
3662
|
+
}, {
|
|
3663
|
+
name: "Passport"
|
|
3664
|
+
}, {
|
|
3665
|
+
name: "Voter ID"
|
|
3666
|
+
}];
|
|
3208
3667
|
const uploadFile = async (e, setter, idSetter) => {
|
|
3209
3668
|
const file = e.target.files[0];
|
|
3210
3669
|
if (!file) return;
|
|
@@ -3234,14 +3693,7 @@ const AadhaarVerification = ({
|
|
|
3234
3693
|
if ((occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && !documentId && !ownerMobile) return false;
|
|
3235
3694
|
return consent;
|
|
3236
3695
|
};
|
|
3237
|
-
const onStepSelect = () => {
|
|
3238
|
-
if (!isValid()) {
|
|
3239
|
-
setToast({
|
|
3240
|
-
type: "error",
|
|
3241
|
-
message: "Fill required fields"
|
|
3242
|
-
});
|
|
3243
|
-
return;
|
|
3244
|
-
}
|
|
3696
|
+
const onStepSelect = async () => {
|
|
3245
3697
|
const data = {
|
|
3246
3698
|
kno,
|
|
3247
3699
|
consumerType: consumerType === null || consumerType === void 0 ? void 0 : consumerType.name,
|
|
@@ -3252,6 +3704,7 @@ const AadhaarVerification = ({
|
|
|
3252
3704
|
middleName,
|
|
3253
3705
|
lastName,
|
|
3254
3706
|
gender: gender === null || gender === void 0 ? void 0 : gender.name,
|
|
3707
|
+
parentSpouseName,
|
|
3255
3708
|
relation,
|
|
3256
3709
|
mobile,
|
|
3257
3710
|
whatsapp,
|
|
@@ -3274,15 +3727,32 @@ const AadhaarVerification = ({
|
|
|
3274
3727
|
informantName,
|
|
3275
3728
|
informantRelation
|
|
3276
3729
|
};
|
|
3277
|
-
|
|
3730
|
+
try {
|
|
3731
|
+
await updateMutation.mutateAsync({
|
|
3732
|
+
RequestInfo: {},
|
|
3733
|
+
updateType: "CONSUMER",
|
|
3734
|
+
...data
|
|
3735
|
+
});
|
|
3736
|
+
setToast({
|
|
3737
|
+
type: "success",
|
|
3738
|
+
message: "Data updated successfully!"
|
|
3739
|
+
});
|
|
3740
|
+
onSelect(config.key, data);
|
|
3741
|
+
} catch (error) {
|
|
3742
|
+
setToast({
|
|
3743
|
+
type: "error",
|
|
3744
|
+
message: "Failed to update consumer details"
|
|
3745
|
+
});
|
|
3746
|
+
}
|
|
3278
3747
|
};
|
|
3748
|
+
if (isLoading) {
|
|
3749
|
+
return /*#__PURE__*/React.createElement(Loader, null);
|
|
3750
|
+
}
|
|
3279
3751
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
|
|
3280
3752
|
onSelect: onStepSelect,
|
|
3281
|
-
config: config
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
onChange: e => setKno(e.target.value)
|
|
3285
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Consumer Type *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3753
|
+
config: config,
|
|
3754
|
+
isDisabled: !isValid()
|
|
3755
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Consumer Type *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3286
3756
|
option: consumerTypeOptions,
|
|
3287
3757
|
selected: consumerType,
|
|
3288
3758
|
select: setConsumerType
|
|
@@ -3307,6 +3777,9 @@ const AadhaarVerification = ({
|
|
|
3307
3777
|
option: genderOptions,
|
|
3308
3778
|
selected: gender,
|
|
3309
3779
|
select: setGender
|
|
3780
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Parent/Spouse Name "), /*#__PURE__*/React.createElement(TextInput, {
|
|
3781
|
+
value: parentSpouseName,
|
|
3782
|
+
onChange: e => setParentSpouseName(e.target.value)
|
|
3310
3783
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3311
3784
|
value: mobile,
|
|
3312
3785
|
onChange: e => setMobile(e.target.value)
|
|
@@ -3319,7 +3792,26 @@ const AadhaarVerification = ({
|
|
|
3319
3792
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "No. of Residents *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3320
3793
|
value: residents,
|
|
3321
3794
|
onChange: e => setResidents(e.target.value)
|
|
3322
|
-
})),
|
|
3795
|
+
})), /*#__PURE__*/React.createElement("div", null, console.log("identityType", identityType), /*#__PURE__*/React.createElement(CardLabel, null, "Type of Identity *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3796
|
+
option: identityTypeOptions,
|
|
3797
|
+
selected: identityType,
|
|
3798
|
+
select: setIdentityType
|
|
3799
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Proof of Identity"), /*#__PURE__*/React.createElement(UploadFile, {
|
|
3800
|
+
onUpload: e => uploadFile(e, setDocumentProof, setDocumentId)
|
|
3801
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Number"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3802
|
+
value: documentNumber,
|
|
3803
|
+
onChange: e => setDocumentNumber(e.target.value)
|
|
3804
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Is Consumer"), /*#__PURE__*/React.createElement(CheckBox, {
|
|
3805
|
+
label: "Yes, the informant is the consumer",
|
|
3806
|
+
checked: informantIsConsumer,
|
|
3807
|
+
onChange: e => setInformantIsConsumer(e.target.checked)
|
|
3808
|
+
})), !informantIsConsumer && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Name"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3809
|
+
value: informantName,
|
|
3810
|
+
onChange: e => setInformantName(e.target.value)
|
|
3811
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Relation"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3812
|
+
value: informantRelation,
|
|
3813
|
+
onChange: e => setInformantRelation(e.target.value)
|
|
3814
|
+
}))), (occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Proof"), /*#__PURE__*/React.createElement(UploadFile, {
|
|
3323
3815
|
onUpload: e => uploadFile(e, setDocumentProof, setDocumentId)
|
|
3324
3816
|
})), !documentId && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Owner Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3325
3817
|
value: ownerMobile,
|
|
@@ -3342,7 +3834,11 @@ const AadhaarVerification = ({
|
|
|
3342
3834
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Contact Person"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3343
3835
|
value: contactPerson,
|
|
3344
3836
|
onChange: e => setContactPerson(e.target.value)
|
|
3345
|
-
}))))
|
|
3837
|
+
})))), toast && /*#__PURE__*/React.createElement(Toast, {
|
|
3838
|
+
error: toast.type === "error",
|
|
3839
|
+
label: toast.message,
|
|
3840
|
+
onClose: () => setToast(null)
|
|
3841
|
+
}));
|
|
3346
3842
|
};
|
|
3347
3843
|
|
|
3348
3844
|
const ekycConfig = [{
|
|
@@ -3559,259 +4055,89 @@ const EmployeeApp = ({
|
|
|
3559
4055
|
className: "employee-form-content"
|
|
3560
4056
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
3561
4057
|
path: `${path}/dashboard`,
|
|
3562
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
4058
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
4059
|
+
layoutClass: "normal"
|
|
4060
|
+
}, /*#__PURE__*/React.createElement(Dashboard, {
|
|
3563
4061
|
parentRoute: path,
|
|
3564
4062
|
businessService: "EKYC",
|
|
3565
4063
|
moduleCode: "EKYC",
|
|
3566
4064
|
isInbox: true
|
|
3567
|
-
})
|
|
4065
|
+
}))
|
|
3568
4066
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
3569
4067
|
path: `${path}/inbox`,
|
|
3570
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
4068
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
4069
|
+
layoutClass: "normal"
|
|
4070
|
+
}, /*#__PURE__*/React.createElement(Inbox, {
|
|
3571
4071
|
parentRoute: path,
|
|
3572
4072
|
businessService: "EKYC",
|
|
3573
4073
|
moduleCode: "EKYC",
|
|
3574
4074
|
isInbox: true
|
|
3575
|
-
})
|
|
4075
|
+
}))
|
|
3576
4076
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
3577
4077
|
path: `${path}/create-kyc`,
|
|
3578
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
4078
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
4079
|
+
layoutClass: "normal"
|
|
4080
|
+
}, /*#__PURE__*/React.createElement(Create, null))
|
|
3579
4081
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
3580
4082
|
path: `${path}/mapping`,
|
|
3581
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
4083
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
4084
|
+
layoutClass: "normal"
|
|
4085
|
+
}, /*#__PURE__*/React.createElement(Mapping, null))
|
|
3582
4086
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
3583
4087
|
path: formStepRoutes.map(route => `${path}/${route}`),
|
|
3584
|
-
component: props => /*#__PURE__*/React.createElement(
|
|
4088
|
+
component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
4089
|
+
layoutClass: "normal"
|
|
4090
|
+
}, /*#__PURE__*/React.createElement(EKYCForm, Object.assign({}, props, {
|
|
3585
4091
|
path: path
|
|
3586
|
-
}))
|
|
4092
|
+
})))
|
|
3587
4093
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
3588
4094
|
path: `${path}/review`,
|
|
3589
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
4095
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
4096
|
+
layoutClass: "normal"
|
|
4097
|
+
}, /*#__PURE__*/React.createElement(Review, null))
|
|
3590
4098
|
}))))));
|
|
3591
4099
|
};
|
|
3592
4100
|
|
|
3593
|
-
const
|
|
4101
|
+
const PropertyInfo = ({
|
|
3594
4102
|
config,
|
|
3595
|
-
onSelect
|
|
4103
|
+
onSelect,
|
|
4104
|
+
formData
|
|
3596
4105
|
}) => {
|
|
3597
|
-
var _mdmsData$MdmsRes, _mdmsData$MdmsRes$ego, _mdmsData$MdmsRes$ego2, _mdmsData$MdmsRes$ego3, _mdmsData$MdmsRes$ego4;
|
|
3598
4106
|
const {
|
|
3599
4107
|
t
|
|
3600
4108
|
} = useTranslation();
|
|
4109
|
+
const location = useLocation();
|
|
4110
|
+
const flowState = location.state || {};
|
|
3601
4111
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3602
|
-
const
|
|
3603
|
-
const [street, setStreet] = useState("");
|
|
3604
|
-
const [locality, setLocality] = useState("");
|
|
3605
|
-
const [landmark, setLandmark] = useState("");
|
|
3606
|
-
const [subLocality, setSubLocality] = useState(null);
|
|
3607
|
-
const [pinCode, setPinCode] = useState("");
|
|
3608
|
-
const [assembly, setAssembly] = useState(null);
|
|
3609
|
-
const [ward, setWard] = useState(null);
|
|
3610
|
-
const [zone, setZone] = useState(null);
|
|
3611
|
-
const [latitude, setLatitude] = useState("");
|
|
3612
|
-
const [longitude, setLongitude] = useState("");
|
|
3613
|
-
const [addressType, setAddressType] = useState(null);
|
|
3614
|
-
const [doorPhoto, setDoorPhoto] = useState(null);
|
|
3615
|
-
const [doorPhotoFileStoreId, setDoorPhotoFileStoreId] = useState(null);
|
|
3616
|
-
const [toast, setToast] = useState(null);
|
|
4112
|
+
const searchKno = (flowState === null || flowState === void 0 ? void 0 : flowState.kNumber) || (flowState === null || flowState === void 0 ? void 0 : flowState.kno) || (formData === null || formData === void 0 ? void 0 : formData.kNumber) || (formData === null || formData === void 0 ? void 0 : formData.kno) || sessionStorage.getItem("EKYC_K_NUMBER");
|
|
3617
4113
|
const {
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
} = Digit.Hooks.
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
if (navigator.geolocation) {
|
|
3625
|
-
navigator.geolocation.getCurrentPosition(pos => {
|
|
3626
|
-
if (!isMounted) return;
|
|
3627
|
-
setLatitude(pos.coords.latitude);
|
|
3628
|
-
setLongitude(pos.coords.longitude);
|
|
3629
|
-
}, () => {
|
|
3630
|
-
if (!isMounted) return;
|
|
3631
|
-
setToast({
|
|
3632
|
-
type: "error",
|
|
3633
|
-
message: "GPS access denied"
|
|
3634
|
-
});
|
|
3635
|
-
});
|
|
3636
|
-
}
|
|
3637
|
-
return () => {
|
|
3638
|
-
isMounted = false;
|
|
3639
|
-
};
|
|
3640
|
-
}, []);
|
|
3641
|
-
const handlePincodeChange = e => {
|
|
3642
|
-
const value = e.target.value;
|
|
3643
|
-
if (/^\d{0,6}$/.test(value)) {
|
|
3644
|
-
setPinCode(value);
|
|
3645
|
-
if (value.length === 6) {
|
|
3646
|
-
fetchLocationByPincode(value);
|
|
3647
|
-
}
|
|
3648
|
-
}
|
|
3649
|
-
};
|
|
3650
|
-
const fetchLocationByPincode = pin => {
|
|
3651
|
-
console.log("Fetching location for PIN:", pin);
|
|
3652
|
-
};
|
|
3653
|
-
const selectphoto = async e => {
|
|
3654
|
-
let isMounted = true;
|
|
3655
|
-
const file = e.target.files[0];
|
|
3656
|
-
if (!file) return;
|
|
3657
|
-
if (file.size >= 2000000) {
|
|
3658
|
-
setToast({
|
|
3659
|
-
type: "error",
|
|
3660
|
-
message: "Max size 2MB exceeded"
|
|
3661
|
-
});
|
|
3662
|
-
return;
|
|
3663
|
-
}
|
|
3664
|
-
try {
|
|
3665
|
-
var _res$data, _res$data$files, _res$data$files$;
|
|
3666
|
-
const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
|
|
3667
|
-
if (!isMounted) return;
|
|
3668
|
-
const fileStoreId = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$files = _res$data.files) === null || _res$data$files === void 0 ? void 0 : (_res$data$files$ = _res$data$files[0]) === null || _res$data$files$ === void 0 ? void 0 : _res$data$files$.fileStoreId;
|
|
3669
|
-
if (fileStoreId) {
|
|
3670
|
-
setDoorPhotoFileStoreId(fileStoreId);
|
|
3671
|
-
const reader = new FileReader();
|
|
3672
|
-
reader.onloadend = () => {
|
|
3673
|
-
if (!isMounted) return;
|
|
3674
|
-
setDoorPhoto(reader.result);
|
|
3675
|
-
};
|
|
3676
|
-
reader.readAsDataURL(file);
|
|
3677
|
-
setToast({
|
|
3678
|
-
type: "success",
|
|
3679
|
-
message: "Upload successful"
|
|
3680
|
-
});
|
|
3681
|
-
}
|
|
3682
|
-
} catch {
|
|
3683
|
-
if (!isMounted) return;
|
|
3684
|
-
setToast({
|
|
3685
|
-
type: "error",
|
|
3686
|
-
message: "Upload failed"
|
|
3687
|
-
});
|
|
3688
|
-
}
|
|
3689
|
-
return () => {
|
|
3690
|
-
isMounted = false;
|
|
3691
|
-
};
|
|
3692
|
-
};
|
|
3693
|
-
const removePhoto = () => {
|
|
3694
|
-
setDoorPhoto(null);
|
|
3695
|
-
setDoorPhotoFileStoreId(null);
|
|
3696
|
-
};
|
|
3697
|
-
const isValid = () => {
|
|
3698
|
-
return houseNo && street && pinCode.length === 6 && assembly && ward && zone && latitude && longitude && doorPhotoFileStoreId;
|
|
3699
|
-
};
|
|
3700
|
-
const onStepSelect = () => {
|
|
3701
|
-
if (!isValid()) {
|
|
3702
|
-
setToast({
|
|
3703
|
-
type: "error",
|
|
3704
|
-
message: "Please fill all mandatory fields"
|
|
3705
|
-
});
|
|
3706
|
-
return;
|
|
3707
|
-
}
|
|
3708
|
-
const data = {
|
|
3709
|
-
houseNo,
|
|
3710
|
-
street,
|
|
3711
|
-
locality,
|
|
3712
|
-
landmark,
|
|
3713
|
-
subLocality,
|
|
3714
|
-
pinCode,
|
|
3715
|
-
assembly: assembly === null || assembly === void 0 ? void 0 : assembly.name,
|
|
3716
|
-
ward: ward === null || ward === void 0 ? void 0 : ward.name,
|
|
3717
|
-
zone: zone === null || zone === void 0 ? void 0 : zone.name,
|
|
3718
|
-
latitude,
|
|
3719
|
-
longitude,
|
|
3720
|
-
addressType: addressType === null || addressType === void 0 ? void 0 : addressType.name,
|
|
3721
|
-
doorPhotoFilestoreId: doorPhotoFileStoreId
|
|
3722
|
-
};
|
|
3723
|
-
onSelect(config.key, data);
|
|
3724
|
-
};
|
|
3725
|
-
if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
3726
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
|
|
3727
|
-
t: t,
|
|
3728
|
-
onSelect: onStepSelect,
|
|
3729
|
-
config: config,
|
|
3730
|
-
label: t("ES_COMMON_CONTINUE")
|
|
3731
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, "House No / Flat No *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3732
|
-
value: houseNo,
|
|
3733
|
-
onChange: e => setHouseNo(e.target.value)
|
|
3734
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Street / Address Line *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3735
|
-
value: street,
|
|
3736
|
-
onChange: e => setStreet(e.target.value)
|
|
3737
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Locality"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3738
|
-
value: locality,
|
|
3739
|
-
onChange: e => setLocality(e.target.value)
|
|
3740
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Landmark"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3741
|
-
value: landmark,
|
|
3742
|
-
onChange: e => setLandmark(e.target.value)
|
|
3743
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Sub Locality"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3744
|
-
option: [],
|
|
3745
|
-
selected: subLocality,
|
|
3746
|
-
select: setSubLocality
|
|
3747
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "PIN Code *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3748
|
-
value: pinCode,
|
|
3749
|
-
onChange: handlePincodeChange,
|
|
3750
|
-
maxLength: 6
|
|
3751
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Assembly *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3752
|
-
option: assemblies,
|
|
3753
|
-
selected: assembly,
|
|
3754
|
-
select: setAssembly
|
|
3755
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Ward *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3756
|
-
option: (assembly === null || assembly === void 0 ? void 0 : assembly.children) || [],
|
|
3757
|
-
selected: ward,
|
|
3758
|
-
select: setWard
|
|
3759
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Zone *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3760
|
-
option: (ward === null || ward === void 0 ? void 0 : ward.children) || [],
|
|
3761
|
-
selected: zone,
|
|
3762
|
-
select: setZone
|
|
3763
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Latitude"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3764
|
-
value: latitude,
|
|
3765
|
-
disabled: true
|
|
3766
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Longitude"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3767
|
-
value: longitude,
|
|
3768
|
-
disabled: true
|
|
3769
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Address Type"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3770
|
-
option: [{
|
|
3771
|
-
name: "Permanent"
|
|
3772
|
-
}, {
|
|
3773
|
-
name: "Correspondence"
|
|
3774
|
-
}, {
|
|
3775
|
-
name: "Other"
|
|
3776
|
-
}],
|
|
3777
|
-
selected: addressType,
|
|
3778
|
-
select: setAddressType
|
|
3779
|
-
}), /*#__PURE__*/React.createElement(CardLabel, null, "Door Image *"), /*#__PURE__*/React.createElement(UploadFile, {
|
|
3780
|
-
onUpload: selectphoto,
|
|
3781
|
-
onDelete: removePhoto,
|
|
3782
|
-
message: doorPhotoFileStoreId ? "Uploaded" : "No file selected"
|
|
3783
|
-
}), doorPhoto && /*#__PURE__*/React.createElement("img", {
|
|
3784
|
-
src: doorPhoto,
|
|
3785
|
-
alt: "preview",
|
|
3786
|
-
style: {
|
|
3787
|
-
width: "100%",
|
|
3788
|
-
marginTop: "10px"
|
|
4114
|
+
isLoading,
|
|
4115
|
+
data: searchData
|
|
4116
|
+
} = Digit.Hooks.ekyc.useSearchConnection({
|
|
4117
|
+
tenantId,
|
|
4118
|
+
details: {
|
|
4119
|
+
kno: searchKno
|
|
3789
4120
|
}
|
|
3790
|
-
}
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
};
|
|
3796
|
-
|
|
3797
|
-
const
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
const
|
|
3805
|
-
const [
|
|
3806
|
-
const [
|
|
3807
|
-
const [
|
|
3808
|
-
const [noOfFloors, setNoOfFloors] = useState("");
|
|
3809
|
-
const [floorNo, setFloorNo] = useState("");
|
|
3810
|
-
const [noOfRooms, setNoOfRooms] = useState("");
|
|
3811
|
-
const [noOfBeds, setNoOfBeds] = useState("");
|
|
3812
|
-
const [dwellingUnits, setDwellingUnits] = useState("");
|
|
4121
|
+
}, {
|
|
4122
|
+
enabled: !!searchKno,
|
|
4123
|
+
cacheTime: 0
|
|
4124
|
+
});
|
|
4125
|
+
const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
|
|
4126
|
+
const savedData = (formData === null || formData === void 0 ? void 0 : formData.propertyDetails) || {};
|
|
4127
|
+
const [pidNumber, setPidNumber] = useState(savedData.pidNumber || "");
|
|
4128
|
+
const [propertyType, setPropertyType] = useState(savedData.propertyType ? {
|
|
4129
|
+
name: savedData.propertyType
|
|
4130
|
+
} : null);
|
|
4131
|
+
const [subPropertyCategory, setSubPropertyCategory] = useState(savedData.subPropertyCategory ? {
|
|
4132
|
+
name: savedData.subPropertyCategory
|
|
4133
|
+
} : null);
|
|
4134
|
+
const [noOfFloors, setNoOfFloors] = useState(savedData.noOfFloors || "");
|
|
4135
|
+
const [floorNo, setFloorNo] = useState(savedData.floorNo || "");
|
|
4136
|
+
const [noOfRooms, setNoOfRooms] = useState(savedData.noOfRooms || "");
|
|
4137
|
+
const [noOfBeds, setNoOfBeds] = useState(savedData.noOfBeds || "");
|
|
4138
|
+
const [dwellingUnits, setDwellingUnits] = useState(savedData.dwellingUnits || "");
|
|
3813
4139
|
const [buildingImage, setBuildingImage] = useState(null);
|
|
3814
|
-
const [buildingImageId, setBuildingImageId] = useState(null);
|
|
4140
|
+
const [buildingImageId, setBuildingImageId] = useState(savedData.buildingImageId || null);
|
|
3815
4141
|
const [toast, setToast] = useState(null);
|
|
3816
4142
|
const propertyTypeOptions = [{
|
|
3817
4143
|
name: "Residential"
|
|
@@ -3824,6 +4150,36 @@ const PropertyInfo = ({
|
|
|
3824
4150
|
}, {
|
|
3825
4151
|
name: "Nursing Home"
|
|
3826
4152
|
}];
|
|
4153
|
+
useEffect(() => {
|
|
4154
|
+
const rawData = searchData || (formData === null || formData === void 0 ? void 0 : formData.connectionDetails);
|
|
4155
|
+
const propertyInfo = (rawData === null || rawData === void 0 ? void 0 : rawData.propertyInfo) || (rawData === null || rawData === void 0 ? void 0 : rawData.propertyDetails) || {};
|
|
4156
|
+
if (propertyInfo && Object.keys(propertyInfo).length > 0 && !savedData.pidNumber) {
|
|
4157
|
+
if (propertyInfo.pidNumber) setPidNumber(propertyInfo.pidNumber);
|
|
4158
|
+
if (propertyInfo.numberOfFloors || propertyInfo.noOfFloor) setNoOfFloors(String(propertyInfo.numberOfFloors || propertyInfo.noOfFloor));
|
|
4159
|
+
if (propertyInfo.buildingImageFileStoreId) setBuildingImageId(propertyInfo.buildingImageFileStoreId);
|
|
4160
|
+
if (propertyInfo.subPropertyCategory) {
|
|
4161
|
+
const matchingType = propertyTypeOptions.find(type => type.name.toLowerCase() === propertyInfo.subPropertyCategory.toLowerCase());
|
|
4162
|
+
if (matchingType) setPropertyType(matchingType);else setPropertyType({
|
|
4163
|
+
name: propertyInfo.subPropertyCategory
|
|
4164
|
+
});
|
|
4165
|
+
setSubPropertyCategory({
|
|
4166
|
+
name: propertyInfo.subPropertyCategory
|
|
4167
|
+
});
|
|
4168
|
+
}
|
|
4169
|
+
if (propertyInfo.propertyType) {
|
|
4170
|
+
setSubPropertyCategory({
|
|
4171
|
+
name: propertyInfo.propertyType
|
|
4172
|
+
});
|
|
4173
|
+
if (!propertyInfo.subPropertyCategory) setPropertyType({
|
|
4174
|
+
name: propertyInfo.propertyType
|
|
4175
|
+
});
|
|
4176
|
+
}
|
|
4177
|
+
if (propertyInfo.floorNo) setFloorNo(propertyInfo.floorNo);
|
|
4178
|
+
if (propertyInfo.numberOfRooms !== null && propertyInfo.numberOfRooms !== undefined) setNoOfRooms(String(propertyInfo.numberOfRooms));
|
|
4179
|
+
if (propertyInfo.numberOfBeds !== null && propertyInfo.numberOfBeds !== undefined) setNoOfBeds(String(propertyInfo.numberOfBeds));
|
|
4180
|
+
if (propertyInfo.numberOfDwellingUnits !== null && propertyInfo.numberOfDwellingUnits !== undefined) setDwellingUnits(String(propertyInfo.numberOfDwellingUnits));
|
|
4181
|
+
}
|
|
4182
|
+
}, [searchData, formData === null || formData === void 0 ? void 0 : formData.connectionDetails]);
|
|
3827
4183
|
const handleUpload = async e => {
|
|
3828
4184
|
const file = e.target.files[0];
|
|
3829
4185
|
if (!file) return;
|
|
@@ -3856,20 +4212,15 @@ const PropertyInfo = ({
|
|
|
3856
4212
|
}
|
|
3857
4213
|
};
|
|
3858
4214
|
const isValid = () => {
|
|
4215
|
+
if (!propertyType) return false;
|
|
4216
|
+
if (!subPropertyCategory) return false;
|
|
3859
4217
|
if (!noOfFloors || Number(noOfFloors) < 1) return false;
|
|
3860
4218
|
if (!buildingImageId) return false;
|
|
3861
4219
|
if ((propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Hotel" && !noOfRooms) return false;
|
|
3862
4220
|
if (((propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Hospital" || (propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Nursing Home") && !noOfBeds) return false;
|
|
3863
4221
|
return true;
|
|
3864
4222
|
};
|
|
3865
|
-
const onStepSelect = () => {
|
|
3866
|
-
if (!isValid()) {
|
|
3867
|
-
setToast({
|
|
3868
|
-
type: "error",
|
|
3869
|
-
message: "Fill all required fields"
|
|
3870
|
-
});
|
|
3871
|
-
return;
|
|
3872
|
-
}
|
|
4223
|
+
const onStepSelect = async () => {
|
|
3873
4224
|
const data = {
|
|
3874
4225
|
pidNumber,
|
|
3875
4226
|
propertyType: propertyType === null || propertyType === void 0 ? void 0 : propertyType.name,
|
|
@@ -3881,13 +4232,34 @@ const PropertyInfo = ({
|
|
|
3881
4232
|
dwellingUnits,
|
|
3882
4233
|
buildingImageId
|
|
3883
4234
|
};
|
|
3884
|
-
|
|
4235
|
+
try {
|
|
4236
|
+
await updateMutation.mutateAsync({
|
|
4237
|
+
RequestInfo: {},
|
|
4238
|
+
updateType: "PROPERTY",
|
|
4239
|
+
kno: searchKno,
|
|
4240
|
+
...data
|
|
4241
|
+
});
|
|
4242
|
+
setToast({
|
|
4243
|
+
type: "success",
|
|
4244
|
+
message: "Property details updated successfully!"
|
|
4245
|
+
});
|
|
4246
|
+
onSelect(config.key, data);
|
|
4247
|
+
} catch (error) {
|
|
4248
|
+
setToast({
|
|
4249
|
+
type: "error",
|
|
4250
|
+
message: "Failed to update property details"
|
|
4251
|
+
});
|
|
4252
|
+
}
|
|
3885
4253
|
};
|
|
4254
|
+
if (isLoading) {
|
|
4255
|
+
return /*#__PURE__*/React.createElement(Loader, null);
|
|
4256
|
+
}
|
|
3886
4257
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
|
|
3887
4258
|
t: t,
|
|
3888
4259
|
onSelect: onStepSelect,
|
|
3889
4260
|
config: config,
|
|
3890
|
-
label: t("ES_COMMON_CONTINUE")
|
|
4261
|
+
label: t("ES_COMMON_CONTINUE"),
|
|
4262
|
+
isDisabled: !isValid()
|
|
3891
4263
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "PID Number"), /*#__PURE__*/React.createElement(TextInput, {
|
|
3892
4264
|
value: pidNumber,
|
|
3893
4265
|
onChange: e => setPidNumber(e.target.value)
|
|
@@ -3953,28 +4325,62 @@ const PropertyInfo = ({
|
|
|
3953
4325
|
|
|
3954
4326
|
const MeterDetails = ({
|
|
3955
4327
|
config,
|
|
3956
|
-
onSelect
|
|
4328
|
+
onSelect,
|
|
4329
|
+
formData
|
|
3957
4330
|
}) => {
|
|
4331
|
+
const location = useLocation();
|
|
4332
|
+
const flowState = location.state || {};
|
|
3958
4333
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3959
|
-
const
|
|
3960
|
-
const
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
const
|
|
3973
|
-
const
|
|
3974
|
-
const [
|
|
3975
|
-
const [
|
|
4334
|
+
const searchKno = (flowState === null || flowState === void 0 ? void 0 : flowState.kNumber) || (flowState === null || flowState === void 0 ? void 0 : flowState.kno) || (formData === null || formData === void 0 ? void 0 : formData.kNumber) || (formData === null || formData === void 0 ? void 0 : formData.kno) || sessionStorage.getItem("EKYC_K_NUMBER");
|
|
4335
|
+
const {
|
|
4336
|
+
isLoading,
|
|
4337
|
+
data: searchData
|
|
4338
|
+
} = Digit.Hooks.ekyc.useSearchConnection({
|
|
4339
|
+
tenantId,
|
|
4340
|
+
details: {
|
|
4341
|
+
kno: searchKno
|
|
4342
|
+
}
|
|
4343
|
+
}, {
|
|
4344
|
+
enabled: !!searchKno,
|
|
4345
|
+
cacheTime: 0
|
|
4346
|
+
});
|
|
4347
|
+
const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
|
|
4348
|
+
const savedData = (formData === null || formData === void 0 ? void 0 : formData.meterDetails) || {};
|
|
4349
|
+
const [connectionCategory, setConnectionCategory] = useState(savedData.connectionCategory || "");
|
|
4350
|
+
const [saType, setSaType] = useState(savedData.saType || "");
|
|
4351
|
+
const [status, setStatus] = useState(savedData.status || "");
|
|
4352
|
+
const [mrCode, setMrCode] = useState(savedData.mrCode || "");
|
|
4353
|
+
const [areaCode, setAreaCode] = useState(savedData.areaCode || "");
|
|
4354
|
+
const [mrKey, setMrKey] = useState(savedData.mrKey || "");
|
|
4355
|
+
const [meterNumber, setMeterNumber] = useState(savedData.meterNumber || "");
|
|
4356
|
+
const [meterMaker, setMeterMaker] = useState(savedData.meterMaker || "");
|
|
4357
|
+
const [meterStatus, setMeterStatus] = useState(savedData.meterStatus ? {
|
|
4358
|
+
name: savedData.meterStatus
|
|
4359
|
+
} : null);
|
|
4360
|
+
const [meterCondition, setMeterCondition] = useState(savedData.meterCondition ? {
|
|
4361
|
+
name: savedData.meterCondition
|
|
4362
|
+
} : null);
|
|
4363
|
+
const [meterLocation, setMeterLocation] = useState(savedData.meterLocation ? {
|
|
4364
|
+
name: savedData.meterLocation
|
|
4365
|
+
} : null);
|
|
4366
|
+
const [lastBillReceived, setLastBillReceived] = useState(savedData.lastBillReceived ? {
|
|
4367
|
+
name: savedData.lastBillReceived
|
|
4368
|
+
} : null);
|
|
4369
|
+
const [billMonthYear, setBillMonthYear] = useState(savedData.billMonthYear ? {
|
|
4370
|
+
name: savedData.billMonthYear
|
|
4371
|
+
} : null);
|
|
4372
|
+
const [reason, setReason] = useState(savedData.reason || "");
|
|
4373
|
+
const [accessToMeter, setAccessToMeter] = useState(savedData.accessToMeter ? {
|
|
4374
|
+
name: savedData.accessToMeter
|
|
4375
|
+
} : null);
|
|
4376
|
+
const [sewerConnection, setSewerConnection] = useState(savedData.sewerConnection ? {
|
|
4377
|
+
name: savedData.sewerConnection
|
|
4378
|
+
} : null);
|
|
4379
|
+
const [septicTank, setSepticTank] = useState(savedData.septicTank ? {
|
|
4380
|
+
name: savedData.septicTank
|
|
4381
|
+
} : null);
|
|
3976
4382
|
const [meterPhoto, setMeterPhoto] = useState(null);
|
|
3977
|
-
const [meterPhotoId, setMeterPhotoId] = useState(null);
|
|
4383
|
+
const [meterPhotoId, setMeterPhotoId] = useState(savedData.meterPhotoId || null);
|
|
3978
4384
|
const [toast, setToast] = useState(null);
|
|
3979
4385
|
const yesNo = [{
|
|
3980
4386
|
name: "Yes"
|
|
@@ -4006,6 +4412,91 @@ const MeterDetails = ({
|
|
|
4006
4412
|
});
|
|
4007
4413
|
}
|
|
4008
4414
|
}
|
|
4415
|
+
useEffect(() => {
|
|
4416
|
+
const rawData = searchData || (formData === null || formData === void 0 ? void 0 : formData.connectionDetails);
|
|
4417
|
+
const apiMeter = (rawData === null || rawData === void 0 ? void 0 : rawData.meterDetails) || rawData || {};
|
|
4418
|
+
if (apiMeter && Object.keys(apiMeter).length > 0 && !savedData.connectionCategory) {
|
|
4419
|
+
if (apiMeter.connectionCategory) setConnectionCategory(apiMeter.connectionCategory);
|
|
4420
|
+
if (apiMeter.saType) setSaType(apiMeter.saType);
|
|
4421
|
+
if (apiMeter.statusFlag) setStatus(apiMeter.statusFlag);
|
|
4422
|
+
if (apiMeter.mrcode) setMrCode(String(apiMeter.mrcode));
|
|
4423
|
+
if (apiMeter.areacode) setAreaCode(String(apiMeter.areacode));
|
|
4424
|
+
if (apiMeter.mrkey) setMrKey(String(apiMeter.mrkey));
|
|
4425
|
+
if (apiMeter.meterNumber) setMeterNumber(apiMeter.meterNumber);
|
|
4426
|
+
if (apiMeter.meterMake) setMeterMaker(apiMeter.meterMake);
|
|
4427
|
+
if (apiMeter.meterStatus) {
|
|
4428
|
+
const matchingStatus = meterStatusOptions.find(o => o.name.toLowerCase() === apiMeter.meterStatus.toLowerCase());
|
|
4429
|
+
if (matchingStatus) setMeterStatus(matchingStatus);else setMeterStatus({
|
|
4430
|
+
name: apiMeter.meterStatus
|
|
4431
|
+
});
|
|
4432
|
+
} else if (apiMeter.metered !== undefined) {
|
|
4433
|
+
setMeterStatus({
|
|
4434
|
+
name: apiMeter.metered ? "Metered" : "Unmetered"
|
|
4435
|
+
});
|
|
4436
|
+
}
|
|
4437
|
+
if (apiMeter.meterCondition) {
|
|
4438
|
+
const matchingCond = meterConditionOptions.find(o => o.name.toLowerCase() === apiMeter.meterCondition.toLowerCase());
|
|
4439
|
+
if (matchingCond) setMeterCondition(matchingCond);else setMeterCondition({
|
|
4440
|
+
name: apiMeter.meterCondition
|
|
4441
|
+
});
|
|
4442
|
+
}
|
|
4443
|
+
if (apiMeter.meterLocation) {
|
|
4444
|
+
const matchingLoc = meterLocationOptions.find(o => o.name.toLowerCase() === apiMeter.meterLocation.toLowerCase() || apiMeter.meterLocation.toLowerCase().includes(o.name.toLowerCase()));
|
|
4445
|
+
if (matchingLoc) setMeterLocation(matchingLoc);else setMeterLocation({
|
|
4446
|
+
name: apiMeter.meterLocation
|
|
4447
|
+
});
|
|
4448
|
+
}
|
|
4449
|
+
if (apiMeter.lastBillRaised !== undefined && apiMeter.lastBillRaised !== null) {
|
|
4450
|
+
const strVal = String(apiMeter.lastBillRaised).toLowerCase();
|
|
4451
|
+
if (strVal === "true" || strVal === "yes") setLastBillReceived({
|
|
4452
|
+
name: "Yes"
|
|
4453
|
+
});else setLastBillReceived({
|
|
4454
|
+
name: "No"
|
|
4455
|
+
});
|
|
4456
|
+
}
|
|
4457
|
+
if (apiMeter.lastBillReceivedDate) {
|
|
4458
|
+
const formatted = apiMeter.lastBillReceivedDate.replace("-", "/");
|
|
4459
|
+
const parsedParts = formatted.split("/");
|
|
4460
|
+
if (parsedParts.length === 2) {
|
|
4461
|
+
const mon = parseInt(parsedParts[0], 10);
|
|
4462
|
+
const yr = parseInt(parsedParts[1], 10);
|
|
4463
|
+
setBillMonthYear({
|
|
4464
|
+
name: `${mon}/${yr}`
|
|
4465
|
+
});
|
|
4466
|
+
} else {
|
|
4467
|
+
setBillMonthYear({
|
|
4468
|
+
name: apiMeter.lastBillReceivedDate
|
|
4469
|
+
});
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
if (apiMeter.lastBillNotRaisedReason) setReason(apiMeter.lastBillNotRaisedReason);
|
|
4473
|
+
if (apiMeter.accessToMeter !== undefined && apiMeter.accessToMeter !== null) {
|
|
4474
|
+
const strVal = String(apiMeter.accessToMeter).toLowerCase();
|
|
4475
|
+
if (strVal === "true" || strVal === "yes") setAccessToMeter({
|
|
4476
|
+
name: "Yes"
|
|
4477
|
+
});else setAccessToMeter({
|
|
4478
|
+
name: "No"
|
|
4479
|
+
});
|
|
4480
|
+
}
|
|
4481
|
+
if (apiMeter.sewerConnection !== undefined && apiMeter.sewerConnection !== null) {
|
|
4482
|
+
const strVal = String(apiMeter.sewerConnection).toLowerCase();
|
|
4483
|
+
if (strVal === "true" || strVal === "yes") setSewerConnection({
|
|
4484
|
+
name: "Yes"
|
|
4485
|
+
});else setSewerConnection({
|
|
4486
|
+
name: "No"
|
|
4487
|
+
});
|
|
4488
|
+
}
|
|
4489
|
+
if (apiMeter.septicTank !== undefined && apiMeter.septicTank !== null) {
|
|
4490
|
+
const strVal = String(apiMeter.septicTank).toLowerCase();
|
|
4491
|
+
if (strVal === "true" || strVal === "yes") setSepticTank({
|
|
4492
|
+
name: "Yes"
|
|
4493
|
+
});else setSepticTank({
|
|
4494
|
+
name: "No"
|
|
4495
|
+
});
|
|
4496
|
+
}
|
|
4497
|
+
if (apiMeter.meterPhotoFileStoreId) setMeterPhotoId(apiMeter.meterPhotoFileStoreId);
|
|
4498
|
+
}
|
|
4499
|
+
}, [searchData, formData === null || formData === void 0 ? void 0 : formData.connectionDetails]);
|
|
4009
4500
|
const isFrozen = (meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Can not be identified";
|
|
4010
4501
|
const uploadPhoto = async e => {
|
|
4011
4502
|
const file = e.target.files[0];
|
|
@@ -4035,17 +4526,11 @@ const MeterDetails = ({
|
|
|
4035
4526
|
if (!sewerConnection) return false;
|
|
4036
4527
|
if ((meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Metered" && !meterPhotoId) return false;
|
|
4037
4528
|
if ((lastBillReceived === null || lastBillReceived === void 0 ? void 0 : lastBillReceived.name) === "No" && !reason) return false;
|
|
4529
|
+
if ((lastBillReceived === null || lastBillReceived === void 0 ? void 0 : lastBillReceived.name) === "Yes" && !billMonthYear) return false;
|
|
4038
4530
|
if ((sewerConnection === null || sewerConnection === void 0 ? void 0 : sewerConnection.name) === "No" && !septicTank) return false;
|
|
4039
4531
|
return true;
|
|
4040
4532
|
};
|
|
4041
|
-
const onStepSelect = () => {
|
|
4042
|
-
if (!isValid()) {
|
|
4043
|
-
setToast({
|
|
4044
|
-
type: "error",
|
|
4045
|
-
message: "Fill all mandatory fields"
|
|
4046
|
-
});
|
|
4047
|
-
return;
|
|
4048
|
-
}
|
|
4533
|
+
const onStepSelect = async () => {
|
|
4049
4534
|
const data = {
|
|
4050
4535
|
connectionCategory,
|
|
4051
4536
|
saType,
|
|
@@ -4066,11 +4551,32 @@ const MeterDetails = ({
|
|
|
4066
4551
|
septicTank: septicTank === null || septicTank === void 0 ? void 0 : septicTank.name,
|
|
4067
4552
|
meterPhotoId
|
|
4068
4553
|
};
|
|
4069
|
-
|
|
4554
|
+
try {
|
|
4555
|
+
await updateMutation.mutateAsync({
|
|
4556
|
+
RequestInfo: {},
|
|
4557
|
+
updateType: "METER",
|
|
4558
|
+
kno: searchKno,
|
|
4559
|
+
...data
|
|
4560
|
+
});
|
|
4561
|
+
setToast({
|
|
4562
|
+
type: "success",
|
|
4563
|
+
message: "Meter details updated successfully!"
|
|
4564
|
+
});
|
|
4565
|
+
onSelect(config.key, data);
|
|
4566
|
+
} catch (error) {
|
|
4567
|
+
setToast({
|
|
4568
|
+
type: "error",
|
|
4569
|
+
message: "Failed to update meter details"
|
|
4570
|
+
});
|
|
4571
|
+
}
|
|
4070
4572
|
};
|
|
4573
|
+
if (isLoading) {
|
|
4574
|
+
return /*#__PURE__*/React.createElement(Loader, null);
|
|
4575
|
+
}
|
|
4071
4576
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
|
|
4072
4577
|
onSelect: onStepSelect,
|
|
4073
|
-
config: config
|
|
4578
|
+
config: config,
|
|
4579
|
+
isDisabled: !isValid()
|
|
4074
4580
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Connection Category *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
4075
4581
|
value: connectionCategory,
|
|
4076
4582
|
onChange: e => setConnectionCategory(e.target.value)
|
|
@@ -4433,6 +4939,210 @@ const Inbox$1 = ({
|
|
|
4433
4939
|
})));
|
|
4434
4940
|
};
|
|
4435
4941
|
|
|
4942
|
+
const AddressDetails = ({
|
|
4943
|
+
config,
|
|
4944
|
+
onSelect
|
|
4945
|
+
}) => {
|
|
4946
|
+
var _mdmsData$MdmsRes, _mdmsData$MdmsRes$ego, _mdmsData$MdmsRes$ego2, _mdmsData$MdmsRes$ego3, _mdmsData$MdmsRes$ego4;
|
|
4947
|
+
const {
|
|
4948
|
+
t
|
|
4949
|
+
} = useTranslation();
|
|
4950
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
4951
|
+
const [houseNo, setHouseNo] = useState("");
|
|
4952
|
+
const [street, setStreet] = useState("");
|
|
4953
|
+
const [locality, setLocality] = useState("");
|
|
4954
|
+
const [landmark, setLandmark] = useState("");
|
|
4955
|
+
const [subLocality, setSubLocality] = useState(null);
|
|
4956
|
+
const [pinCode, setPinCode] = useState("");
|
|
4957
|
+
const [assembly, setAssembly] = useState(null);
|
|
4958
|
+
const [ward, setWard] = useState(null);
|
|
4959
|
+
const [zone, setZone] = useState(null);
|
|
4960
|
+
const [latitude, setLatitude] = useState("");
|
|
4961
|
+
const [longitude, setLongitude] = useState("");
|
|
4962
|
+
const [addressType, setAddressType] = useState(null);
|
|
4963
|
+
const [doorPhoto, setDoorPhoto] = useState(null);
|
|
4964
|
+
const [doorPhotoFileStoreId, setDoorPhotoFileStoreId] = useState(null);
|
|
4965
|
+
const [toast, setToast] = useState(null);
|
|
4966
|
+
const {
|
|
4967
|
+
data: mdmsData,
|
|
4968
|
+
isLoading
|
|
4969
|
+
} = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
|
|
4970
|
+
const assemblies = (mdmsData === null || mdmsData === void 0 ? void 0 : (_mdmsData$MdmsRes = mdmsData.MdmsRes) === null || _mdmsData$MdmsRes === void 0 ? void 0 : (_mdmsData$MdmsRes$ego = _mdmsData$MdmsRes["egov-location"]) === null || _mdmsData$MdmsRes$ego === void 0 ? void 0 : (_mdmsData$MdmsRes$ego2 = _mdmsData$MdmsRes$ego.TenantBoundary) === null || _mdmsData$MdmsRes$ego2 === void 0 ? void 0 : (_mdmsData$MdmsRes$ego3 = _mdmsData$MdmsRes$ego2[0]) === null || _mdmsData$MdmsRes$ego3 === void 0 ? void 0 : (_mdmsData$MdmsRes$ego4 = _mdmsData$MdmsRes$ego3.boundary) === null || _mdmsData$MdmsRes$ego4 === void 0 ? void 0 : _mdmsData$MdmsRes$ego4.children) || [];
|
|
4971
|
+
useEffect(() => {
|
|
4972
|
+
let isMounted = true;
|
|
4973
|
+
if (navigator.geolocation) {
|
|
4974
|
+
navigator.geolocation.getCurrentPosition(pos => {
|
|
4975
|
+
if (!isMounted) return;
|
|
4976
|
+
setLatitude(pos.coords.latitude);
|
|
4977
|
+
setLongitude(pos.coords.longitude);
|
|
4978
|
+
}, () => {
|
|
4979
|
+
if (!isMounted) return;
|
|
4980
|
+
setToast({
|
|
4981
|
+
type: "error",
|
|
4982
|
+
message: "GPS access denied"
|
|
4983
|
+
});
|
|
4984
|
+
});
|
|
4985
|
+
}
|
|
4986
|
+
return () => {
|
|
4987
|
+
isMounted = false;
|
|
4988
|
+
};
|
|
4989
|
+
}, []);
|
|
4990
|
+
const handlePincodeChange = e => {
|
|
4991
|
+
const value = e.target.value;
|
|
4992
|
+
if (/^\d{0,6}$/.test(value)) {
|
|
4993
|
+
setPinCode(value);
|
|
4994
|
+
if (value.length === 6) {
|
|
4995
|
+
fetchLocationByPincode(value);
|
|
4996
|
+
}
|
|
4997
|
+
}
|
|
4998
|
+
};
|
|
4999
|
+
const fetchLocationByPincode = pin => {
|
|
5000
|
+
console.log("Fetching location for PIN:", pin);
|
|
5001
|
+
};
|
|
5002
|
+
const selectphoto = async e => {
|
|
5003
|
+
let isMounted = true;
|
|
5004
|
+
const file = e.target.files[0];
|
|
5005
|
+
if (!file) return;
|
|
5006
|
+
if (file.size >= 2000000) {
|
|
5007
|
+
setToast({
|
|
5008
|
+
type: "error",
|
|
5009
|
+
message: "Max size 2MB exceeded"
|
|
5010
|
+
});
|
|
5011
|
+
return;
|
|
5012
|
+
}
|
|
5013
|
+
try {
|
|
5014
|
+
var _res$data, _res$data$files, _res$data$files$;
|
|
5015
|
+
const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
|
|
5016
|
+
if (!isMounted) return;
|
|
5017
|
+
const fileStoreId = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$files = _res$data.files) === null || _res$data$files === void 0 ? void 0 : (_res$data$files$ = _res$data$files[0]) === null || _res$data$files$ === void 0 ? void 0 : _res$data$files$.fileStoreId;
|
|
5018
|
+
if (fileStoreId) {
|
|
5019
|
+
setDoorPhotoFileStoreId(fileStoreId);
|
|
5020
|
+
const reader = new FileReader();
|
|
5021
|
+
reader.onloadend = () => {
|
|
5022
|
+
if (!isMounted) return;
|
|
5023
|
+
setDoorPhoto(reader.result);
|
|
5024
|
+
};
|
|
5025
|
+
reader.readAsDataURL(file);
|
|
5026
|
+
setToast({
|
|
5027
|
+
type: "success",
|
|
5028
|
+
message: "Upload successful"
|
|
5029
|
+
});
|
|
5030
|
+
}
|
|
5031
|
+
} catch {
|
|
5032
|
+
if (!isMounted) return;
|
|
5033
|
+
setToast({
|
|
5034
|
+
type: "error",
|
|
5035
|
+
message: "Upload failed"
|
|
5036
|
+
});
|
|
5037
|
+
}
|
|
5038
|
+
return () => {
|
|
5039
|
+
isMounted = false;
|
|
5040
|
+
};
|
|
5041
|
+
};
|
|
5042
|
+
const removePhoto = () => {
|
|
5043
|
+
setDoorPhoto(null);
|
|
5044
|
+
setDoorPhotoFileStoreId(null);
|
|
5045
|
+
};
|
|
5046
|
+
const isValid = () => {
|
|
5047
|
+
return houseNo && street && pinCode.length === 6 && assembly && ward && zone && latitude && longitude && doorPhotoFileStoreId;
|
|
5048
|
+
};
|
|
5049
|
+
const onStepSelect = () => {
|
|
5050
|
+
if (!isValid()) {
|
|
5051
|
+
setToast({
|
|
5052
|
+
type: "error",
|
|
5053
|
+
message: "Please fill all mandatory fields"
|
|
5054
|
+
});
|
|
5055
|
+
return;
|
|
5056
|
+
}
|
|
5057
|
+
const data = {
|
|
5058
|
+
houseNo,
|
|
5059
|
+
street,
|
|
5060
|
+
locality,
|
|
5061
|
+
landmark,
|
|
5062
|
+
subLocality,
|
|
5063
|
+
pinCode,
|
|
5064
|
+
assembly: assembly === null || assembly === void 0 ? void 0 : assembly.name,
|
|
5065
|
+
ward: ward === null || ward === void 0 ? void 0 : ward.name,
|
|
5066
|
+
zone: zone === null || zone === void 0 ? void 0 : zone.name,
|
|
5067
|
+
latitude,
|
|
5068
|
+
longitude,
|
|
5069
|
+
addressType: addressType === null || addressType === void 0 ? void 0 : addressType.name,
|
|
5070
|
+
doorPhotoFilestoreId: doorPhotoFileStoreId
|
|
5071
|
+
};
|
|
5072
|
+
onSelect(config.key, data);
|
|
5073
|
+
};
|
|
5074
|
+
if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
5075
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
|
|
5076
|
+
t: t,
|
|
5077
|
+
onSelect: onStepSelect,
|
|
5078
|
+
config: config,
|
|
5079
|
+
label: t("ES_COMMON_CONTINUE")
|
|
5080
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, "House No / Flat No *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5081
|
+
value: houseNo,
|
|
5082
|
+
onChange: e => setHouseNo(e.target.value)
|
|
5083
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Street / Address Line *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5084
|
+
value: street,
|
|
5085
|
+
onChange: e => setStreet(e.target.value)
|
|
5086
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Locality"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5087
|
+
value: locality,
|
|
5088
|
+
onChange: e => setLocality(e.target.value)
|
|
5089
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Landmark"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5090
|
+
value: landmark,
|
|
5091
|
+
onChange: e => setLandmark(e.target.value)
|
|
5092
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Sub Locality"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5093
|
+
option: [],
|
|
5094
|
+
selected: subLocality,
|
|
5095
|
+
select: setSubLocality
|
|
5096
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "PIN Code *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5097
|
+
value: pinCode,
|
|
5098
|
+
onChange: handlePincodeChange,
|
|
5099
|
+
maxLength: 6
|
|
5100
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Assembly *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5101
|
+
option: assemblies,
|
|
5102
|
+
selected: assembly,
|
|
5103
|
+
select: setAssembly
|
|
5104
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Ward *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5105
|
+
option: (assembly === null || assembly === void 0 ? void 0 : assembly.children) || [],
|
|
5106
|
+
selected: ward,
|
|
5107
|
+
select: setWard
|
|
5108
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Zone *"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5109
|
+
option: (ward === null || ward === void 0 ? void 0 : ward.children) || [],
|
|
5110
|
+
selected: zone,
|
|
5111
|
+
select: setZone
|
|
5112
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Latitude"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5113
|
+
value: latitude,
|
|
5114
|
+
disabled: true
|
|
5115
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Longitude"), /*#__PURE__*/React.createElement(TextInput, {
|
|
5116
|
+
value: longitude,
|
|
5117
|
+
disabled: true
|
|
5118
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Address Type"), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5119
|
+
option: [{
|
|
5120
|
+
name: "Permanent"
|
|
5121
|
+
}, {
|
|
5122
|
+
name: "Correspondence"
|
|
5123
|
+
}, {
|
|
5124
|
+
name: "Other"
|
|
5125
|
+
}],
|
|
5126
|
+
selected: addressType,
|
|
5127
|
+
select: setAddressType
|
|
5128
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, "Door Image *"), /*#__PURE__*/React.createElement(UploadFile, {
|
|
5129
|
+
onUpload: selectphoto,
|
|
5130
|
+
onDelete: removePhoto,
|
|
5131
|
+
message: doorPhotoFileStoreId ? "Uploaded" : "No file selected"
|
|
5132
|
+
}), doorPhoto && /*#__PURE__*/React.createElement("img", {
|
|
5133
|
+
src: doorPhoto,
|
|
5134
|
+
alt: "preview",
|
|
5135
|
+
style: {
|
|
5136
|
+
width: "100%",
|
|
5137
|
+
marginTop: "10px"
|
|
5138
|
+
}
|
|
5139
|
+
}), toast && /*#__PURE__*/React.createElement(Toast, {
|
|
5140
|
+
label: toast.message,
|
|
5141
|
+
error: toast.type === "error",
|
|
5142
|
+
onClose: () => setToast(null)
|
|
5143
|
+
})));
|
|
5144
|
+
};
|
|
5145
|
+
|
|
4436
5146
|
const CitizenApp = () => {
|
|
4437
5147
|
const {
|
|
4438
5148
|
t
|
|
@@ -4458,8 +5168,8 @@ const CitizenApp = () => {
|
|
|
4458
5168
|
}, {
|
|
4459
5169
|
label: t(getBreadcrumbLabel())
|
|
4460
5170
|
}];
|
|
4461
|
-
return /*#__PURE__*/React.createElement(
|
|
4462
|
-
className: "ground-container
|
|
5171
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
5172
|
+
className: "ground-container form-container"
|
|
4463
5173
|
}, /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
4464
5174
|
leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
|
|
4465
5175
|
className: "icon"
|
|
@@ -4469,32 +5179,49 @@ const CitizenApp = () => {
|
|
|
4469
5179
|
}), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4470
5180
|
exact: true,
|
|
4471
5181
|
path: `${path}`,
|
|
4472
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5182
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5183
|
+
layoutClass: "normal"
|
|
5184
|
+
}, /*#__PURE__*/React.createElement(Home, null))
|
|
4473
5185
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4474
5186
|
path: `${path}/dashboard`,
|
|
4475
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5187
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5188
|
+
layoutClass: "normal"
|
|
5189
|
+
}, /*#__PURE__*/React.createElement(Dashboard, null))
|
|
4476
5190
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4477
5191
|
path: `${path}/inbox`,
|
|
4478
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5192
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5193
|
+
layoutClass: "normal"
|
|
5194
|
+
}, /*#__PURE__*/React.createElement(Inbox$1, null))
|
|
4479
5195
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4480
5196
|
path: `${path}/aadhaar-verification`,
|
|
4481
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5197
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5198
|
+
layoutClass: "normal"
|
|
5199
|
+
}, /*#__PURE__*/React.createElement(AadhaarVerification, null))
|
|
4482
5200
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4483
5201
|
path: `${path}/address-details`,
|
|
4484
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5202
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5203
|
+
layoutClass: "normal"
|
|
5204
|
+
}, /*#__PURE__*/React.createElement(AddressDetails, null))
|
|
4485
5205
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4486
5206
|
path: `${path}/property-info`,
|
|
4487
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5207
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5208
|
+
layoutClass: "normal"
|
|
5209
|
+
}, /*#__PURE__*/React.createElement(PropertyInfo, null))
|
|
4488
5210
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4489
5211
|
path: `${path}/meter-details`,
|
|
4490
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5212
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5213
|
+
layoutClass: "normal"
|
|
5214
|
+
}, /*#__PURE__*/React.createElement(MeterDetails, null))
|
|
4491
5215
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
4492
5216
|
path: `${path}/review`,
|
|
4493
|
-
component: () => /*#__PURE__*/React.createElement(
|
|
5217
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
5218
|
+
layoutClass: "normal"
|
|
5219
|
+
}, /*#__PURE__*/React.createElement(Review, null))
|
|
4494
5220
|
}))));
|
|
4495
5221
|
};
|
|
4496
5222
|
|
|
4497
5223
|
const EkycModule = ({
|
|
5224
|
+
stateCode,
|
|
4498
5225
|
userType,
|
|
4499
5226
|
tenants
|
|
4500
5227
|
}) => {
|
|
@@ -4502,7 +5229,27 @@ const EkycModule = ({
|
|
|
4502
5229
|
path,
|
|
4503
5230
|
url
|
|
4504
5231
|
} = useRouteMatch();
|
|
5232
|
+
const moduleCode = "EKYC";
|
|
5233
|
+
const language = Digit.StoreData.getCurrentLanguage();
|
|
5234
|
+
const {
|
|
5235
|
+
isLoading,
|
|
5236
|
+
data: store
|
|
5237
|
+
} = Digit.Services.useStore({
|
|
5238
|
+
stateCode,
|
|
5239
|
+
moduleCode,
|
|
5240
|
+
language
|
|
5241
|
+
});
|
|
4505
5242
|
Digit.SessionStorage.set("EKYC_TENANTS", tenants);
|
|
5243
|
+
useEffect(() => Digit.LocalizationService.getLocale({
|
|
5244
|
+
modules: [`rainmaker-ekyc`, `rainmaker-${Digit.ULBService.getCurrentTenantId()}`],
|
|
5245
|
+
locale: Digit.StoreData.getCurrentLanguage(),
|
|
5246
|
+
tenantId: Digit.ULBService.getCurrentTenantId()
|
|
5247
|
+
}), []);
|
|
5248
|
+
if (isLoading) {
|
|
5249
|
+
return /*#__PURE__*/React.createElement(Loader, {
|
|
5250
|
+
page: true
|
|
5251
|
+
});
|
|
5252
|
+
}
|
|
4506
5253
|
if (userType === "employee") {
|
|
4507
5254
|
return /*#__PURE__*/React.createElement(EmployeeApp, {
|
|
4508
5255
|
path: path,
|