@djb25/digit-ui-module-vendor 1.0.70 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -43,7 +43,10 @@ function _catch(body, recover) {
43
43
 
44
44
  const _require = require("@djb25/digit-ui-react-components"),
45
45
  DatePicker = _require.DatePicker;
46
- const SurveyorConfig = function (t, agencies, reportingManagers, disabled) {
46
+ const SurveyorConfig = function (t, genderMenu, disabled) {
47
+ if (genderMenu === void 0) {
48
+ genderMenu = [];
49
+ }
47
50
  return [{
48
51
  head: "ES_VENDOR_SURVEYOR_BASIC_DETAILS",
49
52
  body: [{
@@ -93,11 +96,16 @@ const SurveyorConfig = function (t, agencies, reportingManagers, disabled) {
93
96
  error: t("ES_VENDOR_INVALID_EMAIL")
94
97
  }
95
98
  }, {
96
- label: t("ES_VENDOR_SURVEYOR_GENDER"),
99
+ label: t("ES_FSM_REGISTRY_NEW_GENDER"),
97
100
  isMandatory: true,
98
101
  type: "component",
99
102
  key: "gender",
100
- component: "SelectGender"
103
+ component: "SelectEkycDropdown",
104
+ populators: {
105
+ name: "gender",
106
+ options: genderMenu,
107
+ optionsKey: "i18nKey"
108
+ }
101
109
  }, {
102
110
  label: t("ES_FSM_REGISTRY_NEW_DOB"),
103
111
  isMandatory: true,
@@ -211,8 +219,26 @@ const AddSurveyor = _ref => {
211
219
  });
212
220
  }
213
221
  }, [isSupervisor, supervisorSearchResponse, isSupervisorSearchLoading, matchedSupervisor]);
222
+ const _useState4 = React.useState([]),
223
+ genderMenu = _useState4[0],
224
+ setGenderMenu = _useState4[1];
225
+ const stateId = Digit.ULBService.getStateId();
226
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
227
+ genderTypeData = _Digit$Hooks$obps$use.data;
228
+ React.useEffect(() => {
229
+ var _genderTypeData$commo, _genderTypeData$commo2;
230
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
231
+ var _genderTypeData$commo3, _genderTypeData$commo4;
232
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
233
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
234
+ code: "" + genderDetails.code,
235
+ value: "" + genderDetails.code
236
+ }));
237
+ setGenderMenu(menuItems);
238
+ }
239
+ }, [genderTypeData]);
214
240
  const Config = React.useMemo(() => {
215
- const baseConfig = SurveyorConfig(t);
241
+ const baseConfig = SurveyorConfig(t, genderMenu);
216
242
  if (isSupervisor) {
217
243
  return baseConfig.map(section => _extends({}, section, {
218
244
  body: section.body.map(field => {
@@ -228,7 +254,7 @@ const AddSurveyor = _ref => {
228
254
  }));
229
255
  }
230
256
  return baseConfig;
231
- }, [t, isSupervisor]);
257
+ }, [t, genderMenu, isSupervisor]);
232
258
  const isValidAge = dateStr => {
233
259
  if (!dateStr) return false;
234
260
  const today = new Date();
@@ -3455,7 +3481,10 @@ const SupervisorDetails = props => {
3455
3481
 
3456
3482
  const _require$1 = require("@djb25/digit-ui-react-components"),
3457
3483
  DatePicker$1 = _require$1.DatePicker;
3458
- const SupervisorConfig = function (t, agencies, reportingManagers, disabled) {
3484
+ const SupervisorConfig = function (t, genderMenu, disabled) {
3485
+ if (genderMenu === void 0) {
3486
+ genderMenu = [];
3487
+ }
3459
3488
  if (disabled === void 0) {
3460
3489
  disabled = false;
3461
3490
  }
@@ -3516,11 +3545,16 @@ const SupervisorConfig = function (t, agencies, reportingManagers, disabled) {
3516
3545
  className: "payment-form-text-input-correction"
3517
3546
  }
3518
3547
  }, {
3519
- label: t("ES_VENDOR_SUPERVISOR_GENDER"),
3548
+ label: t("ES_FSM_REGISTRY_NEW_GENDER"),
3520
3549
  isMandatory: true,
3521
3550
  type: "component",
3522
3551
  key: "gender",
3523
- component: "SelectGender"
3552
+ component: "SelectEkycDropdown",
3553
+ populators: {
3554
+ name: "gender",
3555
+ options: genderMenu,
3556
+ optionsKey: "i18nKey"
3557
+ }
3524
3558
  }, {
3525
3559
  label: t("ES_FSM_REGISTRY_NEW_DOB"),
3526
3560
  isMandatory: true,
@@ -3595,7 +3629,27 @@ const AddSupervisor = _ref => {
3595
3629
  const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorCreate(tenantId),
3596
3630
  mutateAsync = _Digit$Hooks$fsm$useS.mutateAsync;
3597
3631
  const history = reactRouterDom.useHistory();
3598
- const Config = SupervisorConfig(t);
3632
+ const _useState3 = React.useState([]),
3633
+ genderMenu = _useState3[0],
3634
+ setGenderMenu = _useState3[1];
3635
+ const stateId = Digit.ULBService.getStateId();
3636
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
3637
+ genderTypeData = _Digit$Hooks$obps$use.data;
3638
+ React.useEffect(() => {
3639
+ var _genderTypeData$commo, _genderTypeData$commo2;
3640
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
3641
+ var _genderTypeData$commo3, _genderTypeData$commo4;
3642
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
3643
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
3644
+ code: "" + genderDetails.code,
3645
+ value: "" + genderDetails.code
3646
+ }));
3647
+ setGenderMenu(menuItems);
3648
+ }
3649
+ }, [genderTypeData]);
3650
+ const Config = React__default.useMemo(() => {
3651
+ return SupervisorConfig(t, genderMenu);
3652
+ }, [t, genderMenu]);
3599
3653
  const defaultValues = {
3600
3654
  role: {
3601
3655
  code: "SUPERVISOR",
@@ -4678,7 +4732,7 @@ const VendorConfig = function (t, module, genderMenu, update) {
4678
4732
  }
4679
4733
  }, {
4680
4734
  label: "ES_FSM_REGISTRY_NEW_EMAIL",
4681
- isMandatory: false,
4735
+ isMandatory: true,
4682
4736
  type: "text",
4683
4737
  key: "emailId",
4684
4738
  populators: {
@@ -5425,7 +5479,27 @@ const EditSupervisor = () => {
5425
5479
  isLoading = _Digit$Hooks$fsm$useS.isLoading;
5426
5480
  const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSupervisorUpdate(tenantId),
5427
5481
  mutate = _Digit$Hooks$fsm$useS2.mutate;
5428
- const Config = SupervisorConfig(t);
5482
+ const _useState5 = React.useState([]),
5483
+ genderMenu = _useState5[0],
5484
+ setGenderMenu = _useState5[1];
5485
+ const stateId = Digit.ULBService.getStateId();
5486
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
5487
+ genderTypeData = _Digit$Hooks$obps$use.data;
5488
+ React.useEffect(() => {
5489
+ var _genderTypeData$commo, _genderTypeData$commo2;
5490
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
5491
+ var _genderTypeData$commo3, _genderTypeData$commo4;
5492
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
5493
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
5494
+ code: "" + genderDetails.code,
5495
+ value: "" + genderDetails.code
5496
+ }));
5497
+ setGenderMenu(menuItems);
5498
+ }
5499
+ }, [genderTypeData]);
5500
+ const Config = React__default.useMemo(() => {
5501
+ return SupervisorConfig(t, genderMenu);
5502
+ }, [t, genderMenu]);
5429
5503
  React.useEffect(() => {
5430
5504
  if (supervisorSearchResponse && supervisorSearchResponse.supervisors && supervisorSearchResponse.supervisors.length > 0) {
5431
5505
  var _details$owner, _details$owner2, _details$owner3, _details$owner4, _details$owner5, _details$owner6, _details$owner7;
@@ -5602,7 +5676,27 @@ const EditSurveyor = () => {
5602
5676
  isLoading = _Digit$Hooks$fsm$useS.isLoading;
5603
5677
  const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorUpdate(tenantId),
5604
5678
  mutate = _Digit$Hooks$fsm$useS2.mutate;
5605
- const Config = SurveyorConfig(t);
5679
+ const _useState5 = React.useState([]),
5680
+ genderMenu = _useState5[0],
5681
+ setGenderMenu = _useState5[1];
5682
+ const stateId = Digit.ULBService.getStateId();
5683
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
5684
+ genderTypeData = _Digit$Hooks$obps$use.data;
5685
+ React.useEffect(() => {
5686
+ var _genderTypeData$commo, _genderTypeData$commo2;
5687
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
5688
+ var _genderTypeData$commo3, _genderTypeData$commo4;
5689
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
5690
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
5691
+ code: "" + genderDetails.code,
5692
+ value: "" + genderDetails.code
5693
+ }));
5694
+ setGenderMenu(menuItems);
5695
+ }
5696
+ }, [genderTypeData]);
5697
+ const Config = React__default.useMemo(() => {
5698
+ return SurveyorConfig(t, genderMenu);
5699
+ }, [t, genderMenu]);
5606
5700
  React.useEffect(() => {
5607
5701
  if (surveyorSearchResponse && surveyorSearchResponse.surveyors && surveyorSearchResponse.surveyors.length > 0) {
5608
5702
  var _details$owner, _details$owner2, _details$owner3, _details$owner4, _details$owner5, _details$owner6, _details$owner7, _details$owner8, _details$owner9;
@@ -5939,7 +6033,7 @@ const VENDORCreate = _ref => {
5939
6033
  };
5940
6034
 
5941
6035
  const EditVendor = () => {
5942
- var _Digit$UserService$ge, _defaultValues$servic2;
6036
+ var _Digit$UserService$ge, _dsoDetails$owner1, _defaultValues$servic2;
5943
6037
  const tenantId = Digit.ULBService.getCurrentTenantId();
5944
6038
  const _useTranslation = reactI18next.useTranslation(),
5945
6039
  t = _useTranslation.t;
@@ -6101,6 +6195,16 @@ const EditVendor = () => {
6101
6195
  })
6102
6196
  }));
6103
6197
  }, [dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.zoneIds, zones]);
6198
+ React.useEffect(() => {
6199
+ var _dsoDetails$owner0;
6200
+ if (!genderMenu.length || !(dsoDetails !== null && dsoDetails !== void 0 && (_dsoDetails$owner0 = dsoDetails.owner) !== null && _dsoDetails$owner0 !== void 0 && _dsoDetails$owner0.gender)) return;
6201
+ const matchedGender = genderMenu.find(ele => ele.code === dsoDetails.owner.gender);
6202
+ if (matchedGender) {
6203
+ setDefaultValues(prev => _extends({}, prev, {
6204
+ gender: matchedGender
6205
+ }));
6206
+ }
6207
+ }, [genderMenu, dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner1 = dsoDetails.owner) === null || _dsoDetails$owner1 === void 0 ? void 0 : _dsoDetails$owner1.gender]);
6104
6208
  const onFormValueChange = (setValue, data) => {
6105
6209
  var _data$serviceType, _data$serviceType2, _data$serviceType2$co, _data$serviceType3, _data$serviceType3$i;
6106
6210
  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$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code);
@@ -6120,7 +6224,7 @@ const EditVendor = () => {
6120
6224
  setShowToast(null);
6121
6225
  };
6122
6226
  const onSubmit = data => {
6123
- var _address$city, _address$city2, _address$city3, _address$city4, _address$locality, _address$locality2, _address$ward, _address$ward2, _mergedData$plotNo, _mergedData$buildingN, _mergedData$serviceTy, _mergedData$serviceTy2, _mergedData$serviceTy3, _mergedData$serviceTy4, _mergedData$address, _mergedData$address2, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy5;
6227
+ var _address$city, _address$city2, _address$city3, _address$city4, _address$locality, _address$locality2, _address$ward, _address$ward2, _mergedData$plotNo, _mergedData$buildingN, _mergedData$serviceTy, _mergedData$serviceTy2, _mergedData$serviceTy3, _mergedData$serviceTy4, _mergedData$address, _mergedData$address2, _mergedData$relations, _mergedData$serviceTy5;
6124
6228
  const mergedData = data;
6125
6229
  const address = mergedData === null || mergedData === void 0 ? void 0 : mergedData.propertyAddress;
6126
6230
  const pincode = address === null || address === void 0 ? void 0 : address.pincode;
@@ -6180,7 +6284,7 @@ const EditVendor = () => {
6180
6284
  name: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.ownerName) || name,
6181
6285
  fatherOrHusbandName: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.fatherOrHusbandName) || name,
6182
6286
  relationship: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$relations = mergedData.relationship) === null || _mergedData$relations === void 0 ? void 0 : _mergedData$relations.code) || "OTHER",
6183
- gender: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$gender = mergedData.gender) === null || _mergedData$gender === void 0 ? void 0 : _mergedData$gender.code) || "MALE",
6287
+ gender: mergedData === null || mergedData === void 0 ? void 0 : mergedData.gender,
6184
6288
  dob: mergedData !== null && mergedData !== void 0 && mergedData.dob ? new Date(mergedData.dob).getTime() : new Date("1/1/1970").getTime(),
6185
6289
  emailId: emailId || "",
6186
6290
  mobileNumber: phone
@@ -6486,17 +6590,58 @@ const EmployeeApp = _ref => {
6486
6590
  };
6487
6591
 
6488
6592
  const VENDORCard = () => {
6593
+ var _vendorCountData$tota;
6489
6594
  const _useTranslation = reactI18next.useTranslation(),
6490
6595
  t = _useTranslation.t;
6491
6596
  const history = reactRouterDom.useHistory();
6492
6597
  const isCitizen = window.location.pathname.toLowerCase().includes("citizen");
6598
+ const tenantId = Digit.ULBService.getStateId();
6599
+ const _useQuery = reactQuery.useQuery(["VENDOR_CARD_VENDOR_COUNT", tenantId], () => Digit.FSMService.vendorSearch(tenantId, {
6600
+ status: "ACTIVE",
6601
+ limit: 1,
6602
+ offset: 0
6603
+ }), {
6604
+ enabled: true,
6605
+ staleTime: 30000
6606
+ }),
6607
+ vendorCountData = _useQuery.data;
6608
+ const _useQuery2 = reactQuery.useQuery(["VENDOR_CARD_DRIVER_COUNT", tenantId], () => Digit.FSMService.driverSearch(tenantId, {
6609
+ status: "ACTIVE",
6610
+ limit: 1,
6611
+ offset: 0
6612
+ }), {
6613
+ enabled: true,
6614
+ staleTime: 30000
6615
+ });
6616
+ const _useQuery3 = reactQuery.useQuery(["VENDOR_CARD_VEHICLE_COUNT", tenantId], () => Digit.FSMService.vehiclesSearch(tenantId, {
6617
+ status: "ACTIVE",
6618
+ limit: 1,
6619
+ offset: 0
6620
+ }), {
6621
+ enabled: true,
6622
+ staleTime: 30000
6623
+ });
6624
+ const _useQuery4 = reactQuery.useQuery(["VENDOR_CARD_SUPERVISOR_COUNT", tenantId], () => Digit.FSMService.supervisorSearch(tenantId, {
6625
+ status: "ACTIVE,DISABLED",
6626
+ limit: 1,
6627
+ offset: 0
6628
+ }), {
6629
+ enabled: true,
6630
+ staleTime: 30000
6631
+ });
6632
+ const _useQuery5 = reactQuery.useQuery(["VENDOR_CARD_SURVEYOR_COUNT", tenantId], () => Digit.FSMService.surveyorSearch(tenantId, {
6633
+ status: "ACTIVE,DISABLED",
6634
+ limit: 1,
6635
+ offset: 0
6636
+ }), {
6637
+ enabled: true,
6638
+ staleTime: 30000
6639
+ });
6493
6640
  let hasAccess = Digit.Utils.vendorAccess() || Digit.UserService.hasAccess(["WT_VENDOR", "MT_VENDOR"]);
6494
6641
  if (isCitizen) {
6495
6642
  hasAccess = Digit.UserService.hasAccess(["WT_VENDOR", "EKYC_VENDOR", "EKYC_SUPERVISOR"]);
6496
6643
  }
6497
- if (!hasAccess) {
6498
- return null;
6499
- }
6644
+ if (!hasAccess) return null;
6500
6645
  const links = [{
6501
6646
  label: t("VENDOR_NEW_REGISTERATION"),
6502
6647
  link: isCitizen ? "/digit-ui/citizen/vendor/registry/new-vendor" : "/digit-ui/employee/vendor/registry/new-vendor"
@@ -6509,7 +6654,7 @@ const VENDORCard = () => {
6509
6654
  Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PropertyHouse, null),
6510
6655
  moduleName: t("TITLE_VENDOR_MANAGEMENT"),
6511
6656
  kpis: [{
6512
- count: 0,
6657
+ count: (_vendorCountData$tota = vendorCountData === null || vendorCountData === void 0 ? void 0 : vendorCountData.totalCount) != null ? _vendorCountData$tota : 0,
6513
6658
  label: t("Inbox"),
6514
6659
  link: isCitizen ? "/digit-ui/citizen/vendor/search-vendor" : "/digit-ui/employee/vendor/search-vendor"
6515
6660
  }],
@@ -9657,12 +9802,21 @@ const SelectEkycZones = _ref => {
9657
9802
  } else {
9658
9803
  let vendorZoneCodes = [];
9659
9804
  if (Array.isArray(matchedVendor === null || matchedVendor === void 0 ? void 0 : matchedVendor.zoneIds) && matchedVendor.zoneIds.length > 0) {
9660
- vendorZoneCodes = matchedVendor.zoneIds.map(z => z.trim().toUpperCase()).filter(Boolean);
9805
+ vendorZoneCodes = matchedVendor.zoneIds.map(z => typeof z === "object" ? (z === null || z === void 0 ? void 0 : z.code) || (z === null || z === void 0 ? void 0 : z.name) : z).filter(Boolean);
9661
9806
  } else if (matchedVendor !== null && matchedVendor !== void 0 && matchedVendor.assignedZoneId) {
9662
- vendorZoneCodes = matchedVendor.assignedZoneId.split(",").map(z => z.trim().toUpperCase()).filter(Boolean);
9807
+ vendorZoneCodes = matchedVendor.assignedZoneId.split(",").map(z => z.trim()).filter(Boolean);
9663
9808
  }
9664
9809
  if (vendorZoneCodes.length > 0) {
9665
- activeZros = activeZros.filter(zro => vendorZoneCodes.includes(zro.code.trim().toUpperCase()));
9810
+ const upperVendorCodes = vendorZoneCodes.map(z => z.toString().trim().toUpperCase());
9811
+ const matchedMdmsZros = activeZros.filter(zro => upperVendorCodes.includes(zro.code.trim().toUpperCase()));
9812
+ if (matchedMdmsZros.length > 0) {
9813
+ activeZros = matchedMdmsZros;
9814
+ } else {
9815
+ activeZros = vendorZoneCodes.map(z => ({
9816
+ code: String(z).trim(),
9817
+ name: t(String(z).trim()) || String(z).trim()
9818
+ }));
9819
+ }
9666
9820
  } else {
9667
9821
  activeZros = [];
9668
9822
  }
@@ -9674,12 +9828,21 @@ const SelectEkycZones = _ref => {
9674
9828
  } else {
9675
9829
  let supervisorZoneCodes = [];
9676
9830
  if (Array.isArray(matchedSupervisor === null || matchedSupervisor === void 0 ? void 0 : matchedSupervisor.zoneIds) && matchedSupervisor.zoneIds.length > 0) {
9677
- supervisorZoneCodes = matchedSupervisor.zoneIds.map(z => z.trim().toUpperCase()).filter(Boolean);
9831
+ supervisorZoneCodes = matchedSupervisor.zoneIds.map(z => typeof z === "object" ? (z === null || z === void 0 ? void 0 : z.code) || (z === null || z === void 0 ? void 0 : z.name) : z).filter(Boolean);
9678
9832
  } else if (matchedSupervisor !== null && matchedSupervisor !== void 0 && matchedSupervisor.assignedZoneId) {
9679
- supervisorZoneCodes = matchedSupervisor.assignedZoneId.split(",").map(z => z.trim().toUpperCase()).filter(Boolean);
9833
+ supervisorZoneCodes = matchedSupervisor.assignedZoneId.split(",").map(z => z.trim()).filter(Boolean);
9680
9834
  }
9681
9835
  if (supervisorZoneCodes.length > 0) {
9682
- activeZros = activeZros.filter(zro => supervisorZoneCodes.includes(zro.code.trim().toUpperCase()));
9836
+ const upperSupCodes = supervisorZoneCodes.map(z => z.toString().trim().toUpperCase());
9837
+ const matchedMdmsZros = activeZros.filter(zro => upperSupCodes.includes(zro.code.trim().toUpperCase()));
9838
+ if (matchedMdmsZros.length > 0) {
9839
+ activeZros = matchedMdmsZros;
9840
+ } else {
9841
+ activeZros = supervisorZoneCodes.map(z => ({
9842
+ code: String(z).trim(),
9843
+ name: t(String(z).trim()) || String(z).trim()
9844
+ }));
9845
+ }
9683
9846
  } else {
9684
9847
  activeZros = [];
9685
9848
  }
@@ -10581,7 +10744,8 @@ const VENDORLinks = _ref3 => {
10581
10744
  const VENDORComponents = {
10582
10745
  VENDORCard,
10583
10746
  VENDORModule,
10584
- VENDORLinks
10747
+ VENDORLinks,
10748
+ SelectEkycZones
10585
10749
  };
10586
10750
 
10587
10751
  exports.VENDORComponents = VENDORComponents;