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

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", {
@@ -3533,12 +3622,12 @@ const SearchVendor = () => {
3533
3622
  config: {
3534
3623
  enabled: false
3535
3624
  }
3536
- }) : tab === "SUPERVISOR" ? Digit.Hooks.fsm.useSupervisorDetails(tenantId, {
3625
+ }) : tab === "SUPERVISOR" ? Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
3537
3626
  ...paginationParms,
3538
3627
  status: "ACTIVE,DISABLED"
3539
3628
  }, {
3540
3629
  enabled: false
3541
- }) : tab === "SURVEYOR" ? Digit.Hooks.fsm.useSurveyorDetails(tenantId, {
3630
+ }) : tab === "SURVEYOR" ? Digit.Hooks.fsm.useSurveyorSearch(tenantId, {
3542
3631
  ...paginationParms,
3543
3632
  status: "ACTIVE,DISABLED"
3544
3633
  }, {
@@ -3623,72 +3712,10 @@ const SearchVendor = () => {
3623
3712
  setTableData(tableData);
3624
3713
  }
3625
3714
  if (tab === "SUPERVISOR") {
3626
- const staticSupervisors = [{
3627
- id: "SUP1",
3628
- name: "Amit Kumar",
3629
- employeeId: "EMP001",
3630
- status: "ACTIVE",
3631
- owner: {
3632
- mobileNumber: "9876543210",
3633
- userName: "9876543210"
3634
- },
3635
- auditDetails: {
3636
- createdTime: new Date().getTime()
3637
- },
3638
- vendorData: {
3639
- name: "Clean City Agency"
3640
- }
3641
- }, {
3642
- id: "SUP2",
3643
- name: "Rajesh Singh",
3644
- employeeId: "EMP002",
3645
- status: "ACTIVE",
3646
- owner: {
3647
- mobileNumber: "9876543211",
3648
- userName: "9876543211"
3649
- },
3650
- auditDetails: {
3651
- createdTime: new Date().getTime()
3652
- },
3653
- vendorData: {
3654
- name: "Green Environment"
3655
- }
3656
- }];
3657
- setTableData((dsoData === null || dsoData === void 0 ? void 0 : dsoData.supervisor) || staticSupervisors);
3715
+ setTableData((dsoData === null || dsoData === void 0 ? void 0 : dsoData.supervisors) || (dsoData === null || dsoData === void 0 ? void 0 : dsoData.supervisor) || []);
3658
3716
  }
3659
3717
  if (tab === "SURVEYOR") {
3660
- const staticSurveyors = [{
3661
- id: "SUR1",
3662
- name: "Suresh Raina",
3663
- employeeId: "EMP101",
3664
- status: "ACTIVE",
3665
- owner: {
3666
- mobileNumber: "9123456780",
3667
- userName: "9123456780"
3668
- },
3669
- auditDetails: {
3670
- createdTime: new Date().getTime()
3671
- },
3672
- vendorData: {
3673
- name: "Clean City Agency"
3674
- }
3675
- }, {
3676
- id: "SUR2",
3677
- name: "Mahesh Babu",
3678
- employeeId: "EMP102",
3679
- status: "ACTIVE",
3680
- owner: {
3681
- mobileNumber: "9123456781",
3682
- userName: "9123456781"
3683
- },
3684
- auditDetails: {
3685
- createdTime: new Date().getTime()
3686
- },
3687
- vendorData: {
3688
- name: "Green Environment"
3689
- }
3690
- }];
3691
- setTableData((dsoData === null || dsoData === void 0 ? void 0 : dsoData.surveyor) || staticSurveyors);
3718
+ setTableData((dsoData === null || dsoData === void 0 ? void 0 : dsoData.surveyors) || (dsoData === null || dsoData === void 0 ? void 0 : dsoData.surveyor) || []);
3692
3719
  }
3693
3720
  }, [dsoData, tab]);
3694
3721
  useEffect(() => {
@@ -4165,18 +4192,84 @@ const SupervisorAreaAssignment = ({
4165
4192
  isLoading
4166
4193
  } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
4167
4194
  useEffect(() => {
4195
+ console.log("Boundary Data State:", {
4196
+ boundaryData,
4197
+ isLoading
4198
+ });
4168
4199
  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
- }
4200
+ var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
4201
+ 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]);
4202
+ const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
4203
+ if (Array.isArray(boundaries) && boundaries.length > 0) {
4204
+ setZones(boundaries);
4205
+ } else if (!isLoading) {
4206
+ setZones([{
4207
+ code: "ZONE-01",
4208
+ name: "ZONE-01",
4209
+ children: [{
4210
+ code: "CLUSTER-01",
4211
+ name: "CLUSTER-01",
4212
+ children: [{
4213
+ code: "WARD-01",
4214
+ name: "WARD-01",
4215
+ children: [{
4216
+ code: "AREA-01",
4217
+ name: "AREA-01"
4218
+ }, {
4219
+ code: "AREA-02",
4220
+ name: "AREA-02"
4221
+ }]
4222
+ }]
4223
+ }]
4224
+ }, {
4225
+ code: "ZONE-02",
4226
+ name: "ZONE-02"
4227
+ }]);
4228
+ }
4229
+ } else if (!isLoading) {
4230
+ setZones([{
4231
+ code: "ZONE-01",
4232
+ name: "ZONE-01",
4233
+ children: [{
4234
+ code: "CLUSTER-01",
4235
+ name: "CLUSTER-01",
4236
+ children: [{
4237
+ code: "WARD-01",
4238
+ name: "WARD-01",
4239
+ children: [{
4240
+ code: "AREA-01",
4241
+ name: "AREA-01"
4242
+ }, {
4243
+ code: "AREA-02",
4244
+ name: "AREA-02"
4245
+ }]
4246
+ }]
4247
+ }]
4248
+ }, {
4249
+ code: "ZONE-02",
4250
+ name: "ZONE-02"
4251
+ }]);
4174
4252
  }
4175
- }, [boundaryData]);
4253
+ }, [boundaryData, isLoading]);
4176
4254
  useEffect(() => {
4177
4255
  if (selectedZone) {
4178
4256
  var _formData$areaAssignm5, _formData$areaAssignm6;
4179
- setClusters(selectedZone.children || []);
4257
+ const children = selectedZone.children || selectedZone.boundary || [];
4258
+ setClusters(children.length > 0 ? children : [{
4259
+ code: "CLUSTER-01",
4260
+ name: "CLUSTER-01",
4261
+ children: [{
4262
+ code: "WARD-01",
4263
+ name: "WARD-01",
4264
+ children: [{
4265
+ code: "AREA-01",
4266
+ name: "AREA-01"
4267
+ }, {
4268
+ code: "AREA-02",
4269
+ name: "AREA-02"
4270
+ }]
4271
+ }]
4272
+ }]);
4180
4273
  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
4274
  setSelectedCluster(null);
4182
4275
  setSelectedWard(null);
@@ -4189,7 +4282,18 @@ const SupervisorAreaAssignment = ({
4189
4282
  useEffect(() => {
4190
4283
  if (selectedCluster) {
4191
4284
  var _formData$areaAssignm7, _formData$areaAssignm8;
4192
- setWards(selectedCluster.children || []);
4285
+ const children = selectedCluster.children || selectedCluster.boundary || [];
4286
+ setWards(children.length > 0 ? children : [{
4287
+ code: "WARD-01",
4288
+ name: "WARD-01",
4289
+ children: [{
4290
+ code: "AREA-01",
4291
+ name: "AREA-01"
4292
+ }, {
4293
+ code: "AREA-02",
4294
+ name: "AREA-02"
4295
+ }]
4296
+ }]);
4193
4297
  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
4298
  setSelectedWard(null);
4195
4299
  setSelectedAreas([]);
@@ -4201,7 +4305,14 @@ const SupervisorAreaAssignment = ({
4201
4305
  useEffect(() => {
4202
4306
  if (selectedWard) {
4203
4307
  var _formData$areaAssignm9, _formData$areaAssignm0;
4204
- setAreas(selectedWard.children || []);
4308
+ const children = selectedWard.children || selectedWard.localities || selectedWard.boundary || [];
4309
+ setAreas(children.length > 0 ? children : [{
4310
+ code: "AREA-01",
4311
+ name: "AREA-01"
4312
+ }, {
4313
+ code: "AREA-02",
4314
+ name: "AREA-02"
4315
+ }]);
4205
4316
  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
4317
  setSelectedAreas([]);
4207
4318
  }
@@ -4491,7 +4602,7 @@ const CitizenVendorApp = () => {
4491
4602
  })))
4492
4603
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
4493
4604
  path: `${path}`,
4494
- component: () => Digit.UserService.hasAccess(["WT_VENDOR"]) ? /*#__PURE__*/React.createElement("div", {
4605
+ component: () => Digit.UserService.hasAccess(["WT_VENDOR", "EKYC_VENDOR"]) ? /*#__PURE__*/React.createElement("div", {
4495
4606
  style: {
4496
4607
  display: "flex",
4497
4608
  gap: "24px",
@@ -4976,7 +5087,9 @@ const {
4976
5087
  DatePicker,
4977
5088
  Dropdown
4978
5089
  } = require("@djb25/digit-ui-react-components");
4979
- const VendorConfig = (t, disabled = false) => {
5090
+ const VendorConfig = (t, disabled = false, formData = {}) => {
5091
+ var _formData$serviceType;
5092
+ 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
5093
  return [{
4981
5094
  head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
4982
5095
  body: [{
@@ -5048,7 +5161,130 @@ const VendorConfig = (t, disabled = false) => {
5048
5161
  header: "CS_COMMON_CHOOSE_SERVICE_TYPE",
5049
5162
  submitBarLabel: "CS_COMMON_NEXT"
5050
5163
  }
5051
- }]
5164
+ }, ...(isEkyc ? [{
5165
+ label: "ES_VENDOR_CONTRACT_START_DATE",
5166
+ isMandatory: true,
5167
+ type: "custom",
5168
+ key: "contractStartDate",
5169
+ populators: {
5170
+ name: "contractStartDate",
5171
+ validation: {
5172
+ required: true
5173
+ },
5174
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5175
+ onChange: props.onChange,
5176
+ date: props.value
5177
+ }, customProps))
5178
+ }
5179
+ }, {
5180
+ label: "ES_VENDOR_CONTRACT_END_DATE",
5181
+ isMandatory: true,
5182
+ type: "custom",
5183
+ key: "contractEndDate",
5184
+ populators: {
5185
+ name: "contractEndDate",
5186
+ validation: {
5187
+ required: true
5188
+ },
5189
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5190
+ onChange: props.onChange,
5191
+ date: props.value
5192
+ }, customProps))
5193
+ }
5194
+ }, {
5195
+ label: "ES_VENDOR_ZONE",
5196
+ isMandatory: true,
5197
+ type: "component",
5198
+ key: "zoneIds",
5199
+ component: "SelectEkycZones"
5200
+ }, {
5201
+ label: "ES_VENDOR_CLUSTER",
5202
+ isMandatory: true,
5203
+ type: "component",
5204
+ key: "clusterIds",
5205
+ component: "SelectEkycClusters"
5206
+ }, {
5207
+ label: "ES_FSM_REGISTRY_NEW_OWNER_NAME",
5208
+ isMandatory: true,
5209
+ type: "text",
5210
+ populators: {
5211
+ name: "ownerName",
5212
+ validation: {
5213
+ required: true,
5214
+ pattern: /^[A-Za-z\s.,/]+$/
5215
+ },
5216
+ error: t("FSM_REGISTRY_INVALID_NAME"),
5217
+ className: "payment-form-text-input-correction"
5218
+ }
5219
+ }, {
5220
+ label: "ES_FSM_REGISTRY_NEW_FATHER_NAME",
5221
+ isMandatory: true,
5222
+ type: "text",
5223
+ populators: {
5224
+ name: "fatherOrHusbandName",
5225
+ validation: {
5226
+ required: true
5227
+ },
5228
+ className: "payment-form-text-input-correction"
5229
+ }
5230
+ }, {
5231
+ label: "ES_FSM_REGISTRY_NEW_GENDER",
5232
+ isMandatory: true,
5233
+ type: "component",
5234
+ key: "gender",
5235
+ component: "SelectEkycDropdown",
5236
+ populators: {
5237
+ name: "gender",
5238
+ options: [{
5239
+ code: "MALE",
5240
+ name: "ES_COMMON_GENDER_MALE"
5241
+ }, {
5242
+ code: "FEMALE",
5243
+ name: "ES_COMMON_GENDER_FEMALE"
5244
+ }, {
5245
+ code: "OTHER",
5246
+ name: "ES_COMMON_GENDER_OTHER"
5247
+ }],
5248
+ optionsKey: "name"
5249
+ }
5250
+ }, {
5251
+ label: "ES_FSM_REGISTRY_NEW_DOB",
5252
+ isMandatory: true,
5253
+ type: "custom",
5254
+ key: "dob",
5255
+ populators: {
5256
+ name: "dob",
5257
+ validation: {
5258
+ required: true
5259
+ },
5260
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5261
+ onChange: props.onChange,
5262
+ date: props.value
5263
+ }, customProps, {
5264
+ max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
5265
+ }))
5266
+ }
5267
+ }, {
5268
+ label: "ES_FSM_REGISTRY_NEW_RELATIONSHIP",
5269
+ isMandatory: true,
5270
+ type: "component",
5271
+ key: "relationship",
5272
+ component: "SelectEkycDropdown",
5273
+ populators: {
5274
+ name: "relationship",
5275
+ options: [{
5276
+ code: "FATHER",
5277
+ name: "ES_COMMON_RELATION_FATHER"
5278
+ }, {
5279
+ code: "HUSBAND",
5280
+ name: "ES_COMMON_RELATION_HUSBAND"
5281
+ }, {
5282
+ code: "OTHER",
5283
+ name: "ES_COMMON_RELATION_OTHER"
5284
+ }],
5285
+ optionsKey: "name"
5286
+ }
5287
+ }] : [])]
5052
5288
  }, {
5053
5289
  head: "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS",
5054
5290
  body: [{
@@ -5157,7 +5393,6 @@ const AddVendor = ({
5157
5393
  clearSuccessData();
5158
5394
  clearError();
5159
5395
  }, []);
5160
- const Config = VendorConfig(t);
5161
5396
  const defaultValues = {
5162
5397
  serviceType: {
5163
5398
  code: "WT",
@@ -5170,11 +5405,22 @@ const AddVendor = ({
5170
5405
  amount: null
5171
5406
  }
5172
5407
  };
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) {
5408
+ const [formData, setFormData] = useState(defaultValues);
5409
+ const Config = VendorConfig(t, false, formData);
5410
+ const onFormValueChange = (setValue, data) => {
5411
+ var _data$serviceType, _formData$serviceType, _data$serviceType2, _data$serviceType3, _data$address, _data$address2;
5412
+ 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)) {
5413
+ setFormData(data);
5414
+ }
5415
+ const isEkyc = (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code) === "EKYC";
5416
+ 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);
5417
+ 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);
5418
+ let isEkycFieldsFilled = true;
5419
+ if (isEkyc) {
5420
+ var _data$zoneIds, _data$clusterIds;
5421
+ 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);
5422
+ }
5423
+ if (isVendorDetailsFilled && isAddressFilled && isEkycFieldsFilled) {
5178
5424
  setCanSubmit(true);
5179
5425
  } else {
5180
5426
  setCanSubmit(false);
@@ -5213,7 +5459,7 @@ const AddVendor = ({
5213
5459
  setShowToast(null);
5214
5460
  };
5215
5461
  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;
5462
+ 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
5463
  const mergedData = data;
5218
5464
  const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
5219
5465
  const pincode = mergedData === null || mergedData === void 0 ? void 0 : mergedData.pincode;
@@ -5229,59 +5475,75 @@ const AddVendor = ({
5229
5475
  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
5476
  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
5477
  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
5478
  const emailId = mergedData === null || mergedData === void 0 ? void 0 : mergedData.emailId;
5234
5479
  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: {
5480
+ const isEkyc = (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code) === "EKYC";
5481
+ let vendorData = {
5482
+ tenantId: tenantId,
5483
+ name,
5484
+ agencyType: "ULB",
5485
+ paymentPreference: "post-service",
5486
+ address: {
5238
5487
  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
5488
+ landmark,
5489
+ doorNo,
5490
+ plotNo,
5491
+ street,
5492
+ city,
5493
+ district,
5494
+ region,
5495
+ state,
5496
+ country: "india",
5497
+ pincode,
5498
+ buildingName,
5499
+ locality: {
5500
+ code: localityCode || "",
5501
+ name: localityName || "",
5502
+ label: "Locality",
5503
+ area: localityArea || ""
5275
5504
  },
5276
- additionalDetails: {
5277
- serviceType: additionalDetails
5278
- },
5279
- vehicle: [],
5280
- drivers: [],
5281
- source: "WhatsApp"
5282
- }
5505
+ geoLocation: {
5506
+ latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 28.6139,
5507
+ longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 77.2090
5508
+ }
5509
+ },
5510
+ owner: {
5511
+ tenantId: "dl",
5512
+ name: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.ownerName) || name,
5513
+ fatherOrHusbandName: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.fatherOrHusbandName) || name,
5514
+ relationship: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$relations = mergedData.relationship) === null || _mergedData$relations === void 0 ? void 0 : _mergedData$relations.code) || "OTHER",
5515
+ gender: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$gender = mergedData.gender) === null || _mergedData$gender === void 0 ? void 0 : _mergedData$gender.code) || "MALE",
5516
+ dob: mergedData !== null && mergedData !== void 0 && mergedData.dob ? (new Date(mergedData.dob).getTime() / 1000).toString() : "915148800",
5517
+ emailId: emailId || "",
5518
+ mobileNumber: phone
5519
+ },
5520
+ additionalDetails: {
5521
+ serviceType: isEkyc ? "ekyc" : mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy2 = mergedData.serviceType) === null || _mergedData$serviceTy2 === void 0 ? void 0 : _mergedData$serviceTy2.code
5522
+ },
5523
+ vehicles: [],
5524
+ drivers: [],
5525
+ source: isEkyc ? "eKYC Portal" : "WhatsApp"
5283
5526
  };
5284
- mutate(formData, {
5527
+ if (isEkyc) {
5528
+ var _mergedData$zoneIds, _mergedData$clusterId;
5529
+ vendorData = {
5530
+ ...vendorData,
5531
+ 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)) || [],
5532
+ 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)) || [],
5533
+ contractStartDate: mergedData.contractStartDate ? new Date(mergedData.contractStartDate).getTime() : null,
5534
+ contractEndDate: mergedData.contractEndDate ? new Date(mergedData.contractEndDate).getTime() : null
5535
+ };
5536
+ }
5537
+ const payload = {
5538
+ vendor: vendorData
5539
+ };
5540
+ if (isEkyc) {
5541
+ payload.RequestInfo = {
5542
+ apiId: "Rainmaker",
5543
+ msgId: "ekyc-vendor-create"
5544
+ };
5545
+ }
5546
+ mutate(payload, {
5285
5547
  onError: error => {
5286
5548
  setShowToast({
5287
5549
  key: "error",
@@ -5344,13 +5606,14 @@ const AddVendor = ({
5344
5606
  };
5345
5607
 
5346
5608
  const {
5347
- Dropdown: Dropdown$1
5609
+ Dropdown: Dropdown$1,
5610
+ DatePicker: DatePicker$1
5348
5611
  } = require("@djb25/digit-ui-react-components");
5349
5612
  const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = false) => {
5350
5613
  return [{
5351
- head: "ES_VENDOR_SUPERVISOR_BASIC_DETAILS",
5614
+ head: t("ES_VENDOR_SUPERVISOR_BASIC_DETAILS"),
5352
5615
  body: [{
5353
- label: "ES_VENDOR_SUPERVISOR_FULL_NAME",
5616
+ label: t("ES_VENDOR_SUPERVISOR_FULL_NAME"),
5354
5617
  isMandatory: true,
5355
5618
  type: "text",
5356
5619
  disable: disabled,
@@ -5368,7 +5631,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5368
5631
  className: "payment-form-text-input-correction"
5369
5632
  }
5370
5633
  }, {
5371
- label: "ES_VENDOR_SUPERVISOR_MOBILE_NUMBER",
5634
+ label: t("ES_VENDOR_SUPERVISOR_MOBILE_NUMBER"),
5372
5635
  isMandatory: true,
5373
5636
  type: "mobileNumber",
5374
5637
  disable: disabled,
@@ -5383,7 +5646,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5383
5646
  className: "payment-form-text-input-correction"
5384
5647
  }
5385
5648
  }, {
5386
- label: "ES_VENDOR_SUPERVISOR_EMAIL_ID",
5649
+ label: t("ES_VENDOR_SUPERVISOR_EMAIL_ID"),
5387
5650
  isMandatory: true,
5388
5651
  type: "text",
5389
5652
  populators: {
@@ -5397,7 +5660,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5397
5660
  className: "payment-form-text-input-correction"
5398
5661
  }
5399
5662
  }, {
5400
- label: "ES_VENDOR_SUPERVISOR_EMPLOYEE_ID",
5663
+ label: t("ES_VENDOR_SUPERVISOR_EMPLOYEE_ID"),
5401
5664
  isMandatory: true,
5402
5665
  type: "text",
5403
5666
  populators: {
@@ -5409,80 +5672,77 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5409
5672
  className: "payment-form-text-input-correction"
5410
5673
  }
5411
5674
  }, {
5412
- label: "ES_VENDOR_SUPERVISOR_GENDER",
5413
- isMandatory: false,
5675
+ label: t("ES_VENDOR_SUPERVISOR_GENDER"),
5676
+ isMandatory: true,
5414
5677
  type: "component",
5415
5678
  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"
5679
+ component: "SelectGender"
5680
+ }, {
5681
+ label: t("ES_FSM_REGISTRY_NEW_FATHER_NAME"),
5682
+ isMandatory: true,
5683
+ type: "text",
5684
+ populators: {
5685
+ name: "fatherOrHusbandName",
5686
+ validation: {
5687
+ required: true
5688
+ },
5689
+ className: "payment-form-text-input-correction"
5423
5690
  }
5424
- }]
5425
- }, {
5426
- head: "ES_VENDOR_SUPERVISOR_ROLE_ACCESS",
5427
- body: [{
5428
- label: "ES_VENDOR_SUPERVISOR_ROLE",
5691
+ }, {
5692
+ label: t("ES_FSM_REGISTRY_NEW_RELATIONSHIP"),
5429
5693
  isMandatory: true,
5430
- type: "custom",
5694
+ type: "component",
5695
+ key: "relationship",
5696
+ component: "SelectEkycDropdown",
5431
5697
  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
- }
5698
+ name: "relationship",
5699
+ options: [{
5700
+ code: "FATHER",
5701
+ name: "ES_COMMON_RELATION_FATHER"
5702
+ }, {
5703
+ code: "HUSBAND",
5704
+ name: "ES_COMMON_RELATION_HUSBAND"
5705
+ }, {
5706
+ code: "OTHER",
5707
+ name: "ES_COMMON_RELATION_OTHER"
5708
+ }],
5709
+ optionsKey: "name"
5448
5710
  }
5449
5711
  }, {
5450
- label: "ES_VENDOR_SUPERVISOR_AGENCY_NAME",
5712
+ label: t("ES_FSM_REGISTRY_NEW_DOB"),
5451
5713
  isMandatory: true,
5452
5714
  type: "custom",
5715
+ key: "dob",
5453
5716
  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
- })
5717
+ name: "dob",
5718
+ validation: {
5719
+ required: true
5720
+ },
5721
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, Object.assign({
5722
+ onChange: props.onChange,
5723
+ date: props.value
5724
+ }, customProps))
5725
+ }
5726
+ }, {
5727
+ label: t("ES_FSM_REGISTRY_NEW_CORRESPONDENCE_ADDRESS"),
5728
+ isMandatory: true,
5729
+ type: "text",
5730
+ populators: {
5731
+ name: "correspondenceAddress",
5732
+ validation: {
5733
+ required: true
5734
+ },
5735
+ className: "payment-form-text-input-correction"
5462
5736
  }
5463
5737
  }, {
5464
- label: "ES_VENDOR_SUPERVISOR_REPORTING_MANAGER",
5738
+ label: t("ES_VENDOR_SUPERVISOR_DESCRIPTION"),
5465
5739
  isMandatory: false,
5466
- type: "custom",
5740
+ type: "text",
5467
5741
  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
- })
5742
+ name: "description",
5743
+ className: "payment-form-text-input-correction"
5476
5744
  }
5477
5745
  }]
5478
- }, {
5479
- head: "ES_VENDOR_SUPERVISOR_AREA_ASSIGNMENT",
5480
- body: [{
5481
- type: "component",
5482
- component: "SupervisorAreaAssignment",
5483
- key: "areaAssignment",
5484
- withoutLabel: true
5485
- }]
5486
5746
  }];
5487
5747
  };
5488
5748
 
@@ -5490,7 +5750,6 @@ const AddSupervisor = ({
5490
5750
  parentUrl,
5491
5751
  heading
5492
5752
  }) => {
5493
- var _vendorsData$vendor;
5494
5753
  const tenantId = Digit.ULBService.getCurrentTenantId();
5495
5754
  const {
5496
5755
  t
@@ -5501,24 +5760,7 @@ const AddSupervisor = ({
5501
5760
  const {
5502
5761
  mutate
5503
5762
  } = 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);
5763
+ const Config = SupervisorConfig(t);
5522
5764
  const defaultValues = {
5523
5765
  role: {
5524
5766
  code: "SUPERVISOR",
@@ -5526,11 +5768,8 @@ const AddSupervisor = ({
5526
5768
  }
5527
5769
  };
5528
5770
  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) {
5771
+ 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);
5772
+ if (isBasicDetailsFilled) {
5534
5773
  setCanSubmit(true);
5535
5774
  } else {
5536
5775
  setCanSubmit(false);
@@ -5540,28 +5779,27 @@ const AddSupervisor = ({
5540
5779
  setShowToast(null);
5541
5780
  };
5542
5781
  const onSubmit = data => {
5543
- var _data$gender, _data$agencyName, _data$reportingManage;
5782
+ var _data$relationship, _data$gender;
5544
5783
  const formData = {
5545
5784
  supervisor: {
5546
5785
  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
5786
  owner: {
5551
5787
  tenantId: tenantId,
5552
5788
  name: data === null || data === void 0 ? void 0 : data.fullName,
5789
+ fatherOrHusbandName: data === null || data === void 0 ? void 0 : data.fatherOrHusbandName,
5790
+ relationship: data === null || data === void 0 ? void 0 : (_data$relationship = data.relationship) === null || _data$relationship === void 0 ? void 0 : _data$relationship.code,
5791
+ dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : null,
5553
5792
  gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || "OTHERS",
5793
+ mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber,
5554
5794
  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
5795
+ correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress
5562
5796
  }
5797
+ },
5798
+ RequestInfo: {
5799
+ msgId: "ekyc-supervisor-create"
5563
5800
  }
5564
5801
  };
5802
+ console.log("DEBUG: Supervisor create payload:", formData);
5565
5803
  mutate(formData, {
5566
5804
  onError: error => {
5567
5805
  setShowToast({
@@ -5620,7 +5858,8 @@ const AddSupervisor = ({
5620
5858
  };
5621
5859
 
5622
5860
  const {
5623
- Dropdown: Dropdown$2
5861
+ Dropdown: Dropdown$2,
5862
+ DatePicker: DatePicker$2
5624
5863
  } = require("@djb25/digit-ui-react-components");
5625
5864
  const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = false) => {
5626
5865
  return [{
@@ -5672,79 +5911,77 @@ const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = fal
5672
5911
  }
5673
5912
  }
5674
5913
  }, {
5675
- label: "ES_VENDOR_SURVEYOR_GENDER",
5676
- isMandatory: false,
5914
+ label: t("ES_VENDOR_SURVEYOR_GENDER"),
5915
+ isMandatory: true,
5677
5916
  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"
5917
+ key: "gender",
5918
+ component: "SelectGender"
5919
+ }, {
5920
+ label: t("ES_FSM_REGISTRY_NEW_FATHER_NAME"),
5921
+ isMandatory: true,
5922
+ type: "text",
5923
+ populators: {
5924
+ name: "fatherOrHusbandName",
5925
+ validation: {
5926
+ required: true
5927
+ },
5928
+ className: "payment-form-text-input-correction"
5684
5929
  }
5685
- }]
5686
- }, {
5687
- head: "ES_VENDOR_SURVEYOR_ROLE_ACCESS",
5688
- body: [{
5689
- label: "ES_VENDOR_SURVEYOR_ROLE",
5930
+ }, {
5931
+ label: t("ES_FSM_REGISTRY_NEW_RELATIONSHIP"),
5690
5932
  isMandatory: true,
5691
- type: "custom",
5933
+ type: "component",
5934
+ key: "relationship",
5935
+ component: "SelectEkycDropdown",
5692
5936
  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
- }
5937
+ name: "relationship",
5938
+ options: [{
5939
+ code: "FATHER",
5940
+ name: "ES_COMMON_RELATION_FATHER"
5941
+ }, {
5942
+ code: "HUSBAND",
5943
+ name: "ES_COMMON_RELATION_HUSBAND"
5944
+ }, {
5945
+ code: "OTHER",
5946
+ name: "ES_COMMON_RELATION_OTHER"
5947
+ }],
5948
+ optionsKey: "name"
5709
5949
  }
5710
5950
  }, {
5711
- label: "ES_VENDOR_SURVEYOR_AGENCY_NAME",
5951
+ label: t("ES_FSM_REGISTRY_NEW_DOB"),
5712
5952
  isMandatory: true,
5713
5953
  type: "custom",
5954
+ key: "dob",
5955
+ populators: {
5956
+ name: "dob",
5957
+ validation: {
5958
+ required: true
5959
+ },
5960
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
5961
+ onChange: props.onChange,
5962
+ date: props.value
5963
+ }, customProps))
5964
+ }
5965
+ }, {
5966
+ label: t("ES_FSM_REGISTRY_NEW_CORRESPONDENCE_ADDRESS"),
5967
+ isMandatory: true,
5968
+ type: "text",
5714
5969
  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
- })
5970
+ name: "correspondenceAddress",
5971
+ validation: {
5972
+ required: true
5973
+ },
5974
+ className: "payment-form-text-input-correction"
5723
5975
  }
5724
5976
  }, {
5725
- label: "ES_VENDOR_SURVEYOR_REPORTING_MANAGER",
5977
+ label: t("ES_VENDOR_SURVEYOR_DESCRIPTION"),
5726
5978
  isMandatory: false,
5727
- type: "custom",
5979
+ type: "text",
5728
5980
  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
- })
5981
+ name: "description",
5982
+ className: "payment-form-text-input-correction"
5737
5983
  }
5738
5984
  }]
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
5985
  }];
5749
5986
  };
5750
5987
 
@@ -5752,7 +5989,6 @@ const AddSurveyor = ({
5752
5989
  parentUrl,
5753
5990
  heading
5754
5991
  }) => {
5755
- var _vendorsData$vendor;
5756
5992
  const tenantId = Digit.ULBService.getCurrentTenantId();
5757
5993
  const {
5758
5994
  t
@@ -5763,40 +5999,16 @@ const AddSurveyor = ({
5763
5999
  const {
5764
6000
  mutate
5765
6001
  } = 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();
6002
+ const Config = SurveyorConfig(t);
5787
6003
  const defaultValues = {
5788
6004
  role: {
5789
6005
  code: "SURVEYOR",
5790
6006
  name: "Surveyor"
5791
- },
5792
- reportingManager: reportingManagers.find(m => m.code === supervisorId) || null
6007
+ }
5793
6008
  };
5794
6009
  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) {
6010
+ 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);
6011
+ if (isBasicDetailsFilled) {
5800
6012
  setCanSubmit(true);
5801
6013
  } else {
5802
6014
  setCanSubmit(false);
@@ -5806,26 +6018,31 @@ const AddSurveyor = ({
5806
6018
  setShowToast(null);
5807
6019
  };
5808
6020
  const onSubmit = data => {
5809
- var _data$gender, _data$agencyName, _data$reportingManage;
6021
+ var _data$agencyName, _data$agencyName2, _data$reportingManage, _data$reportingManage2, _data$relationship, _data$gender;
5810
6022
  const formData = {
5811
6023
  surveyor: {
5812
6024
  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",
6025
+ 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",
6026
+ 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",
6027
+ description: (data === null || data === void 0 ? void 0 : data.description) || "",
6028
+ additionalDetails: {
6029
+ serviceType: "ekyc"
6030
+ },
5816
6031
  owner: {
5817
6032
  tenantId: tenantId,
5818
6033
  name: data === null || data === void 0 ? void 0 : data.fullName,
6034
+ fatherOrHusbandName: data === null || data === void 0 ? void 0 : data.fatherOrHusbandName,
6035
+ relationship: data === null || data === void 0 ? void 0 : (_data$relationship = data.relationship) === null || _data$relationship === void 0 ? void 0 : _data$relationship.code,
5819
6036
  gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || "OTHERS",
6037
+ dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : null,
5820
6038
  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
6039
+ mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber,
6040
+ correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress
5828
6041
  }
6042
+ },
6043
+ RequestInfo: {
6044
+ apiId: "Rainmaker",
6045
+ msgId: "ekyc-surveyor-create"
5829
6046
  }
5830
6047
  };
5831
6048
  mutate(formData, {
@@ -5923,15 +6140,6 @@ const SurveyorDetails = props => {
5923
6140
  const [showToast, setShowToast] = useState(null);
5924
6141
  const [vendors, setVendors] = useState([]);
5925
6142
  const [selectedOption, setSelectedOption] = useState({});
5926
- const {
5927
- data: surveyorData,
5928
- isLoading,
5929
- refetch
5930
- } = Digit.Hooks.fsm.useSurveyorDetails(tenantId, {
5931
- ids: surveyorId
5932
- }, {
5933
- staleTime: Infinity
5934
- });
5935
6143
  const {
5936
6144
  data: vendorData
5937
6145
  } = Digit.Hooks.fsm.useDsoSearch(tenantId, {
@@ -5939,6 +6147,56 @@ const SurveyorDetails = props => {
5939
6147
  sortOrder: "ASC",
5940
6148
  status: "ACTIVE"
5941
6149
  }, {});
6150
+ const {
6151
+ data: surveyorSearchResponse,
6152
+ isLoading,
6153
+ refetch
6154
+ } = Digit.Hooks.fsm.useSurveyorSearch(tenantId, {
6155
+ ids: surveyorId
6156
+ }, {
6157
+ staleTime: Infinity
6158
+ });
6159
+ const surveyorData = React.useMemo(() => {
6160
+ var _surveyorSearchRespon;
6161
+ if (!(surveyorSearchResponse !== null && surveyorSearchResponse !== void 0 && (_surveyorSearchRespon = surveyorSearchResponse.surveyors) !== null && _surveyorSearchRespon !== void 0 && _surveyorSearchRespon.length)) return [];
6162
+ return surveyorSearchResponse.surveyors.map(data => {
6163
+ var _mappedVendor$dsoDeta, _data$owner, _data$owner2, _data$owner3;
6164
+ const mappedVendor = vendorData === null || vendorData === void 0 ? void 0 : vendorData.find(v => {
6165
+ var _v$dsoDetails, _v$dsoDetails2;
6166
+ return ((_v$dsoDetails = v.dsoDetails) === null || _v$dsoDetails === void 0 ? void 0 : _v$dsoDetails.id) === data.vendorId || ((_v$dsoDetails2 = v.dsoDetails) === null || _v$dsoDetails2 === void 0 ? void 0 : _v$dsoDetails2.vendorId) === data.vendorId;
6167
+ });
6168
+ const vendorName = (mappedVendor === null || mappedVendor === void 0 ? void 0 : (_mappedVendor$dsoDeta = mappedVendor.dsoDetails) === null || _mappedVendor$dsoDeta === void 0 ? void 0 : _mappedVendor$dsoDeta.name) || data.vendorId || "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR";
6169
+ return {
6170
+ surveyorData: data,
6171
+ vendorDetails: {
6172
+ vendor: mappedVendor ? [mappedVendor.dsoDetails] : []
6173
+ },
6174
+ employeeResponse: [{
6175
+ title: "ES_VENDOR_SURVEYOR_BASIC_DETAILS",
6176
+ values: [{
6177
+ title: "ES_VENDOR_SURVEYOR_FULL_NAME",
6178
+ value: data === null || data === void 0 ? void 0 : data.name
6179
+ }, {
6180
+ title: "ES_VENDOR_SURVEYOR_MOBILE_NUMBER",
6181
+ value: (data === null || data === void 0 ? void 0 : (_data$owner = data.owner) === null || _data$owner === void 0 ? void 0 : _data$owner.mobileNumber) || (data === null || data === void 0 ? void 0 : data.mobileNo)
6182
+ }, {
6183
+ title: "ES_VENDOR_SURVEYOR_EMAIL_ID",
6184
+ value: data === null || data === void 0 ? void 0 : (_data$owner2 = data.owner) === null || _data$owner2 === void 0 ? void 0 : _data$owner2.emailId
6185
+ }, {
6186
+ title: "ES_VENDOR_SURVEYOR_STAFF_CODE",
6187
+ value: (data === null || data === void 0 ? void 0 : data.employeeId) || "N/A"
6188
+ }, {
6189
+ title: "ES_VENDOR_SURVEYOR_GENDER",
6190
+ value: data === null || data === void 0 ? void 0 : (_data$owner3 = data.owner) === null || _data$owner3 === void 0 ? void 0 : _data$owner3.gender
6191
+ }, {
6192
+ title: "ES_VENDOR_SURVEYOR_AGENCY_NAME",
6193
+ value: vendorName,
6194
+ type: "custom"
6195
+ }]
6196
+ }]
6197
+ };
6198
+ });
6199
+ }, [surveyorSearchResponse, vendorData]);
5942
6200
  const {
5943
6201
  mutate: mutateSurveyor
5944
6202
  } = Digit.Hooks.fsm.useSurveyorUpdate(tenantId);
@@ -6292,15 +6550,6 @@ const SupervisorDetails = props => {
6292
6550
  const [showToast, setShowToast] = useState(null);
6293
6551
  const [vendors, setVendors] = useState([]);
6294
6552
  const [selectedOption, setSelectedOption] = useState({});
6295
- const {
6296
- data: supervisorData,
6297
- isLoading,
6298
- refetch
6299
- } = Digit.Hooks.fsm.useSupervisorDetails(tenantId, {
6300
- ids: supervisorId
6301
- }, {
6302
- staleTime: Infinity
6303
- });
6304
6553
  const {
6305
6554
  data: vendorData
6306
6555
  } = Digit.Hooks.fsm.useDsoSearch(tenantId, {
@@ -6308,6 +6557,60 @@ const SupervisorDetails = props => {
6308
6557
  sortOrder: "ASC",
6309
6558
  status: "ACTIVE"
6310
6559
  }, {});
6560
+ const {
6561
+ data: supervisorSearchResponse,
6562
+ isLoading,
6563
+ refetch
6564
+ } = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
6565
+ ids: supervisorId
6566
+ }, {
6567
+ staleTime: Infinity
6568
+ });
6569
+ const supervisorData = React.useMemo(() => {
6570
+ var _supervisorSearchResp;
6571
+ if (!(supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && (_supervisorSearchResp = supervisorSearchResponse.supervisors) !== null && _supervisorSearchResp !== void 0 && _supervisorSearchResp.length)) return [];
6572
+ return supervisorSearchResponse.supervisors.map(data => {
6573
+ var _mappedVendor$dsoDeta, _data$owner, _data$owner2, _data$owner3;
6574
+ const mappedVendor = vendorData === null || vendorData === void 0 ? void 0 : vendorData.find(v => {
6575
+ var _v$dsoDetails, _v$dsoDetails2;
6576
+ return ((_v$dsoDetails = v.dsoDetails) === null || _v$dsoDetails === void 0 ? void 0 : _v$dsoDetails.id) === data.vendorId || ((_v$dsoDetails2 = v.dsoDetails) === null || _v$dsoDetails2 === void 0 ? void 0 : _v$dsoDetails2.vendorId) === data.vendorId;
6577
+ });
6578
+ const vendorName = (mappedVendor === null || mappedVendor === void 0 ? void 0 : (_mappedVendor$dsoDeta = mappedVendor.dsoDetails) === null || _mappedVendor$dsoDeta === void 0 ? void 0 : _mappedVendor$dsoDeta.name) || data.vendorId || "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR";
6579
+ return {
6580
+ supervisorData: data,
6581
+ vendorDetails: {
6582
+ vendor: mappedVendor ? [mappedVendor.dsoDetails] : []
6583
+ },
6584
+ employeeResponse: [{
6585
+ title: "ES_VENDOR_SUPERVISOR_BASIC_DETAILS",
6586
+ values: [{
6587
+ title: "ES_VENDOR_SUPERVISOR_FULL_NAME",
6588
+ value: data === null || data === void 0 ? void 0 : data.name
6589
+ }, {
6590
+ title: "ES_VENDOR_SUPERVISOR_MOBILE_NUMBER",
6591
+ value: (data === null || data === void 0 ? void 0 : (_data$owner = data.owner) === null || _data$owner === void 0 ? void 0 : _data$owner.mobileNumber) || (data === null || data === void 0 ? void 0 : data.mobileNo)
6592
+ }, {
6593
+ title: "ES_VENDOR_SUPERVISOR_EMAIL_ID",
6594
+ value: data === null || data === void 0 ? void 0 : (_data$owner2 = data.owner) === null || _data$owner2 === void 0 ? void 0 : _data$owner2.emailId
6595
+ }, {
6596
+ title: "ES_VENDOR_SUPERVISOR_STAFF_CODE",
6597
+ value: (data === null || data === void 0 ? void 0 : data.employeeId) || "N/A"
6598
+ }, {
6599
+ title: "ES_VENDOR_SUPERVISOR_GENDER",
6600
+ value: data === null || data === void 0 ? void 0 : (_data$owner3 = data.owner) === null || _data$owner3 === void 0 ? void 0 : _data$owner3.gender
6601
+ }, {
6602
+ title: "ES_VENDOR_SUPERVISOR_AGENCY_NAME",
6603
+ value: vendorName,
6604
+ type: "custom"
6605
+ }]
6606
+ }, {
6607
+ title: "ES_VENDOR_SUPERVISOR_MAPPED_SURVEYORS",
6608
+ type: "ES_FSM_REGISTRY_DETAILS_TYPE_SURVEYOR",
6609
+ child: []
6610
+ }]
6611
+ };
6612
+ });
6613
+ }, [supervisorSearchResponse, vendorData]);
6311
6614
  const {
6312
6615
  mutate: mutateSupervisor
6313
6616
  } = Digit.Hooks.fsm.useSupervisorUpdate(tenantId);
@@ -7134,7 +7437,7 @@ const VENDORCreate = ({
7134
7437
  };
7135
7438
 
7136
7439
  const {
7137
- DatePicker: DatePicker$1
7440
+ DatePicker: DatePicker$3
7138
7441
  } = require("@djb25/digit-ui-react-components");
7139
7442
  const DriverConfig = (t, disabled = false) => {
7140
7443
  return [{
@@ -7228,7 +7531,7 @@ const DriverConfig = (t, disabled = false) => {
7228
7531
  validation: {
7229
7532
  required: true
7230
7533
  },
7231
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, Object.assign({
7534
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
7232
7535
  onChange: props.onChange,
7233
7536
  date: props.value
7234
7537
  }, customProps, {
@@ -7793,11 +8096,7 @@ const DriverDetails = () => {
7793
8096
  marginTop: "32px"
7794
8097
  }
7795
8098
  }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
7796
- className: "card-with-background",
7797
- style: {
7798
- margin: "10px 16px",
7799
- padding: "20px"
7800
- }
8099
+ className: "card-with-background"
7801
8100
  }, /*#__PURE__*/React.createElement("div", {
7802
8101
  className: "additional-grid"
7803
8102
  }, 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 +8180,7 @@ const DriverDetails = () => {
7881
8180
  };
7882
8181
 
7883
8182
  const {
7884
- DatePicker: DatePicker$2
8183
+ DatePicker: DatePicker$4
7885
8184
  } = require("@djb25/digit-ui-react-components");
7886
8185
  const VehicleConfig = (t, disabled = false) => {
7887
8186
  return [{
@@ -7937,7 +8236,7 @@ const VehicleConfig = (t, disabled = false) => {
7937
8236
  validation: {
7938
8237
  required: true
7939
8238
  },
7940
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8239
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7941
8240
  onChange: props.onChange,
7942
8241
  date: props.value
7943
8242
  }, customProps))
@@ -7952,7 +8251,7 @@ const VehicleConfig = (t, disabled = false) => {
7952
8251
  validation: {
7953
8252
  required: true
7954
8253
  },
7955
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8254
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7956
8255
  onChange: props.onChange,
7957
8256
  date: props.value
7958
8257
  }, customProps))
@@ -7967,7 +8266,7 @@ const VehicleConfig = (t, disabled = false) => {
7967
8266
  validation: {
7968
8267
  required: true
7969
8268
  },
7970
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8269
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7971
8270
  onChange: props.onChange,
7972
8271
  date: props.value
7973
8272
  }, customProps))
@@ -7982,7 +8281,7 @@ const VehicleConfig = (t, disabled = false) => {
7982
8281
  validation: {
7983
8282
  required: true
7984
8283
  },
7985
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8284
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
7986
8285
  onChange: props.onChange,
7987
8286
  date: props.value
7988
8287
  }, customProps))
@@ -8037,7 +8336,7 @@ const VehicleConfig = (t, disabled = false) => {
8037
8336
  validation: {
8038
8337
  required: true
8039
8338
  },
8040
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8339
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8041
8340
  onChange: props.onChange,
8042
8341
  date: props.value
8043
8342
  }, customProps, {
@@ -8738,6 +9037,184 @@ const VehicleDetails = props => {
8738
9037
  }))) : /*#__PURE__*/React.createElement(Loader, null));
8739
9038
  };
8740
9039
 
9040
+ const SelectEkycZones = ({
9041
+ config,
9042
+ onSelect,
9043
+ t,
9044
+ formData
9045
+ }) => {
9046
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9047
+ const [zones, setZones] = useState([]);
9048
+ const [selectedZones, setSelectedZones] = useState(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : []);
9049
+ const {
9050
+ data: boundaryData,
9051
+ isLoading
9052
+ } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
9053
+ useEffect(() => {
9054
+ var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
9055
+ 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]);
9056
+ const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
9057
+ if (Array.isArray(boundaries) && boundaries.length > 0) {
9058
+ const zonesList = boundaries.map(b => ({
9059
+ code: b.code,
9060
+ name: b.name
9061
+ }));
9062
+ setZones(zonesList);
9063
+ } else if (!isLoading) {
9064
+ setZones([{
9065
+ code: "ZONE-01",
9066
+ name: "ZONE-01"
9067
+ }, {
9068
+ code: "ZONE-02",
9069
+ name: "ZONE-02"
9070
+ }, {
9071
+ code: "ZONE-03",
9072
+ name: "ZONE-03"
9073
+ }, {
9074
+ code: "ZONE-04",
9075
+ name: "ZONE-04"
9076
+ }, {
9077
+ code: "ZONE-05",
9078
+ name: "ZONE-05"
9079
+ }]);
9080
+ }
9081
+ }, [boundaryData, isLoading]);
9082
+ const handleSelect = value => {
9083
+ setSelectedZones(value);
9084
+ onSelect(config.key, value);
9085
+ };
9086
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
9087
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React.createElement("div", {
9088
+ className: "field"
9089
+ }, /*#__PURE__*/React.createElement(MultiSelectDropdown, {
9090
+ options: zones,
9091
+ selected: selectedZones,
9092
+ onSelect: handleSelect,
9093
+ optionsKey: "name",
9094
+ t: t
9095
+ })));
9096
+ };
9097
+
9098
+ const SelectEkycClusters = ({
9099
+ config,
9100
+ onSelect,
9101
+ t,
9102
+ formData
9103
+ }) => {
9104
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9105
+ const [clusters, setClusters] = useState([]);
9106
+ const [selectedClusters, setSelectedClusters] = useState(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.clusterIds) ? formData.clusterIds : []);
9107
+ const selectedZones = Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : [];
9108
+ const {
9109
+ data: boundaryData
9110
+ } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
9111
+ useEffect(() => {
9112
+ var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
9113
+ 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]);
9114
+ const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
9115
+ let allClusters = [];
9116
+ if (selectedZones.length > 0 && Array.isArray(boundaries) && boundaries.length > 0) {
9117
+ selectedZones.forEach(zone => {
9118
+ const zoneBoundary = boundaries.find(b => b.code === zone.code);
9119
+ const children = (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.children) || (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.boundary) || [];
9120
+ if (Array.isArray(children)) {
9121
+ children.forEach(child => {
9122
+ allClusters.push({
9123
+ code: child.code,
9124
+ name: child.name
9125
+ });
9126
+ });
9127
+ }
9128
+ });
9129
+ }
9130
+ if (allClusters.length === 0) {
9131
+ const staticClusters = {
9132
+ "ZONE-01": [{
9133
+ code: "CLUSTER-01",
9134
+ name: "CLUSTER-01"
9135
+ }],
9136
+ "ZONE-02": [{
9137
+ code: "CLUSTER-02",
9138
+ name: "CLUSTER-02"
9139
+ }],
9140
+ "ZONE-03": [{
9141
+ code: "CLUSTER-03",
9142
+ name: "CLUSTER-03"
9143
+ }],
9144
+ "ZONE-04": [{
9145
+ code: "CLUSTER-04",
9146
+ name: "CLUSTER-04"
9147
+ }],
9148
+ "ZONE-05": [{
9149
+ code: "CLUSTER-05",
9150
+ name: "CLUSTER-05"
9151
+ }]
9152
+ };
9153
+ if (selectedZones.length > 0) {
9154
+ selectedZones.forEach(z => {
9155
+ if (staticClusters[z.code]) {
9156
+ allClusters = [...allClusters, ...staticClusters[z.code]];
9157
+ } else {
9158
+ allClusters.push({
9159
+ code: `${z.code}-C1`,
9160
+ name: `${z.name} Cluster 1`
9161
+ });
9162
+ }
9163
+ });
9164
+ } else {
9165
+ allClusters = [{
9166
+ code: "CLUSTER-01",
9167
+ name: "CLUSTER-01"
9168
+ }, {
9169
+ code: "CLUSTER-02",
9170
+ name: "CLUSTER-02"
9171
+ }, {
9172
+ code: "CLUSTER-03",
9173
+ name: "CLUSTER-03"
9174
+ }];
9175
+ }
9176
+ }
9177
+ setClusters(allClusters);
9178
+ }, [selectedZones, boundaryData]);
9179
+ const handleSelect = value => {
9180
+ setSelectedClusters(value);
9181
+ onSelect(config.key, value);
9182
+ };
9183
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React.createElement("div", {
9184
+ className: "field"
9185
+ }, /*#__PURE__*/React.createElement(MultiSelectDropdown, {
9186
+ options: clusters,
9187
+ selected: selectedClusters,
9188
+ onSelect: handleSelect,
9189
+ optionsKey: "name",
9190
+ t: t
9191
+ })));
9192
+ };
9193
+
9194
+ const SelectEkycDropdown = ({
9195
+ config,
9196
+ onSelect,
9197
+ t,
9198
+ formData
9199
+ }) => {
9200
+ var _config$populators, _config$populators2;
9201
+ const options = (config === null || config === void 0 ? void 0 : (_config$populators = config.populators) === null || _config$populators === void 0 ? void 0 : _config$populators.options) || [];
9202
+ const optionsKey = (config === null || config === void 0 ? void 0 : (_config$populators2 = config.populators) === null || _config$populators2 === void 0 ? void 0 : _config$populators2.optionsKey) || "name";
9203
+ const selected = formData === null || formData === void 0 ? void 0 : formData[config.key];
9204
+ const handleSelect = value => {
9205
+ onSelect(config.key, value);
9206
+ };
9207
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label)), /*#__PURE__*/React.createElement("div", {
9208
+ className: "field"
9209
+ }, /*#__PURE__*/React.createElement(Dropdown$3, {
9210
+ selected: selected,
9211
+ option: options,
9212
+ select: handleSelect,
9213
+ optionKey: optionsKey,
9214
+ t: t
9215
+ })));
9216
+ };
9217
+
8741
9218
  const componentsToRegister = {
8742
9219
  VendorDetails,
8743
9220
  VendorDocuments,
@@ -8761,7 +9238,10 @@ const componentsToRegister = {
8761
9238
  SupervisorDetails,
8762
9239
  SupervisorAreaAssignment,
8763
9240
  AddSurveyor,
8764
- SurveyorDetails
9241
+ SurveyorDetails,
9242
+ SelectEkycZones,
9243
+ SelectEkycClusters,
9244
+ SelectEkycDropdown
8765
9245
  };
8766
9246
  const addComponentsToRegistry = () => {
8767
9247
  Object.entries(componentsToRegister).forEach(([key, value]) => {