@djb25/digit-ui-module-vendor 1.0.34 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useMemo, useCallback } from 'react';
2
2
  import { useLocation, Switch, useHistory, useParams, Link, useRouteMatch, Redirect, Route } from 'react-router-dom';
3
- import { AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, HomeIcon, PropertyHouse, EmployeeModuleCard, VerticalTimeline, FormStep, LabelFieldPair, CardLabel, CustomTooltip, TextInput, MobileNumber, Dropdown as Dropdown$3, UploadFile, Toast, Loader, Card, ActionBar, SubmitBar, RadioOrSelect, Header, SearchForm, SearchField, CardLabelError, DatePicker as DatePicker$3, Table, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ApplyFilterBar, AddIcon, Menu, LinkLabel, ViewsIcon, ToggleSwitch, Modal, MdClose, MultiSelectDropdown, CitizenHomeCard, CardSectionHeader, Row, EditIcon, DeleteIcon, CardText, FormComposer, CardHeader, CardSubHeader, StatusTable, LinkButton, Banner, InfoIcon } from '@djb25/digit-ui-react-components';
3
+ import { AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, HomeIcon, PropertyHouse, EmployeeModuleCard, VerticalTimeline, FormStep, LabelFieldPair, CardLabel, CustomTooltip, TextInput, MobileNumber, Dropdown as Dropdown$3, UploadFile, Toast, Loader, Card, ActionBar, SubmitBar, RadioOrSelect, Header, SearchForm, SearchField, CardLabelError, DatePicker as DatePicker$5, Table, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ApplyFilterBar, AddIcon, Menu, LinkLabel, ViewsIcon, ToggleSwitch, Modal, MdClose, MultiSelectDropdown, CitizenHomeCard, CardSectionHeader, Row, EditIcon, DeleteIcon, CardText, FormComposer, CardHeader, CardSubHeader, StatusTable, LinkButton, Banner, InfoIcon } from '@djb25/digit-ui-react-components';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useForm, Controller } from 'react-hook-form';
6
6
  import { useQueryClient } from 'react-query';
@@ -909,6 +909,19 @@ const checkForNotNull = (value = "") => {
909
909
  const checkForNA = (value = "") => {
910
910
  return checkForNotNull(value) ? value : "NA";
911
911
  };
912
+ const convertEpochToDate = (dateEpoch, businessService) => {
913
+ const dateFromApi = new Date(dateEpoch);
914
+ if (dateEpoch) {
915
+ let month = dateFromApi.getMonth() + 1;
916
+ let day = dateFromApi.getDate();
917
+ let year = dateFromApi.getFullYear();
918
+ month = (month > 9 ? "" : "0") + month;
919
+ day = (day > 9 ? "" : "0") + day;
920
+ if (businessService === "asset-create") return `${day}-${month}-${year}`;else return `${day}/${month}/${year}`;
921
+ } else {
922
+ return null;
923
+ }
924
+ };
912
925
  const VendorData = data => {
913
926
  var _data$vendordet, _data$vendordet2, _data$vendordet3, _data$vendordet4, _data$vendordet5, _data$vendordet6, _data$vendordet7, _data$vendordet8, _data$vendordet9, _data$vendordet0, _data$vendordet1, _data$vendordet10, _data$vendordet11, _data$vendordet12, _data$vendordet13, _data$vendordet13$Sta, _data$vendordet14, _data$vendordet14$Ven, _data$vendordet15, _data$vendordet16, _data$vendordet17, _data$vendordet17$Ven, _data$documents, _data$vendordet18, _data$vendordet19;
914
927
  const formdata = {
@@ -1304,7 +1317,7 @@ const VendorSearchApplication = ({
1304
1317
  className: "employee-card-input employee-card-input--front"
1305
1318
  }, "+91")
1306
1319
  }), /*#__PURE__*/React.createElement(CardLabelError, null, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mob = _formState$errors["mobileNumber"]) === null || _formState$errors$mob === void 0 ? void 0 : _formState$errors$mob.message)), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("VENDOR_FROM_DATE")), /*#__PURE__*/React.createElement(Controller, {
1307
- render: props => /*#__PURE__*/React.createElement(DatePicker$3, {
1320
+ render: props => /*#__PURE__*/React.createElement(DatePicker$5, {
1308
1321
  date: props.value,
1309
1322
  disabled: false,
1310
1323
  onChange: props.onChange
@@ -1312,7 +1325,7 @@ const VendorSearchApplication = ({
1312
1325
  name: "fromDate",
1313
1326
  control: control
1314
1327
  })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("VENDOR_TO_DATE")), /*#__PURE__*/React.createElement(Controller, {
1315
- render: props => /*#__PURE__*/React.createElement(DatePicker$3, {
1328
+ render: props => /*#__PURE__*/React.createElement(DatePicker$5, {
1316
1329
  date: props.value,
1317
1330
  disabled: false,
1318
1331
  onChange: props.onChange
@@ -1833,7 +1846,7 @@ const RegisteredVendorSearch = ({
1833
1846
  selectedTab,
1834
1847
  matchedRoles
1835
1848
  }) => {
1836
- var _matchedRoles$wt, _matchedRoles$wt2, _matchedRoles$ekyc, _matchedRoles$ekyc2, _matchedRoles$ekyc3, _matchedRoles$wt3, _matchedRoles$wt4, _matchedRoles$wt5, _matchedRoles$ekyc4, _matchedRoles$ekyc5, _matchedRoles$ekyc6;
1849
+ var _matchedRoles$wt, _matchedRoles$wt2, _matchedRoles$ekyc, _matchedRoles$ekyc2, _matchedRoles$ekyc3, _matchedRoles$wt3, _matchedRoles$wt4, _matchedRoles$ekyc4, _matchedRoles$ekyc5, _matchedRoles$ekyc6;
1837
1850
  const storedSearchParams = isInboxPage ? Digit.SessionStorage.get("vendor/inbox/searchParams") : Digit.SessionStorage.get("vendor/search/searchParams");
1838
1851
  const {
1839
1852
  t
@@ -1910,7 +1923,7 @@ const RegisteredVendorSearch = ({
1910
1923
  switch (input.type) {
1911
1924
  case "date":
1912
1925
  return /*#__PURE__*/React.createElement(Controller, {
1913
- render: props => /*#__PURE__*/React.createElement(DatePicker$3, {
1926
+ render: props => /*#__PURE__*/React.createElement(DatePicker$5, {
1914
1927
  date: props.value,
1915
1928
  onChange: props.onChange
1916
1929
  }),
@@ -1957,7 +1970,7 @@ const RegisteredVendorSearch = ({
1957
1970
  };
1958
1971
  const userInfo = Digit.SessionStorage.get("User");
1959
1972
  const userType = userInfo.info.type;
1960
- const vendorItems = [...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$wt = matchedRoles.wt) !== null && _matchedRoles$wt !== void 0 && _matchedRoles$wt.includes("WT_VENDOR") ? ["VENDOR"] : []), ...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$wt2 = matchedRoles.wt) !== null && _matchedRoles$wt2 !== void 0 && _matchedRoles$wt2.includes("WT_VENDOR") ? ["DRIVER", "VEHICLE"] : []), ...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$ekyc = matchedRoles.ekyc) !== null && _matchedRoles$ekyc !== void 0 && _matchedRoles$ekyc.includes("EKYC-VENDOR") ? ["SUPERVISOR"] : []), ...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$ekyc2 = matchedRoles.ekyc) !== null && _matchedRoles$ekyc2 !== void 0 && _matchedRoles$ekyc2.includes("EKYC_SUPERVISOR") || matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$ekyc3 = matchedRoles.ekyc) !== null && _matchedRoles$ekyc3 !== void 0 && _matchedRoles$ekyc3.includes("EKYC-VENDOR") ? ["SURVEYOR"] : [])];
1973
+ const vendorItems = [...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$wt = matchedRoles.wt) !== null && _matchedRoles$wt !== void 0 && _matchedRoles$wt.includes("WT_VENDOR") ? ["VENDOR"] : []), ...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$wt2 = matchedRoles.wt) !== null && _matchedRoles$wt2 !== void 0 && _matchedRoles$wt2.includes("WT_VENDOR") ? ["DRIVER", "VEHICLE"] : []), ...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$ekyc = matchedRoles.ekyc) !== null && _matchedRoles$ekyc !== void 0 && _matchedRoles$ekyc.includes("EKYC_VENDOR") ? ["SUPERVISOR"] : []), ...(matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$ekyc2 = matchedRoles.ekyc) !== null && _matchedRoles$ekyc2 !== void 0 && _matchedRoles$ekyc2.includes("EKYC_SUPERVISOR") || matchedRoles !== null && matchedRoles !== void 0 && (_matchedRoles$ekyc3 = matchedRoles.ekyc) !== null && _matchedRoles$ekyc3 !== void 0 && _matchedRoles$ekyc3.includes("EKYC_VENDOR") ? ["SURVEYOR"] : [])];
1961
1974
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1962
1975
  className: "search-container",
1963
1976
  style: {
@@ -1976,31 +1989,31 @@ const RegisteredVendorSearch = ({
1976
1989
  onClick: onClose
1977
1990
  }, /*#__PURE__*/React.createElement(CloseSvg, null))), /*#__PURE__*/React.createElement("div", {
1978
1991
  className: "search-tabs-container"
1979
- }, /*#__PURE__*/React.createElement("div", null, (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$wt3 = matchedRoles.wt) === null || _matchedRoles$wt3 === void 0 ? void 0 : _matchedRoles$wt3.includes("WT_VENDOR")) && /*#__PURE__*/React.createElement("button", {
1992
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
1980
1993
  className: selectedTab === "VENDOR" ? "search-tab-head-selected" : "search-tab-head",
1981
1994
  onClick: () => {
1982
1995
  clearSearch();
1983
1996
  onTabChange("VENDOR");
1984
1997
  }
1985
- }, t("ES_FSM_REGISTRY_INBOX_TAB_VENDOR")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$wt4 = matchedRoles.wt) === null || _matchedRoles$wt4 === void 0 ? void 0 : _matchedRoles$wt4.includes("WT_VENDOR")) && /*#__PURE__*/React.createElement("button", {
1998
+ }, t("ES_FSM_REGISTRY_INBOX_TAB_VENDOR")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$wt3 = matchedRoles.wt) === null || _matchedRoles$wt3 === void 0 ? void 0 : _matchedRoles$wt3.includes("WT_VENDOR")) && /*#__PURE__*/React.createElement("button", {
1986
1999
  className: selectedTab === "VEHICLE" ? "search-tab-head-selected" : "search-tab-head",
1987
2000
  onClick: () => {
1988
2001
  clearSearch();
1989
2002
  onTabChange("VEHICLE");
1990
2003
  }
1991
- }, t("ES_FSM_REGISTRY_INBOX_TAB_VEHICLE")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$wt5 = matchedRoles.wt) === null || _matchedRoles$wt5 === void 0 ? void 0 : _matchedRoles$wt5.includes("WT_VENDOR")) && /*#__PURE__*/React.createElement("button", {
2004
+ }, t("ES_FSM_REGISTRY_INBOX_TAB_VEHICLE")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$wt4 = matchedRoles.wt) === null || _matchedRoles$wt4 === void 0 ? void 0 : _matchedRoles$wt4.includes("WT_VENDOR")) && /*#__PURE__*/React.createElement("button", {
1992
2005
  className: selectedTab === "DRIVER" ? "search-tab-head-selected" : "search-tab-head",
1993
2006
  onClick: () => {
1994
2007
  clearSearch();
1995
2008
  onTabChange("DRIVER");
1996
2009
  }
1997
- }, t("ES_FSM_REGISTRY_INBOX_TAB_DRIVER")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc4 = matchedRoles.ekyc) === null || _matchedRoles$ekyc4 === void 0 ? void 0 : _matchedRoles$ekyc4.includes("EKYC-VENDOR")) && /*#__PURE__*/React.createElement("button", {
2010
+ }, t("ES_FSM_REGISTRY_INBOX_TAB_DRIVER")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc4 = matchedRoles.ekyc) === null || _matchedRoles$ekyc4 === void 0 ? void 0 : _matchedRoles$ekyc4.includes("EKYC_VENDOR")) && /*#__PURE__*/React.createElement("button", {
1998
2011
  className: selectedTab === "SUPERVISOR" ? "search-tab-head-selected" : "search-tab-head",
1999
2012
  onClick: () => {
2000
2013
  clearSearch();
2001
2014
  onTabChange("SUPERVISOR");
2002
2015
  }
2003
- }, t("ES_FSM_REGISTRY_INBOX_TAB_SUPERVISOR")), ((matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc5 = matchedRoles.ekyc) === null || _matchedRoles$ekyc5 === void 0 ? void 0 : _matchedRoles$ekyc5.includes("EKYC_SUPERVISOR")) || (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc6 = matchedRoles.ekyc) === null || _matchedRoles$ekyc6 === void 0 ? void 0 : _matchedRoles$ekyc6.includes("EKYC-VENDOR"))) && /*#__PURE__*/React.createElement("button", {
2016
+ }, t("ES_FSM_REGISTRY_INBOX_TAB_SUPERVISOR")), ((matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc5 = matchedRoles.ekyc) === null || _matchedRoles$ekyc5 === void 0 ? void 0 : _matchedRoles$ekyc5.includes("EKYC_SUPERVISOR")) || (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc6 = matchedRoles.ekyc) === null || _matchedRoles$ekyc6 === void 0 ? void 0 : _matchedRoles$ekyc6.includes("EKYC_VENDOR"))) && /*#__PURE__*/React.createElement("button", {
2004
2017
  className: selectedTab === "SURVEYOR" ? "search-tab-head-selected" : "search-tab-head",
2005
2018
  onClick: () => {
2006
2019
  clearSearch();
@@ -3058,14 +3071,26 @@ const VendorInbox = props => {
3058
3071
  to: `/digit-ui/${userType}/vendor/registry/${detailsPath}/` + row.original["id"]
3059
3072
  }, /*#__PURE__*/React.createElement("div", null, `${row.original.name || "N/A"}`))));
3060
3073
  }
3061
- }, {
3074
+ }, ...(props.selectedTab === "SURVEYOR" ? [{
3075
+ Header: t("ES_FSM_REGISTRY_INBOX_SUPERVISOR_NAME"),
3076
+ accessor: row => {
3077
+ var _row$reportingManager;
3078
+ return ((_row$reportingManager = row.reportingManager) === null || _row$reportingManager === void 0 ? void 0 : _row$reportingManager.name) || "NA";
3079
+ },
3080
+ Cell: ({
3081
+ row
3082
+ }) => {
3083
+ var _row$original15, _row$original15$repor;
3084
+ return /*#__PURE__*/React.createElement("div", null, ((_row$original15 = row.original) === null || _row$original15 === void 0 ? void 0 : (_row$original15$repor = _row$original15.reportingManager) === null || _row$original15$repor === void 0 ? void 0 : _row$original15$repor.name) || "NA");
3085
+ }
3086
+ }] : []), {
3062
3087
  Header: t("WT_MOBILE_NUMBER"),
3063
3088
  accessor: "mobileNumber",
3064
3089
  Cell: ({
3065
3090
  row
3066
3091
  }) => {
3067
- var _row$original15, _row$original15$owner;
3068
- return /*#__PURE__*/React.createElement("div", null, ((_row$original15 = row.original) === null || _row$original15 === void 0 ? void 0 : (_row$original15$owner = _row$original15.owner) === null || _row$original15$owner === void 0 ? void 0 : _row$original15$owner.mobileNumber) || "N/A");
3092
+ var _row$original16, _row$original16$owner;
3093
+ return /*#__PURE__*/React.createElement("div", null, ((_row$original16 = row.original) === null || _row$original16 === void 0 ? void 0 : (_row$original16$owner = _row$original16.owner) === null || _row$original16$owner === void 0 ? void 0 : _row$original16$owner.mobileNumber) || "N/A");
3069
3094
  }
3070
3095
  }, {
3071
3096
  Header: t("ES_FSM_REGISTRY_INBOX_DATE_CREATION"),
@@ -3073,11 +3098,11 @@ const VendorInbox = props => {
3073
3098
  Cell: ({
3074
3099
  row
3075
3100
  }) => {
3076
- var _row$original16, _row$original16$audit, _row$original17, _row$original17$audit;
3077
- return GetCell((_row$original16 = row.original) !== null && _row$original16 !== void 0 && (_row$original16$audit = _row$original16.auditDetails) !== null && _row$original16$audit !== void 0 && _row$original16$audit.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original17 = row.original) === null || _row$original17 === void 0 ? void 0 : (_row$original17$audit = _row$original17.auditDetails) === null || _row$original17$audit === void 0 ? void 0 : _row$original17$audit.createdTime) : "");
3101
+ var _row$original17, _row$original17$audit, _row$original18, _row$original18$audit;
3102
+ return GetCell((_row$original17 = row.original) !== null && _row$original17 !== void 0 && (_row$original17$audit = _row$original17.auditDetails) !== null && _row$original17$audit !== void 0 && _row$original17$audit.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original18 = row.original) === null || _row$original18 === void 0 ? void 0 : (_row$original18$audit = _row$original18.auditDetails) === null || _row$original18$audit === void 0 ? void 0 : _row$original18$audit.createdTime) : "");
3078
3103
  }
3079
3104
  }, {
3080
- Header: t("ES_FSM_REGISTRY_INBOX_VENDOR_NAME"),
3105
+ Header: props.selectedTab === "SUPERVISOR" ? t("ES_VENDOR_SUPERVISOR_AGENCY_NAME") : t("ES_VENDOR_SURVEYOR_AGENCY_NAME"),
3081
3106
  id: "vendorName",
3082
3107
  accessor: row => {
3083
3108
  var _row$vendorData4, _row$vendor4;
@@ -3113,13 +3138,13 @@ const VendorInbox = props => {
3113
3138
  Cell: ({
3114
3139
  row
3115
3140
  }) => {
3116
- var _row$original18;
3141
+ var _row$original19;
3117
3142
  return /*#__PURE__*/React.createElement(ToggleSwitch, {
3118
3143
  style: {
3119
3144
  display: "flex",
3120
3145
  justifyContent: "left"
3121
3146
  },
3122
- value: ((_row$original18 = row.original) === null || _row$original18 === void 0 ? void 0 : _row$original18.status) === "DISABLED" ? false : true,
3147
+ value: ((_row$original19 = row.original) === null || _row$original19 === void 0 ? void 0 : _row$original19.status) === "DISABLED" ? false : true,
3123
3148
  onChange: () => {
3124
3149
  console.log("Updating status for", props.selectedTab, row.original.id);
3125
3150
  },
@@ -3284,6 +3309,70 @@ const VendorInbox = props => {
3284
3309
  Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
3285
3310
  exportAccessor: row => (row === null || row === void 0 ? void 0 : row.status) || "NA"
3286
3311
  }];
3312
+ case "SURVEYOR":
3313
+ return [{
3314
+ Header: t("ES_FSM_REGISTRY_INBOX_USERNAME"),
3315
+ exportAccessor: row => {
3316
+ var _row$owner0;
3317
+ return (row === null || row === void 0 ? void 0 : (_row$owner0 = row.owner) === null || _row$owner0 === void 0 ? void 0 : _row$owner0.userName) || "NA";
3318
+ }
3319
+ }, {
3320
+ Header: t("ES_FSM_REGISTRY_INBOX_DRIVER_NAME"),
3321
+ exportAccessor: row => {
3322
+ var _row$owner1;
3323
+ return `${(row === null || row === void 0 ? void 0 : row.name) || "NA"} (${(row === null || row === void 0 ? void 0 : (_row$owner1 = row.owner) === null || _row$owner1 === void 0 ? void 0 : _row$owner1.mobileNumber) || "NA"})`;
3324
+ }
3325
+ }, {
3326
+ Header: t("ES_FSM_REGISTRY_INBOX_SUPERVISOR_NAME"),
3327
+ exportAccessor: row => {
3328
+ var _row$reportingManager2;
3329
+ return (row === null || row === void 0 ? void 0 : (_row$reportingManager2 = row.reportingManager) === null || _row$reportingManager2 === void 0 ? void 0 : _row$reportingManager2.name) || "NA";
3330
+ }
3331
+ }, {
3332
+ Header: t("ES_FSM_REGISTRY_INBOX_DATE_DRIVER_CREATION"),
3333
+ exportAccessor: row => {
3334
+ var _row$auditDetails1, _row$auditDetails10;
3335
+ return row !== null && row !== void 0 && (_row$auditDetails1 = row.auditDetails) !== null && _row$auditDetails1 !== void 0 && _row$auditDetails1.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails10 = row.auditDetails) === null || _row$auditDetails10 === void 0 ? void 0 : _row$auditDetails10.createdTime) : "";
3336
+ }
3337
+ }, {
3338
+ Header: t("ES_VENDOR_SURVEYOR_AGENCY_NAME"),
3339
+ exportAccessor: row => {
3340
+ var _row$vendorData15, _row$vendor15, _row$vendorData16, _row$vendorData17, _row$vendorData17$own, _row$vendor16, _row$vendor17, _row$vendor17$owner;
3341
+ return `${(row === null || row === void 0 ? void 0 : (_row$vendorData15 = row.vendorData) === null || _row$vendorData15 === void 0 ? void 0 : _row$vendorData15.name) || (row === null || row === void 0 ? void 0 : (_row$vendor15 = row.vendor) === null || _row$vendor15 === void 0 ? void 0 : _row$vendor15.name) || "NA"} ${(row === null || row === void 0 ? void 0 : (_row$vendorData16 = row.vendorData) === null || _row$vendorData16 === void 0 ? void 0 : _row$vendorData16.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendorData17 = row.vendorData) === null || _row$vendorData17 === void 0 ? void 0 : (_row$vendorData17$own = _row$vendorData17.owner) === null || _row$vendorData17$own === void 0 ? void 0 : _row$vendorData17$own.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendor16 = row.vendor) === null || _row$vendor16 === void 0 ? void 0 : _row$vendor16.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendor17 = row.vendor) === null || _row$vendor17 === void 0 ? void 0 : (_row$vendor17$owner = _row$vendor17.owner) === null || _row$vendor17$owner === void 0 ? void 0 : _row$vendor17$owner.mobileNumber) || "NA"}`;
3342
+ }
3343
+ }, {
3344
+ Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
3345
+ exportAccessor: row => (row === null || row === void 0 ? void 0 : row.status) || "NA"
3346
+ }];
3347
+ case "SUPERVISOR":
3348
+ return [{
3349
+ Header: t("ES_FSM_REGISTRY_INBOX_USERNAME"),
3350
+ exportAccessor: row => {
3351
+ var _row$owner10;
3352
+ return (row === null || row === void 0 ? void 0 : (_row$owner10 = row.owner) === null || _row$owner10 === void 0 ? void 0 : _row$owner10.userName) || "NA";
3353
+ }
3354
+ }, {
3355
+ Header: t("ES_FSM_REGISTRY_INBOX_DRIVER_NAME"),
3356
+ exportAccessor: row => {
3357
+ var _row$owner11;
3358
+ return `${(row === null || row === void 0 ? void 0 : row.name) || "NA"} (${(row === null || row === void 0 ? void 0 : (_row$owner11 = row.owner) === null || _row$owner11 === void 0 ? void 0 : _row$owner11.mobileNumber) || "NA"})`;
3359
+ }
3360
+ }, {
3361
+ Header: t("ES_FSM_REGISTRY_INBOX_DATE_DRIVER_CREATION"),
3362
+ exportAccessor: row => {
3363
+ var _row$auditDetails11, _row$auditDetails12;
3364
+ return row !== null && row !== void 0 && (_row$auditDetails11 = row.auditDetails) !== null && _row$auditDetails11 !== void 0 && _row$auditDetails11.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails12 = row.auditDetails) === null || _row$auditDetails12 === void 0 ? void 0 : _row$auditDetails12.createdTime) : "";
3365
+ }
3366
+ }, {
3367
+ Header: t("ES_VENDOR_SUPERVISOR_AGENCY_NAME"),
3368
+ exportAccessor: row => {
3369
+ var _row$vendorData18, _row$vendor18, _row$vendorData19, _row$vendorData20, _row$vendorData20$own, _row$vendor19, _row$vendor20, _row$vendor20$owner;
3370
+ return `${(row === null || row === void 0 ? void 0 : (_row$vendorData18 = row.vendorData) === null || _row$vendorData18 === void 0 ? void 0 : _row$vendorData18.name) || (row === null || row === void 0 ? void 0 : (_row$vendor18 = row.vendor) === null || _row$vendor18 === void 0 ? void 0 : _row$vendor18.name) || "NA"} ${(row === null || row === void 0 ? void 0 : (_row$vendorData19 = row.vendorData) === null || _row$vendorData19 === void 0 ? void 0 : _row$vendorData19.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendorData20 = row.vendorData) === null || _row$vendorData20 === void 0 ? void 0 : (_row$vendorData20$own = _row$vendorData20.owner) === null || _row$vendorData20$own === void 0 ? void 0 : _row$vendorData20$own.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendor19 = row.vendor) === null || _row$vendor19 === void 0 ? void 0 : _row$vendor19.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendor20 = row.vendor) === null || _row$vendor20 === void 0 ? void 0 : (_row$vendor20$owner = _row$vendor20.owner) === null || _row$vendor20$owner === void 0 ? void 0 : _row$vendor20$owner.mobileNumber) || "NA"}`;
3371
+ }
3372
+ }, {
3373
+ Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
3374
+ exportAccessor: row => (row === null || row === void 0 ? void 0 : row.status) || "NA"
3375
+ }];
3287
3376
  default:
3288
3377
  return [];
3289
3378
  }
@@ -3365,7 +3454,7 @@ const VendorInbox = props => {
3365
3454
  });
3366
3455
  }
3367
3456
  const ekycRoles = {
3368
- ekycVendor: "EKYC-VENDOR",
3457
+ ekycVendor: "EKYC_VENDOR",
3369
3458
  supervisor: "EKYC_SUPERVISOR"
3370
3459
  };
3371
3460
  const wtRoles = {
@@ -3378,7 +3467,7 @@ const VendorInbox = props => {
3378
3467
  ekyc: matchedEkycRoles,
3379
3468
  wt: matchedWtRoles
3380
3469
  };
3381
- matchedRoles.ekyc.push("EKYC-VENDOR");
3470
+ console.log(matchedRoles);
3382
3471
  return /*#__PURE__*/React.createElement("div", {
3383
3472
  className: "inbox-container"
3384
3473
  }, props.userRole !== "FSM_EMP_FSTPO" && props.userRole !== "FSM_ADMIN" && !props.isSearch && /*#__PURE__*/React.createElement("div", {
@@ -3671,6 +3760,9 @@ const SearchVendor = () => {
3671
3760
  },
3672
3761
  vendorData: {
3673
3762
  name: "Clean City Agency"
3763
+ },
3764
+ reportingManager: {
3765
+ name: "Amit Kumar"
3674
3766
  }
3675
3767
  }, {
3676
3768
  id: "SUR2",
@@ -3686,6 +3778,9 @@ const SearchVendor = () => {
3686
3778
  },
3687
3779
  vendorData: {
3688
3780
  name: "Green Environment"
3781
+ },
3782
+ reportingManager: {
3783
+ name: "Rajesh Singh"
3689
3784
  }
3690
3785
  }];
3691
3786
  setTableData((dsoData === null || dsoData === void 0 ? void 0 : dsoData.surveyor) || staticSurveyors);
@@ -4165,18 +4260,84 @@ const SupervisorAreaAssignment = ({
4165
4260
  isLoading
4166
4261
  } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
4167
4262
  useEffect(() => {
4263
+ console.log("Boundary Data State:", {
4264
+ boundaryData,
4265
+ isLoading
4266
+ });
4168
4267
  if (boundaryData) {
4169
- var _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3, _boundaryData$MdmsRes4;
4170
- const tenantBoundary = boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : (_boundaryData$MdmsRes4 = _boundaryData$MdmsRes3[0]) === null || _boundaryData$MdmsRes4 === void 0 ? void 0 : _boundaryData$MdmsRes4.boundary;
4171
- if (tenantBoundary && tenantBoundary.children) {
4172
- setZones(tenantBoundary.children);
4173
- }
4268
+ var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
4269
+ const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
4270
+ const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
4271
+ if (Array.isArray(boundaries) && boundaries.length > 0) {
4272
+ setZones(boundaries);
4273
+ } else if (!isLoading) {
4274
+ setZones([{
4275
+ code: "ZONE-01",
4276
+ name: "ZONE-01",
4277
+ children: [{
4278
+ code: "CLUSTER-01",
4279
+ name: "CLUSTER-01",
4280
+ children: [{
4281
+ code: "WARD-01",
4282
+ name: "WARD-01",
4283
+ children: [{
4284
+ code: "AREA-01",
4285
+ name: "AREA-01"
4286
+ }, {
4287
+ code: "AREA-02",
4288
+ name: "AREA-02"
4289
+ }]
4290
+ }]
4291
+ }]
4292
+ }, {
4293
+ code: "ZONE-02",
4294
+ name: "ZONE-02"
4295
+ }]);
4296
+ }
4297
+ } else if (!isLoading) {
4298
+ setZones([{
4299
+ code: "ZONE-01",
4300
+ name: "ZONE-01",
4301
+ children: [{
4302
+ code: "CLUSTER-01",
4303
+ name: "CLUSTER-01",
4304
+ children: [{
4305
+ code: "WARD-01",
4306
+ name: "WARD-01",
4307
+ children: [{
4308
+ code: "AREA-01",
4309
+ name: "AREA-01"
4310
+ }, {
4311
+ code: "AREA-02",
4312
+ name: "AREA-02"
4313
+ }]
4314
+ }]
4315
+ }]
4316
+ }, {
4317
+ code: "ZONE-02",
4318
+ name: "ZONE-02"
4319
+ }]);
4174
4320
  }
4175
- }, [boundaryData]);
4321
+ }, [boundaryData, isLoading]);
4176
4322
  useEffect(() => {
4177
4323
  if (selectedZone) {
4178
4324
  var _formData$areaAssignm5, _formData$areaAssignm6;
4179
- setClusters(selectedZone.children || []);
4325
+ const children = selectedZone.children || selectedZone.boundary || [];
4326
+ setClusters(children.length > 0 ? children : [{
4327
+ code: "CLUSTER-01",
4328
+ name: "CLUSTER-01",
4329
+ children: [{
4330
+ code: "WARD-01",
4331
+ name: "WARD-01",
4332
+ children: [{
4333
+ code: "AREA-01",
4334
+ name: "AREA-01"
4335
+ }, {
4336
+ code: "AREA-02",
4337
+ name: "AREA-02"
4338
+ }]
4339
+ }]
4340
+ }]);
4180
4341
  if (selectedZone.code !== (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm5 = formData.areaAssignment) === null || _formData$areaAssignm5 === void 0 ? void 0 : (_formData$areaAssignm6 = _formData$areaAssignm5.zone) === null || _formData$areaAssignm6 === void 0 ? void 0 : _formData$areaAssignm6.code)) {
4181
4342
  setSelectedCluster(null);
4182
4343
  setSelectedWard(null);
@@ -4189,7 +4350,18 @@ const SupervisorAreaAssignment = ({
4189
4350
  useEffect(() => {
4190
4351
  if (selectedCluster) {
4191
4352
  var _formData$areaAssignm7, _formData$areaAssignm8;
4192
- setWards(selectedCluster.children || []);
4353
+ const children = selectedCluster.children || selectedCluster.boundary || [];
4354
+ setWards(children.length > 0 ? children : [{
4355
+ code: "WARD-01",
4356
+ name: "WARD-01",
4357
+ children: [{
4358
+ code: "AREA-01",
4359
+ name: "AREA-01"
4360
+ }, {
4361
+ code: "AREA-02",
4362
+ name: "AREA-02"
4363
+ }]
4364
+ }]);
4193
4365
  if (selectedCluster.code !== (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm7 = formData.areaAssignment) === null || _formData$areaAssignm7 === void 0 ? void 0 : (_formData$areaAssignm8 = _formData$areaAssignm7.cluster) === null || _formData$areaAssignm8 === void 0 ? void 0 : _formData$areaAssignm8.code)) {
4194
4366
  setSelectedWard(null);
4195
4367
  setSelectedAreas([]);
@@ -4201,7 +4373,14 @@ const SupervisorAreaAssignment = ({
4201
4373
  useEffect(() => {
4202
4374
  if (selectedWard) {
4203
4375
  var _formData$areaAssignm9, _formData$areaAssignm0;
4204
- setAreas(selectedWard.children || []);
4376
+ const children = selectedWard.children || selectedWard.localities || selectedWard.boundary || [];
4377
+ setAreas(children.length > 0 ? children : [{
4378
+ code: "AREA-01",
4379
+ name: "AREA-01"
4380
+ }, {
4381
+ code: "AREA-02",
4382
+ name: "AREA-02"
4383
+ }]);
4205
4384
  if (selectedWard.code !== (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm9 = formData.areaAssignment) === null || _formData$areaAssignm9 === void 0 ? void 0 : (_formData$areaAssignm0 = _formData$areaAssignm9.ward) === null || _formData$areaAssignm0 === void 0 ? void 0 : _formData$areaAssignm0.code)) {
4206
4385
  setSelectedAreas([]);
4207
4386
  }
@@ -4491,7 +4670,7 @@ const CitizenVendorApp = () => {
4491
4670
  })))
4492
4671
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
4493
4672
  path: `${path}`,
4494
- component: () => Digit.UserService.hasAccess(["WT_VENDOR"]) ? /*#__PURE__*/React.createElement("div", {
4673
+ component: () => Digit.UserService.hasAccess(["WT_VENDOR", "EKYC_VENDOR"]) ? /*#__PURE__*/React.createElement("div", {
4495
4674
  style: {
4496
4675
  display: "flex",
4497
4676
  gap: "24px",
@@ -4976,7 +5155,9 @@ const {
4976
5155
  DatePicker,
4977
5156
  Dropdown
4978
5157
  } = require("@djb25/digit-ui-react-components");
4979
- const VendorConfig = (t, disabled = false) => {
5158
+ const VendorConfig = (t, disabled = false, formData = {}) => {
5159
+ var _formData$serviceType;
5160
+ const isEkyc = (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) === "EKYC";
4980
5161
  return [{
4981
5162
  head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
4982
5163
  body: [{
@@ -5048,7 +5229,130 @@ const VendorConfig = (t, disabled = false) => {
5048
5229
  header: "CS_COMMON_CHOOSE_SERVICE_TYPE",
5049
5230
  submitBarLabel: "CS_COMMON_NEXT"
5050
5231
  }
5051
- }]
5232
+ }, ...(isEkyc ? [{
5233
+ label: "ES_VENDOR_CONTRACT_START_DATE",
5234
+ isMandatory: true,
5235
+ type: "custom",
5236
+ key: "contractStartDate",
5237
+ populators: {
5238
+ name: "contractStartDate",
5239
+ validation: {
5240
+ required: true
5241
+ },
5242
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5243
+ onChange: props.onChange,
5244
+ date: props.value
5245
+ }, customProps))
5246
+ }
5247
+ }, {
5248
+ label: "ES_VENDOR_CONTRACT_END_DATE",
5249
+ isMandatory: true,
5250
+ type: "custom",
5251
+ key: "contractEndDate",
5252
+ populators: {
5253
+ name: "contractEndDate",
5254
+ validation: {
5255
+ required: true
5256
+ },
5257
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5258
+ onChange: props.onChange,
5259
+ date: props.value
5260
+ }, customProps))
5261
+ }
5262
+ }, {
5263
+ label: "ES_VENDOR_ZONE",
5264
+ isMandatory: true,
5265
+ type: "component",
5266
+ key: "zoneIds",
5267
+ component: "SelectEkycZones"
5268
+ }, {
5269
+ label: "ES_VENDOR_CLUSTER",
5270
+ isMandatory: true,
5271
+ type: "component",
5272
+ key: "clusterIds",
5273
+ component: "SelectEkycClusters"
5274
+ }, {
5275
+ label: "ES_FSM_REGISTRY_NEW_OWNER_NAME",
5276
+ isMandatory: true,
5277
+ type: "text",
5278
+ populators: {
5279
+ name: "ownerName",
5280
+ validation: {
5281
+ required: true,
5282
+ pattern: /^[A-Za-z\s.,/]+$/
5283
+ },
5284
+ error: t("FSM_REGISTRY_INVALID_NAME"),
5285
+ className: "payment-form-text-input-correction"
5286
+ }
5287
+ }, {
5288
+ label: "ES_FSM_REGISTRY_NEW_FATHER_NAME",
5289
+ isMandatory: true,
5290
+ type: "text",
5291
+ populators: {
5292
+ name: "fatherOrHusbandName",
5293
+ validation: {
5294
+ required: true
5295
+ },
5296
+ className: "payment-form-text-input-correction"
5297
+ }
5298
+ }, {
5299
+ label: "ES_FSM_REGISTRY_NEW_GENDER",
5300
+ isMandatory: true,
5301
+ type: "component",
5302
+ key: "gender",
5303
+ component: "SelectEkycDropdown",
5304
+ populators: {
5305
+ name: "gender",
5306
+ options: [{
5307
+ code: "MALE",
5308
+ name: "ES_COMMON_GENDER_MALE"
5309
+ }, {
5310
+ code: "FEMALE",
5311
+ name: "ES_COMMON_GENDER_FEMALE"
5312
+ }, {
5313
+ code: "OTHER",
5314
+ name: "ES_COMMON_GENDER_OTHER"
5315
+ }],
5316
+ optionsKey: "name"
5317
+ }
5318
+ }, {
5319
+ label: "ES_FSM_REGISTRY_NEW_DOB",
5320
+ isMandatory: true,
5321
+ type: "custom",
5322
+ key: "dob",
5323
+ populators: {
5324
+ name: "dob",
5325
+ validation: {
5326
+ required: true
5327
+ },
5328
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5329
+ onChange: props.onChange,
5330
+ date: props.value
5331
+ }, customProps, {
5332
+ max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
5333
+ }))
5334
+ }
5335
+ }, {
5336
+ label: "ES_FSM_REGISTRY_NEW_RELATIONSHIP",
5337
+ isMandatory: true,
5338
+ type: "component",
5339
+ key: "relationship",
5340
+ component: "SelectEkycDropdown",
5341
+ populators: {
5342
+ name: "relationship",
5343
+ options: [{
5344
+ code: "FATHER",
5345
+ name: "ES_COMMON_RELATION_FATHER"
5346
+ }, {
5347
+ code: "HUSBAND",
5348
+ name: "ES_COMMON_RELATION_HUSBAND"
5349
+ }, {
5350
+ code: "OTHER",
5351
+ name: "ES_COMMON_RELATION_OTHER"
5352
+ }],
5353
+ optionsKey: "name"
5354
+ }
5355
+ }] : [])]
5052
5356
  }, {
5053
5357
  head: "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS",
5054
5358
  body: [{
@@ -5157,7 +5461,6 @@ const AddVendor = ({
5157
5461
  clearSuccessData();
5158
5462
  clearError();
5159
5463
  }, []);
5160
- const Config = VendorConfig(t);
5161
5464
  const defaultValues = {
5162
5465
  serviceType: {
5163
5466
  code: "WT",
@@ -5170,11 +5473,22 @@ const AddVendor = ({
5170
5473
  amount: null
5171
5474
  }
5172
5475
  };
5173
- const onFormValueChange = (setValue, formData) => {
5174
- var _formData$serviceType, _formData$address, _formData$address2;
5175
- const isVendorDetailsFilled = (formData === null || formData === void 0 ? void 0 : formData.vendorName) && (formData === null || formData === void 0 ? void 0 : formData.phone) && (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code);
5176
- const isAddressFilled = (formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : _formData$address.city) && (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : _formData$address2.locality);
5177
- if (isVendorDetailsFilled && isAddressFilled) {
5476
+ const [formData, setFormData] = useState(defaultValues);
5477
+ const Config = VendorConfig(t, false, formData);
5478
+ const onFormValueChange = (setValue, data) => {
5479
+ var _data$serviceType, _formData$serviceType, _data$serviceType2, _data$serviceType3, _data$address, _data$address2;
5480
+ if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) || JSON.stringify(data === null || data === void 0 ? void 0 : data.zoneIds) !== JSON.stringify(formData === null || formData === void 0 ? void 0 : formData.zoneIds)) {
5481
+ setFormData(data);
5482
+ }
5483
+ const isEkyc = (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code) === "EKYC";
5484
+ const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType3 = data.serviceType) === null || _data$serviceType3 === void 0 ? void 0 : _data$serviceType3.code);
5485
+ const isAddressFilled = (data === null || data === void 0 ? void 0 : (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.city) && (data === null || data === void 0 ? void 0 : (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.locality);
5486
+ let isEkycFieldsFilled = true;
5487
+ if (isEkyc) {
5488
+ var _data$zoneIds, _data$clusterIds;
5489
+ isEkycFieldsFilled = (data === null || data === void 0 ? void 0 : data.ownerName) && (data === null || data === void 0 ? void 0 : data.contractStartDate) && (data === null || data === void 0 ? void 0 : data.contractEndDate) && (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.length) > 0 && (data === null || data === void 0 ? void 0 : (_data$clusterIds = data.clusterIds) === null || _data$clusterIds === void 0 ? void 0 : _data$clusterIds.length) > 0 && (data === null || data === void 0 ? void 0 : data.fatherOrHusbandName) && (data === null || data === void 0 ? void 0 : data.gender) && (data === null || data === void 0 ? void 0 : data.dob) && (data === null || data === void 0 ? void 0 : data.relationship);
5490
+ }
5491
+ if (isVendorDetailsFilled && isAddressFilled && isEkycFieldsFilled) {
5178
5492
  setCanSubmit(true);
5179
5493
  } else {
5180
5494
  setCanSubmit(false);
@@ -5213,7 +5527,7 @@ const AddVendor = ({
5213
5527
  setShowToast(null);
5214
5528
  };
5215
5529
  const onSubmit = data => {
5216
- var _mergedData$street, _mergedData$doorNo, _mergedData$plotNo, _mergedData$landmark, _mergedData$address, _mergedData$address$c, _mergedData$address2, _mergedData$address2$, _mergedData$address3, _mergedData$address3$, _mergedData$address4, _mergedData$address4$, _mergedData$buildingN, _mergedData$address5, _mergedData$address5$, _mergedData$address6, _mergedData$address6$, _mergedData$address7, _mergedData$address7$, _mergedData$serviceTy, _mergedData$address8, _mergedData$address9;
5530
+ var _mergedData$street, _mergedData$doorNo, _mergedData$plotNo, _mergedData$landmark, _mergedData$address, _mergedData$address$c, _mergedData$address2, _mergedData$address2$, _mergedData$address3, _mergedData$address3$, _mergedData$address4, _mergedData$address4$, _mergedData$buildingN, _mergedData$address5, _mergedData$address5$, _mergedData$address6, _mergedData$address6$, _mergedData$address7, _mergedData$address7$, _mergedData$serviceTy, _mergedData$address8, _mergedData$address9, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy2;
5217
5531
  const mergedData = data;
5218
5532
  const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
5219
5533
  const pincode = mergedData === null || mergedData === void 0 ? void 0 : mergedData.pincode;
@@ -5229,59 +5543,75 @@ const AddVendor = ({
5229
5543
  const localityCode = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address5 = mergedData.address) === null || _mergedData$address5 === void 0 ? void 0 : (_mergedData$address5$ = _mergedData$address5.locality) === null || _mergedData$address5$ === void 0 ? void 0 : _mergedData$address5$.code;
5230
5544
  const localityName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address6 = mergedData.address) === null || _mergedData$address6 === void 0 ? void 0 : (_mergedData$address6$ = _mergedData$address6.locality) === null || _mergedData$address6$ === void 0 ? void 0 : _mergedData$address6$.name;
5231
5545
  const localityArea = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address7 = mergedData.address) === null || _mergedData$address7 === void 0 ? void 0 : (_mergedData$address7$ = _mergedData$address7.locality) === null || _mergedData$address7$ === void 0 ? void 0 : _mergedData$address7$.area;
5232
- const gender = "MALE";
5233
5546
  const emailId = mergedData === null || mergedData === void 0 ? void 0 : mergedData.emailId;
5234
5547
  const phone = mergedData === null || mergedData === void 0 ? void 0 : mergedData.phone;
5235
- const additionalDetails = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code;
5236
- const formData = {
5237
- vendor: {
5548
+ const isEkyc = (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code) === "EKYC";
5549
+ let vendorData = {
5550
+ tenantId: tenantId,
5551
+ name,
5552
+ agencyType: "ULB",
5553
+ paymentPreference: "post-service",
5554
+ address: {
5238
5555
  tenantId: tenantId,
5239
- name,
5240
- agencyType: "ULB",
5241
- paymentPreference: "post-service",
5242
- address: {
5243
- tenantId: tenantId,
5244
- landmark,
5245
- doorNo,
5246
- plotNo,
5247
- street,
5248
- city,
5249
- district,
5250
- region,
5251
- state,
5252
- country: "in",
5253
- pincode,
5254
- buildingName,
5255
- locality: {
5256
- code: localityCode || "",
5257
- name: localityName || "",
5258
- label: "Locality",
5259
- area: localityArea || ""
5260
- },
5261
- geoLocation: {
5262
- latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 0,
5263
- longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 0
5264
- }
5265
- },
5266
- owner: {
5267
- tenantId: stateId,
5268
- name: name,
5269
- fatherOrHusbandName: name,
5270
- relationship: "OTHER",
5271
- gender: gender,
5272
- dob: "915148800",
5273
- emailId: emailId || "abc@egov.com",
5274
- mobileNumber: phone
5275
- },
5276
- additionalDetails: {
5277
- serviceType: additionalDetails
5556
+ landmark,
5557
+ doorNo,
5558
+ plotNo,
5559
+ street,
5560
+ city,
5561
+ district,
5562
+ region,
5563
+ state,
5564
+ country: "india",
5565
+ pincode,
5566
+ buildingName,
5567
+ locality: {
5568
+ code: localityCode || "",
5569
+ name: localityName || "",
5570
+ label: "Locality",
5571
+ area: localityArea || ""
5278
5572
  },
5279
- vehicle: [],
5280
- drivers: [],
5281
- source: "WhatsApp"
5282
- }
5573
+ geoLocation: {
5574
+ latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 28.6139,
5575
+ longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 77.2090
5576
+ }
5577
+ },
5578
+ owner: {
5579
+ tenantId: "dl",
5580
+ name: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.ownerName) || name,
5581
+ fatherOrHusbandName: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.fatherOrHusbandName) || name,
5582
+ relationship: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$relations = mergedData.relationship) === null || _mergedData$relations === void 0 ? void 0 : _mergedData$relations.code) || "OTHER",
5583
+ gender: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$gender = mergedData.gender) === null || _mergedData$gender === void 0 ? void 0 : _mergedData$gender.code) || "MALE",
5584
+ dob: mergedData !== null && mergedData !== void 0 && mergedData.dob ? (new Date(mergedData.dob).getTime() / 1000).toString() : "915148800",
5585
+ emailId: emailId || "",
5586
+ mobileNumber: phone
5587
+ },
5588
+ additionalDetails: {
5589
+ serviceType: isEkyc ? "ekyc" : mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy2 = mergedData.serviceType) === null || _mergedData$serviceTy2 === void 0 ? void 0 : _mergedData$serviceTy2.code
5590
+ },
5591
+ vehicles: [],
5592
+ drivers: [],
5593
+ source: isEkyc ? "eKYC Portal" : "WhatsApp"
5283
5594
  };
5284
- mutate(formData, {
5595
+ if (isEkyc) {
5596
+ var _mergedData$zoneIds, _mergedData$clusterId;
5597
+ vendorData = {
5598
+ ...vendorData,
5599
+ zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => z.code)) || [],
5600
+ clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => c.code)) || [],
5601
+ contractStartDate: mergedData.contractStartDate ? new Date(mergedData.contractStartDate).getTime() : null,
5602
+ contractEndDate: mergedData.contractEndDate ? new Date(mergedData.contractEndDate).getTime() : null
5603
+ };
5604
+ }
5605
+ const payload = {
5606
+ vendor: vendorData
5607
+ };
5608
+ if (isEkyc) {
5609
+ payload.RequestInfo = {
5610
+ apiId: "Rainmaker",
5611
+ msgId: "ekyc-vendor-create"
5612
+ };
5613
+ }
5614
+ mutate(payload, {
5285
5615
  onError: error => {
5286
5616
  setShowToast({
5287
5617
  key: "error",
@@ -5344,13 +5674,14 @@ const AddVendor = ({
5344
5674
  };
5345
5675
 
5346
5676
  const {
5347
- Dropdown: Dropdown$1
5677
+ Dropdown: Dropdown$1,
5678
+ DatePicker: DatePicker$1
5348
5679
  } = require("@djb25/digit-ui-react-components");
5349
5680
  const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = false) => {
5350
5681
  return [{
5351
- head: "ES_VENDOR_SUPERVISOR_BASIC_DETAILS",
5682
+ head: t("ES_VENDOR_SUPERVISOR_BASIC_DETAILS"),
5352
5683
  body: [{
5353
- label: "ES_VENDOR_SUPERVISOR_FULL_NAME",
5684
+ label: t("ES_VENDOR_SUPERVISOR_FULL_NAME"),
5354
5685
  isMandatory: true,
5355
5686
  type: "text",
5356
5687
  disable: disabled,
@@ -5368,7 +5699,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5368
5699
  className: "payment-form-text-input-correction"
5369
5700
  }
5370
5701
  }, {
5371
- label: "ES_VENDOR_SUPERVISOR_MOBILE_NUMBER",
5702
+ label: t("ES_VENDOR_SUPERVISOR_MOBILE_NUMBER"),
5372
5703
  isMandatory: true,
5373
5704
  type: "mobileNumber",
5374
5705
  disable: disabled,
@@ -5383,7 +5714,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5383
5714
  className: "payment-form-text-input-correction"
5384
5715
  }
5385
5716
  }, {
5386
- label: "ES_VENDOR_SUPERVISOR_EMAIL_ID",
5717
+ label: t("ES_VENDOR_SUPERVISOR_EMAIL_ID"),
5387
5718
  isMandatory: true,
5388
5719
  type: "text",
5389
5720
  populators: {
@@ -5397,7 +5728,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5397
5728
  className: "payment-form-text-input-correction"
5398
5729
  }
5399
5730
  }, {
5400
- label: "ES_VENDOR_SUPERVISOR_EMPLOYEE_ID",
5731
+ label: t("ES_VENDOR_SUPERVISOR_EMPLOYEE_ID"),
5401
5732
  isMandatory: true,
5402
5733
  type: "text",
5403
5734
  populators: {
@@ -5409,80 +5740,77 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5409
5740
  className: "payment-form-text-input-correction"
5410
5741
  }
5411
5742
  }, {
5412
- label: "ES_VENDOR_SUPERVISOR_GENDER",
5413
- isMandatory: false,
5743
+ label: t("ES_VENDOR_SUPERVISOR_GENDER"),
5744
+ isMandatory: true,
5414
5745
  type: "component",
5415
5746
  key: "gender",
5416
- component: "SelectGender",
5417
- texts: {
5418
- headerCaption: "",
5419
- header: "CS_COMMON_CHOOSE_GENDER",
5420
- cardText: "CS_COMMON_SELECT_GENDER",
5421
- submitBarLabel: "CS_COMMON_NEXT",
5422
- skipText: "CORE_COMMON_SKIP_CONTINUE"
5747
+ component: "SelectGender"
5748
+ }, {
5749
+ label: t("ES_FSM_REGISTRY_NEW_FATHER_NAME"),
5750
+ isMandatory: true,
5751
+ type: "text",
5752
+ populators: {
5753
+ name: "fatherOrHusbandName",
5754
+ validation: {
5755
+ required: true
5756
+ },
5757
+ className: "payment-form-text-input-correction"
5423
5758
  }
5424
- }]
5425
- }, {
5426
- head: "ES_VENDOR_SUPERVISOR_ROLE_ACCESS",
5427
- body: [{
5428
- label: "ES_VENDOR_SUPERVISOR_ROLE",
5759
+ }, {
5760
+ label: t("ES_FSM_REGISTRY_NEW_RELATIONSHIP"),
5429
5761
  isMandatory: true,
5430
- type: "custom",
5762
+ type: "component",
5763
+ key: "relationship",
5764
+ component: "SelectEkycDropdown",
5431
5765
  populators: {
5432
- name: "role",
5433
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown$1, {
5434
- option: [{
5435
- code: "SUPERVISOR",
5436
- name: "Supervisor"
5437
- }],
5438
- optionKey: "name",
5439
- select: props.onChange,
5440
- selected: props.value,
5441
- t: t,
5442
- disable: true
5443
- }),
5444
- defaultValue: {
5445
- code: "SUPERVISOR",
5446
- name: "Supervisor"
5447
- }
5766
+ name: "relationship",
5767
+ options: [{
5768
+ code: "FATHER",
5769
+ name: "ES_COMMON_RELATION_FATHER"
5770
+ }, {
5771
+ code: "HUSBAND",
5772
+ name: "ES_COMMON_RELATION_HUSBAND"
5773
+ }, {
5774
+ code: "OTHER",
5775
+ name: "ES_COMMON_RELATION_OTHER"
5776
+ }],
5777
+ optionsKey: "name"
5448
5778
  }
5449
5779
  }, {
5450
- label: "ES_VENDOR_SUPERVISOR_AGENCY_NAME",
5780
+ label: t("ES_FSM_REGISTRY_NEW_DOB"),
5451
5781
  isMandatory: true,
5452
5782
  type: "custom",
5783
+ key: "dob",
5784
+ populators: {
5785
+ name: "dob",
5786
+ validation: {
5787
+ required: true
5788
+ },
5789
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, Object.assign({
5790
+ onChange: props.onChange,
5791
+ date: props.value
5792
+ }, customProps))
5793
+ }
5794
+ }, {
5795
+ label: t("ES_FSM_REGISTRY_NEW_CORRESPONDENCE_ADDRESS"),
5796
+ isMandatory: true,
5797
+ type: "text",
5453
5798
  populators: {
5454
- name: "agencyName",
5455
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown$1, {
5456
- option: agencies,
5457
- optionKey: "name",
5458
- select: props.onChange,
5459
- selected: props.value,
5460
- t: t
5461
- })
5799
+ name: "correspondenceAddress",
5800
+ validation: {
5801
+ required: true
5802
+ },
5803
+ className: "payment-form-text-input-correction"
5462
5804
  }
5463
5805
  }, {
5464
- label: "ES_VENDOR_SUPERVISOR_REPORTING_MANAGER",
5806
+ label: t("ES_VENDOR_SUPERVISOR_DESCRIPTION"),
5465
5807
  isMandatory: false,
5466
- type: "custom",
5808
+ type: "text",
5467
5809
  populators: {
5468
- name: "reportingManager",
5469
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown$1, {
5470
- option: reportingManagers,
5471
- optionKey: "name",
5472
- select: props.onChange,
5473
- selected: props.value,
5474
- t: t
5475
- })
5810
+ name: "description",
5811
+ className: "payment-form-text-input-correction"
5476
5812
  }
5477
5813
  }]
5478
- }, {
5479
- head: "ES_VENDOR_SUPERVISOR_AREA_ASSIGNMENT",
5480
- body: [{
5481
- type: "component",
5482
- component: "SupervisorAreaAssignment",
5483
- key: "areaAssignment",
5484
- withoutLabel: true
5485
- }]
5486
5814
  }];
5487
5815
  };
5488
5816
 
@@ -5490,7 +5818,6 @@ const AddSupervisor = ({
5490
5818
  parentUrl,
5491
5819
  heading
5492
5820
  }) => {
5493
- var _vendorsData$vendor;
5494
5821
  const tenantId = Digit.ULBService.getCurrentTenantId();
5495
5822
  const {
5496
5823
  t
@@ -5501,24 +5828,7 @@ const AddSupervisor = ({
5501
5828
  const {
5502
5829
  mutate
5503
5830
  } = Digit.Hooks.fsm.useSupervisorCreate(tenantId);
5504
- const {
5505
- data: vendorsData
5506
- } = Digit.Hooks.fsm.useVendorSearch(tenantId, {
5507
- status: "ACTIVE"
5508
- });
5509
- const agencies = (vendorsData === null || vendorsData === void 0 ? void 0 : (_vendorsData$vendor = vendorsData.vendor) === null || _vendorsData$vendor === void 0 ? void 0 : _vendorsData$vendor.map(v => ({
5510
- code: v.id,
5511
- name: v.name,
5512
- ...v
5513
- }))) || [];
5514
- const reportingManagers = [{
5515
- code: "MGR1",
5516
- name: "John Doe (Agency Admin)"
5517
- }, {
5518
- code: "MGR2",
5519
- name: "Jane Smith (Agency Admin)"
5520
- }];
5521
- const Config = SupervisorConfig(t, agencies, reportingManagers);
5831
+ const Config = SupervisorConfig(t);
5522
5832
  const defaultValues = {
5523
5833
  role: {
5524
5834
  code: "SUPERVISOR",
@@ -5526,11 +5836,8 @@ const AddSupervisor = ({
5526
5836
  }
5527
5837
  };
5528
5838
  const onFormValueChange = (setValue, formData) => {
5529
- var _formData$areaAssignm, _formData$areaAssignm2, _formData$areaAssignm3, _formData$areaAssignm4, _formData$areaAssignm5;
5530
- const isBasicDetailsFilled = (formData === null || formData === void 0 ? void 0 : formData.fullName) && (formData === null || formData === void 0 ? void 0 : formData.mobileNumber) && (formData === null || formData === void 0 ? void 0 : formData.emailId) && (formData === null || formData === void 0 ? void 0 : formData.employeeId);
5531
- const isRoleAccessFilled = formData === null || formData === void 0 ? void 0 : formData.agencyName;
5532
- const isAreaAssignmentFilled = (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm = formData.areaAssignment) === null || _formData$areaAssignm === void 0 ? void 0 : _formData$areaAssignm.zone) && (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm2 = formData.areaAssignment) === null || _formData$areaAssignm2 === void 0 ? void 0 : _formData$areaAssignm2.cluster) && (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm3 = formData.areaAssignment) === null || _formData$areaAssignm3 === void 0 ? void 0 : _formData$areaAssignm3.ward) && (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm4 = formData.areaAssignment) === null || _formData$areaAssignm4 === void 0 ? void 0 : (_formData$areaAssignm5 = _formData$areaAssignm4.areas) === null || _formData$areaAssignm5 === void 0 ? void 0 : _formData$areaAssignm5.length) > 0;
5533
- if (isBasicDetailsFilled && isRoleAccessFilled && isAreaAssignmentFilled) {
5839
+ const isBasicDetailsFilled = (formData === null || formData === void 0 ? void 0 : formData.fullName) && (formData === null || formData === void 0 ? void 0 : formData.mobileNumber) && (formData === null || formData === void 0 ? void 0 : formData.emailId) && (formData === null || formData === void 0 ? void 0 : formData.fatherOrHusbandName) && (formData === null || formData === void 0 ? void 0 : formData.relationship) && (formData === null || formData === void 0 ? void 0 : formData.dob) && (formData === null || formData === void 0 ? void 0 : formData.correspondenceAddress);
5840
+ if (isBasicDetailsFilled) {
5534
5841
  setCanSubmit(true);
5535
5842
  } else {
5536
5843
  setCanSubmit(false);
@@ -5540,28 +5847,27 @@ const AddSupervisor = ({
5540
5847
  setShowToast(null);
5541
5848
  };
5542
5849
  const onSubmit = data => {
5543
- var _data$gender, _data$agencyName, _data$reportingManage;
5850
+ var _data$relationship, _data$gender;
5544
5851
  const formData = {
5545
5852
  supervisor: {
5546
5853
  tenantId: tenantId,
5547
- name: data === null || data === void 0 ? void 0 : data.fullName,
5548
- employeeId: data === null || data === void 0 ? void 0 : data.employeeId,
5549
- status: "ACTIVE",
5550
5854
  owner: {
5551
5855
  tenantId: tenantId,
5552
5856
  name: data === null || data === void 0 ? void 0 : data.fullName,
5857
+ fatherOrHusbandName: data === null || data === void 0 ? void 0 : data.fatherOrHusbandName,
5858
+ relationship: data === null || data === void 0 ? void 0 : (_data$relationship = data.relationship) === null || _data$relationship === void 0 ? void 0 : _data$relationship.code,
5859
+ dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : null,
5553
5860
  gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || "OTHERS",
5861
+ mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber,
5554
5862
  emailId: data === null || data === void 0 ? void 0 : data.emailId,
5555
- mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber
5556
- },
5557
- vendorSupervisorStatus: "ACTIVE",
5558
- additionalDetails: {
5559
- agencyId: data === null || data === void 0 ? void 0 : (_data$agencyName = data.agencyName) === null || _data$agencyName === void 0 ? void 0 : _data$agencyName.code,
5560
- reportingManager: data === null || data === void 0 ? void 0 : (_data$reportingManage = data.reportingManager) === null || _data$reportingManage === void 0 ? void 0 : _data$reportingManage.code,
5561
- areaAssignment: data === null || data === void 0 ? void 0 : data.areaAssignment
5863
+ correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress
5562
5864
  }
5865
+ },
5866
+ RequestInfo: {
5867
+ msgId: "ekyc-supervisor-create"
5563
5868
  }
5564
5869
  };
5870
+ console.log("DEBUG: Supervisor create payload:", formData);
5565
5871
  mutate(formData, {
5566
5872
  onError: error => {
5567
5873
  setShowToast({
@@ -5620,7 +5926,8 @@ const AddSupervisor = ({
5620
5926
  };
5621
5927
 
5622
5928
  const {
5623
- Dropdown: Dropdown$2
5929
+ Dropdown: Dropdown$2,
5930
+ DatePicker: DatePicker$2
5624
5931
  } = require("@djb25/digit-ui-react-components");
5625
5932
  const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = false) => {
5626
5933
  return [{
@@ -5672,79 +5979,77 @@ const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = fal
5672
5979
  }
5673
5980
  }
5674
5981
  }, {
5675
- label: "ES_VENDOR_SURVEYOR_GENDER",
5676
- isMandatory: false,
5982
+ label: t("ES_VENDOR_SURVEYOR_GENDER"),
5983
+ isMandatory: true,
5677
5984
  type: "component",
5678
- key: "selectGender",
5679
- component: "SelectGender",
5680
- texts: {
5681
- header: "CS_COMMON_CHOOSE_GENDER",
5682
- cardText: "CS_COMMON_SELECT_GENDER",
5683
- submitBarLabel: "CS_COMMON_NEXT"
5985
+ key: "gender",
5986
+ component: "SelectGender"
5987
+ }, {
5988
+ label: t("ES_FSM_REGISTRY_NEW_FATHER_NAME"),
5989
+ isMandatory: true,
5990
+ type: "text",
5991
+ populators: {
5992
+ name: "fatherOrHusbandName",
5993
+ validation: {
5994
+ required: true
5995
+ },
5996
+ className: "payment-form-text-input-correction"
5684
5997
  }
5685
- }]
5686
- }, {
5687
- head: "ES_VENDOR_SURVEYOR_ROLE_ACCESS",
5688
- body: [{
5689
- label: "ES_VENDOR_SURVEYOR_ROLE",
5998
+ }, {
5999
+ label: t("ES_FSM_REGISTRY_NEW_RELATIONSHIP"),
5690
6000
  isMandatory: true,
5691
- type: "custom",
6001
+ type: "component",
6002
+ key: "relationship",
6003
+ component: "SelectEkycDropdown",
5692
6004
  populators: {
5693
- name: "role",
5694
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown$2, {
5695
- option: [{
5696
- code: "SURVEYOR",
5697
- name: "Surveyor"
5698
- }],
5699
- optionKey: "name",
5700
- select: props.onChange,
5701
- selected: props.value,
5702
- t: t,
5703
- disable: true
5704
- }),
5705
- defaultValue: {
5706
- code: "SURVEYOR",
5707
- name: "Surveyor"
5708
- }
6005
+ name: "relationship",
6006
+ options: [{
6007
+ code: "FATHER",
6008
+ name: "ES_COMMON_RELATION_FATHER"
6009
+ }, {
6010
+ code: "HUSBAND",
6011
+ name: "ES_COMMON_RELATION_HUSBAND"
6012
+ }, {
6013
+ code: "OTHER",
6014
+ name: "ES_COMMON_RELATION_OTHER"
6015
+ }],
6016
+ optionsKey: "name"
5709
6017
  }
5710
6018
  }, {
5711
- label: "ES_VENDOR_SURVEYOR_AGENCY_NAME",
6019
+ label: t("ES_FSM_REGISTRY_NEW_DOB"),
5712
6020
  isMandatory: true,
5713
6021
  type: "custom",
6022
+ key: "dob",
6023
+ populators: {
6024
+ name: "dob",
6025
+ validation: {
6026
+ required: true
6027
+ },
6028
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
6029
+ onChange: props.onChange,
6030
+ date: props.value
6031
+ }, customProps))
6032
+ }
6033
+ }, {
6034
+ label: t("ES_FSM_REGISTRY_NEW_CORRESPONDENCE_ADDRESS"),
6035
+ isMandatory: true,
6036
+ type: "text",
5714
6037
  populators: {
5715
- name: "agencyName",
5716
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown$2, {
5717
- option: agencies,
5718
- optionKey: "name",
5719
- select: props.onChange,
5720
- selected: props.value,
5721
- t: t
5722
- })
6038
+ name: "correspondenceAddress",
6039
+ validation: {
6040
+ required: true
6041
+ },
6042
+ className: "payment-form-text-input-correction"
5723
6043
  }
5724
6044
  }, {
5725
- label: "ES_VENDOR_SURVEYOR_REPORTING_MANAGER",
6045
+ label: t("ES_VENDOR_SURVEYOR_DESCRIPTION"),
5726
6046
  isMandatory: false,
5727
- type: "custom",
6047
+ type: "text",
5728
6048
  populators: {
5729
- name: "reportingManager",
5730
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown$2, {
5731
- option: reportingManagers,
5732
- optionKey: "name",
5733
- select: props.onChange,
5734
- selected: props.value,
5735
- t: t
5736
- })
6049
+ name: "description",
6050
+ className: "payment-form-text-input-correction"
5737
6051
  }
5738
6052
  }]
5739
- }, {
5740
- head: "ES_VENDOR_SURVEYOR_AREA_ASSIGNMENT",
5741
- body: [{
5742
- isMandatory: true,
5743
- type: "component",
5744
- key: "areaAssignment",
5745
- component: "SupervisorAreaAssignment",
5746
- withoutLabel: true
5747
- }]
5748
6053
  }];
5749
6054
  };
5750
6055
 
@@ -5752,7 +6057,6 @@ const AddSurveyor = ({
5752
6057
  parentUrl,
5753
6058
  heading
5754
6059
  }) => {
5755
- var _vendorsData$vendor;
5756
6060
  const tenantId = Digit.ULBService.getCurrentTenantId();
5757
6061
  const {
5758
6062
  t
@@ -5763,40 +6067,16 @@ const AddSurveyor = ({
5763
6067
  const {
5764
6068
  mutate
5765
6069
  } = Digit.Hooks.fsm.useSurveyorCreate(tenantId);
5766
- const {
5767
- data: vendorsData
5768
- } = Digit.Hooks.fsm.useVendorSearch(tenantId, {
5769
- status: "ACTIVE"
5770
- });
5771
- const agencies = (vendorsData === null || vendorsData === void 0 ? void 0 : (_vendorsData$vendor = vendorsData.vendor) === null || _vendorsData$vendor === void 0 ? void 0 : _vendorsData$vendor.map(v => ({
5772
- code: v.id,
5773
- name: v.name,
5774
- ...v
5775
- }))) || [];
5776
- const reportingManagers = [{
5777
- code: "MGR1",
5778
- name: "John Doe (Agency Admin)"
5779
- }, {
5780
- code: "SUP1",
5781
- name: "Jane Smith (Supervisor)"
5782
- }];
5783
- const Config = SurveyorConfig(t, agencies, reportingManagers);
5784
- const {
5785
- supervisorId
5786
- } = Digit.Hooks.useQueryParams();
6070
+ const Config = SurveyorConfig(t);
5787
6071
  const defaultValues = {
5788
6072
  role: {
5789
6073
  code: "SURVEYOR",
5790
6074
  name: "Surveyor"
5791
- },
5792
- reportingManager: reportingManagers.find(m => m.code === supervisorId) || null
6075
+ }
5793
6076
  };
5794
6077
  const onFormValueChange = (setValue, formData) => {
5795
- var _formData$areaAssignm, _formData$areaAssignm2, _formData$areaAssignm3, _formData$areaAssignm4;
5796
- const isBasicDetailsFilled = (formData === null || formData === void 0 ? void 0 : formData.fullName) && (formData === null || formData === void 0 ? void 0 : formData.mobileNumber) && (formData === null || formData === void 0 ? void 0 : formData.emailId) && (formData === null || formData === void 0 ? void 0 : formData.employeeId);
5797
- const isRoleAccessFilled = formData === null || formData === void 0 ? void 0 : formData.agencyName;
5798
- const isAreaAssignmentFilled = (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm = formData.areaAssignment) === null || _formData$areaAssignm === void 0 ? void 0 : _formData$areaAssignm.zone) && (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm2 = formData.areaAssignment) === null || _formData$areaAssignm2 === void 0 ? void 0 : _formData$areaAssignm2.ward) && (formData === null || formData === void 0 ? void 0 : (_formData$areaAssignm3 = formData.areaAssignment) === null || _formData$areaAssignm3 === void 0 ? void 0 : (_formData$areaAssignm4 = _formData$areaAssignm3.areas) === null || _formData$areaAssignm4 === void 0 ? void 0 : _formData$areaAssignm4.length) > 0;
5799
- if (isBasicDetailsFilled && isRoleAccessFilled && isAreaAssignmentFilled) {
6078
+ const isBasicDetailsFilled = (formData === null || formData === void 0 ? void 0 : formData.fullName) && (formData === null || formData === void 0 ? void 0 : formData.mobileNumber) && (formData === null || formData === void 0 ? void 0 : formData.emailId) && (formData === null || formData === void 0 ? void 0 : formData.employeeId) && (formData === null || formData === void 0 ? void 0 : formData.fatherOrHusbandName) && (formData === null || formData === void 0 ? void 0 : formData.relationship) && (formData === null || formData === void 0 ? void 0 : formData.dob) && (formData === null || formData === void 0 ? void 0 : formData.correspondenceAddress);
6079
+ if (isBasicDetailsFilled) {
5800
6080
  setCanSubmit(true);
5801
6081
  } else {
5802
6082
  setCanSubmit(false);
@@ -5806,26 +6086,31 @@ const AddSurveyor = ({
5806
6086
  setShowToast(null);
5807
6087
  };
5808
6088
  const onSubmit = data => {
5809
- var _data$gender, _data$agencyName, _data$reportingManage;
6089
+ var _data$agencyName, _data$agencyName2, _data$reportingManage, _data$reportingManage2, _data$relationship, _data$gender;
5810
6090
  const formData = {
5811
6091
  surveyor: {
5812
6092
  tenantId: tenantId,
5813
- name: data === null || data === void 0 ? void 0 : data.fullName,
5814
- employeeId: data === null || data === void 0 ? void 0 : data.employeeId,
5815
- status: "ACTIVE",
6093
+ vendorId: (data === null || data === void 0 ? void 0 : (_data$agencyName = data.agencyName) === null || _data$agencyName === void 0 ? void 0 : _data$agencyName.code) || (data === null || data === void 0 ? void 0 : (_data$agencyName2 = data.agencyName) === null || _data$agencyName2 === void 0 ? void 0 : _data$agencyName2.id) || "DL-DJB-000082",
6094
+ supervisorId: (data === null || data === void 0 ? void 0 : (_data$reportingManage = data.reportingManager) === null || _data$reportingManage === void 0 ? void 0 : _data$reportingManage.code) || (data === null || data === void 0 ? void 0 : (_data$reportingManage2 = data.reportingManager) === null || _data$reportingManage2 === void 0 ? void 0 : _data$reportingManage2.id) || "7fb7ce1d-1054-46c8-9518-ef0049bffcd4",
6095
+ description: (data === null || data === void 0 ? void 0 : data.description) || "",
6096
+ additionalDetails: {
6097
+ serviceType: "ekyc"
6098
+ },
5816
6099
  owner: {
5817
6100
  tenantId: tenantId,
5818
6101
  name: data === null || data === void 0 ? void 0 : data.fullName,
6102
+ fatherOrHusbandName: data === null || data === void 0 ? void 0 : data.fatherOrHusbandName,
6103
+ relationship: data === null || data === void 0 ? void 0 : (_data$relationship = data.relationship) === null || _data$relationship === void 0 ? void 0 : _data$relationship.code,
5819
6104
  gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || "OTHERS",
6105
+ dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : null,
5820
6106
  emailId: data === null || data === void 0 ? void 0 : data.emailId,
5821
- mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber
5822
- },
5823
- vendorSurveyorStatus: "ACTIVE",
5824
- additionalDetails: {
5825
- agencyId: data === null || data === void 0 ? void 0 : (_data$agencyName = data.agencyName) === null || _data$agencyName === void 0 ? void 0 : _data$agencyName.code,
5826
- reportingManager: data === null || data === void 0 ? void 0 : (_data$reportingManage = data.reportingManager) === null || _data$reportingManage === void 0 ? void 0 : _data$reportingManage.code,
5827
- areaAssignment: data === null || data === void 0 ? void 0 : data.areaAssignment
6107
+ mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber,
6108
+ correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress
5828
6109
  }
6110
+ },
6111
+ RequestInfo: {
6112
+ apiId: "Rainmaker",
6113
+ msgId: "ekyc-surveyor-create"
5829
6114
  }
5830
6115
  };
5831
6116
  mutate(formData, {
@@ -7134,7 +7419,7 @@ const VENDORCreate = ({
7134
7419
  };
7135
7420
 
7136
7421
  const {
7137
- DatePicker: DatePicker$1
7422
+ DatePicker: DatePicker$3
7138
7423
  } = require("@djb25/digit-ui-react-components");
7139
7424
  const DriverConfig = (t, disabled = false) => {
7140
7425
  return [{
@@ -7228,7 +7513,7 @@ const DriverConfig = (t, disabled = false) => {
7228
7513
  validation: {
7229
7514
  required: true
7230
7515
  },
7231
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, Object.assign({
7516
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
7232
7517
  onChange: props.onChange,
7233
7518
  date: props.value
7234
7519
  }, customProps, {
@@ -7793,11 +8078,7 @@ const DriverDetails = () => {
7793
8078
  marginTop: "32px"
7794
8079
  }
7795
8080
  }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
7796
- className: "card-with-background",
7797
- style: {
7798
- margin: "10px 16px",
7799
- padding: "20px"
7800
- }
8081
+ className: "card-with-background"
7801
8082
  }, /*#__PURE__*/React.createElement("div", {
7802
8083
  className: "additional-grid"
7803
8084
  }, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
@@ -7881,7 +8162,7 @@ const DriverDetails = () => {
7881
8162
  };
7882
8163
 
7883
8164
  const {
7884
- DatePicker: DatePicker$2
8165
+ DatePicker: DatePicker$4
7885
8166
  } = require("@djb25/digit-ui-react-components");
7886
8167
  const VehicleConfig = (t, disabled = false) => {
7887
8168
  return [{
@@ -7937,7 +8218,7 @@ const VehicleConfig = (t, disabled = false) => {
7937
8218
  validation: {
7938
8219
  required: true
7939
8220
  },
7940
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8221
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7941
8222
  onChange: props.onChange,
7942
8223
  date: props.value
7943
8224
  }, customProps))
@@ -7952,7 +8233,7 @@ const VehicleConfig = (t, disabled = false) => {
7952
8233
  validation: {
7953
8234
  required: true
7954
8235
  },
7955
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8236
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7956
8237
  onChange: props.onChange,
7957
8238
  date: props.value
7958
8239
  }, customProps))
@@ -7967,7 +8248,7 @@ const VehicleConfig = (t, disabled = false) => {
7967
8248
  validation: {
7968
8249
  required: true
7969
8250
  },
7970
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8251
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7971
8252
  onChange: props.onChange,
7972
8253
  date: props.value
7973
8254
  }, customProps))
@@ -7982,7 +8263,7 @@ const VehicleConfig = (t, disabled = false) => {
7982
8263
  validation: {
7983
8264
  required: true
7984
8265
  },
7985
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8266
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7986
8267
  onChange: props.onChange,
7987
8268
  date: props.value
7988
8269
  }, customProps))
@@ -8037,7 +8318,7 @@ const VehicleConfig = (t, disabled = false) => {
8037
8318
  validation: {
8038
8319
  required: true
8039
8320
  },
8040
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8321
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8041
8322
  onChange: props.onChange,
8042
8323
  date: props.value
8043
8324
  }, customProps, {
@@ -8738,6 +9019,184 @@ const VehicleDetails = props => {
8738
9019
  }))) : /*#__PURE__*/React.createElement(Loader, null));
8739
9020
  };
8740
9021
 
9022
+ const SelectEkycZones = ({
9023
+ config,
9024
+ onSelect,
9025
+ t,
9026
+ formData
9027
+ }) => {
9028
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9029
+ const [zones, setZones] = useState([]);
9030
+ const [selectedZones, setSelectedZones] = useState(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : []);
9031
+ const {
9032
+ data: boundaryData,
9033
+ isLoading
9034
+ } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
9035
+ useEffect(() => {
9036
+ var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
9037
+ const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
9038
+ const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
9039
+ if (Array.isArray(boundaries) && boundaries.length > 0) {
9040
+ const zonesList = boundaries.map(b => ({
9041
+ code: b.code,
9042
+ name: b.name
9043
+ }));
9044
+ setZones(zonesList);
9045
+ } else if (!isLoading) {
9046
+ setZones([{
9047
+ code: "ZONE-01",
9048
+ name: "ZONE-01"
9049
+ }, {
9050
+ code: "ZONE-02",
9051
+ name: "ZONE-02"
9052
+ }, {
9053
+ code: "ZONE-03",
9054
+ name: "ZONE-03"
9055
+ }, {
9056
+ code: "ZONE-04",
9057
+ name: "ZONE-04"
9058
+ }, {
9059
+ code: "ZONE-05",
9060
+ name: "ZONE-05"
9061
+ }]);
9062
+ }
9063
+ }, [boundaryData, isLoading]);
9064
+ const handleSelect = value => {
9065
+ setSelectedZones(value);
9066
+ onSelect(config.key, value);
9067
+ };
9068
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
9069
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React.createElement("div", {
9070
+ className: "field"
9071
+ }, /*#__PURE__*/React.createElement(MultiSelectDropdown, {
9072
+ options: zones,
9073
+ selected: selectedZones,
9074
+ onSelect: handleSelect,
9075
+ optionsKey: "name",
9076
+ t: t
9077
+ })));
9078
+ };
9079
+
9080
+ const SelectEkycClusters = ({
9081
+ config,
9082
+ onSelect,
9083
+ t,
9084
+ formData
9085
+ }) => {
9086
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9087
+ const [clusters, setClusters] = useState([]);
9088
+ const [selectedClusters, setSelectedClusters] = useState(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.clusterIds) ? formData.clusterIds : []);
9089
+ const selectedZones = Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : [];
9090
+ const {
9091
+ data: boundaryData
9092
+ } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
9093
+ useEffect(() => {
9094
+ var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
9095
+ const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
9096
+ const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
9097
+ let allClusters = [];
9098
+ if (selectedZones.length > 0 && Array.isArray(boundaries) && boundaries.length > 0) {
9099
+ selectedZones.forEach(zone => {
9100
+ const zoneBoundary = boundaries.find(b => b.code === zone.code);
9101
+ const children = (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.children) || (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.boundary) || [];
9102
+ if (Array.isArray(children)) {
9103
+ children.forEach(child => {
9104
+ allClusters.push({
9105
+ code: child.code,
9106
+ name: child.name
9107
+ });
9108
+ });
9109
+ }
9110
+ });
9111
+ }
9112
+ if (allClusters.length === 0) {
9113
+ const staticClusters = {
9114
+ "ZONE-01": [{
9115
+ code: "CLUSTER-01",
9116
+ name: "CLUSTER-01"
9117
+ }],
9118
+ "ZONE-02": [{
9119
+ code: "CLUSTER-02",
9120
+ name: "CLUSTER-02"
9121
+ }],
9122
+ "ZONE-03": [{
9123
+ code: "CLUSTER-03",
9124
+ name: "CLUSTER-03"
9125
+ }],
9126
+ "ZONE-04": [{
9127
+ code: "CLUSTER-04",
9128
+ name: "CLUSTER-04"
9129
+ }],
9130
+ "ZONE-05": [{
9131
+ code: "CLUSTER-05",
9132
+ name: "CLUSTER-05"
9133
+ }]
9134
+ };
9135
+ if (selectedZones.length > 0) {
9136
+ selectedZones.forEach(z => {
9137
+ if (staticClusters[z.code]) {
9138
+ allClusters = [...allClusters, ...staticClusters[z.code]];
9139
+ } else {
9140
+ allClusters.push({
9141
+ code: `${z.code}-C1`,
9142
+ name: `${z.name} Cluster 1`
9143
+ });
9144
+ }
9145
+ });
9146
+ } else {
9147
+ allClusters = [{
9148
+ code: "CLUSTER-01",
9149
+ name: "CLUSTER-01"
9150
+ }, {
9151
+ code: "CLUSTER-02",
9152
+ name: "CLUSTER-02"
9153
+ }, {
9154
+ code: "CLUSTER-03",
9155
+ name: "CLUSTER-03"
9156
+ }];
9157
+ }
9158
+ }
9159
+ setClusters(allClusters);
9160
+ }, [selectedZones, boundaryData]);
9161
+ const handleSelect = value => {
9162
+ setSelectedClusters(value);
9163
+ onSelect(config.key, value);
9164
+ };
9165
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React.createElement("div", {
9166
+ className: "field"
9167
+ }, /*#__PURE__*/React.createElement(MultiSelectDropdown, {
9168
+ options: clusters,
9169
+ selected: selectedClusters,
9170
+ onSelect: handleSelect,
9171
+ optionsKey: "name",
9172
+ t: t
9173
+ })));
9174
+ };
9175
+
9176
+ const SelectEkycDropdown = ({
9177
+ config,
9178
+ onSelect,
9179
+ t,
9180
+ formData
9181
+ }) => {
9182
+ var _config$populators, _config$populators2;
9183
+ const options = (config === null || config === void 0 ? void 0 : (_config$populators = config.populators) === null || _config$populators === void 0 ? void 0 : _config$populators.options) || [];
9184
+ const optionsKey = (config === null || config === void 0 ? void 0 : (_config$populators2 = config.populators) === null || _config$populators2 === void 0 ? void 0 : _config$populators2.optionsKey) || "name";
9185
+ const selected = formData === null || formData === void 0 ? void 0 : formData[config.key];
9186
+ const handleSelect = value => {
9187
+ onSelect(config.key, value);
9188
+ };
9189
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label)), /*#__PURE__*/React.createElement("div", {
9190
+ className: "field"
9191
+ }, /*#__PURE__*/React.createElement(Dropdown$3, {
9192
+ selected: selected,
9193
+ option: options,
9194
+ select: handleSelect,
9195
+ optionKey: optionsKey,
9196
+ t: t
9197
+ })));
9198
+ };
9199
+
8741
9200
  const componentsToRegister = {
8742
9201
  VendorDetails,
8743
9202
  VendorDocuments,
@@ -8761,7 +9220,10 @@ const componentsToRegister = {
8761
9220
  SupervisorDetails,
8762
9221
  SupervisorAreaAssignment,
8763
9222
  AddSurveyor,
8764
- SurveyorDetails
9223
+ SurveyorDetails,
9224
+ SelectEkycZones,
9225
+ SelectEkycClusters,
9226
+ SelectEkycDropdown
8765
9227
  };
8766
9228
  const addComponentsToRegistry = () => {
8767
9229
  Object.entries(componentsToRegister).forEach(([key, value]) => {