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

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.
@@ -28,6 +28,8 @@ const EmployeeApp = ({
28
28
  const SupervisorDetails = Digit.ComponentRegistryService.getComponent("SupervisorDetails");
29
29
  const AddSurveyor = Digit.ComponentRegistryService.getComponent("AddSurveyor");
30
30
  const SurveyorDetails = Digit.ComponentRegistryService.getComponent("SurveyorDetails");
31
+ const EditDriver = Digit.ComponentRegistryService.getComponent("EditDriver");
32
+ const EditVehicle = Digit.ComponentRegistryService.getComponent("EditVehicle");
31
33
  const getDynamicBreadcrumbs = () => {
32
34
  const pathname = location.pathname;
33
35
  let crumbs = [{
@@ -134,6 +136,13 @@ const EmployeeApp = ({
134
136
  }, /*#__PURE__*/React.createElement(DriverDetails, Object.assign({}, props, {
135
137
  parentRoute: path
136
138
  })))
139
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
140
+ path: `${path}/registry/modify-driver/:id`,
141
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
142
+ layoutClass: "action"
143
+ }, /*#__PURE__*/React.createElement(EditDriver, Object.assign({}, props, {
144
+ parentRoute: path
145
+ })))
137
146
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
138
147
  path: `${path}/common-search/:id`,
139
148
  component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
@@ -162,6 +171,13 @@ const EmployeeApp = ({
162
171
  }, /*#__PURE__*/React.createElement(VehicleDetails, Object.assign({}, props, {
163
172
  parentRoute: path
164
173
  })))
174
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
175
+ path: `${path}/registry/modify-vehicle/:id`,
176
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
177
+ layoutClass: "action"
178
+ }, /*#__PURE__*/React.createElement(EditVehicle, Object.assign({}, props, {
179
+ parentRoute: path
180
+ })))
165
181
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
166
182
  path: `${path}/registry/new-supervisor`,
167
183
  component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
@@ -1876,17 +1892,18 @@ const RegisteredVendorSearch = ({
1876
1892
  return null;
1877
1893
  };
1878
1894
  function onActionSelect(action) {
1895
+ const userPath = userType === null || userType === void 0 ? void 0 : userType.toLowerCase();
1879
1896
  switch (action) {
1880
1897
  case "VENDOR":
1881
- return history.push("/digit-ui/employee/vendor/registry/new-vendor");
1898
+ return history.push(`/digit-ui/${userPath}/vendor/registry/new-vendor`);
1882
1899
  case "VEHICLE":
1883
- return history.push("/digit-ui/employee/vendor/registry/new-vehicle");
1900
+ return history.push(`/digit-ui/${userPath}/vendor/registry/new-vehicle`);
1884
1901
  case "DRIVER":
1885
- return history.push("/digit-ui/employee/vendor/registry/new-driver");
1902
+ return history.push(`/digit-ui/${userPath}/vendor/registry/new-driver`);
1886
1903
  case "SUPERVISOR":
1887
- return history.push("/digit-ui/employee/vendor/registry/new-supervisor");
1904
+ return history.push(`/digit-ui/${userPath}/vendor/registry/new-supervisor`);
1888
1905
  case "SURVEYOR":
1889
- return history.push("/digit-ui/employee/vendor/registry/new-surveyor");
1906
+ return history.push(`/digit-ui/${userPath}/vendor/registry/new-surveyor`);
1890
1907
  }
1891
1908
  }
1892
1909
  const getFields = input => {
@@ -1940,7 +1957,7 @@ const RegisteredVendorSearch = ({
1940
1957
  };
1941
1958
  const userInfo = Digit.SessionStorage.get("User");
1942
1959
  const userType = userInfo.info.type;
1943
- const vendorItems = [...(userType === "EMPLOYEE" && 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"] : [])];
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"] : [])];
1944
1961
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1945
1962
  className: "search-container",
1946
1963
  style: {
@@ -2591,9 +2608,9 @@ const VendorInbox = props => {
2591
2608
  case "VENDOR":
2592
2609
  return history.push(`/digit-ui/${userType}/vendor/registry/new-vendor`);
2593
2610
  case "VEHICLE":
2594
- return history.push(`/digit-ui/${userType}/fsm/registry/new-vehicle`);
2611
+ return history.push(`/digit-ui/${userType}/vendor/registry/new-vehicle`);
2595
2612
  case "DRIVER":
2596
- return history.push(`/digit-ui/${userType}/fsm/registry/new-driver`);
2613
+ return history.push(`/digit-ui/${userType}/vendor/registry/new-driver`);
2597
2614
  case "SUPERVISOR":
2598
2615
  return history.push(`/digit-ui/${userType}/vendor/registry/new-supervisor`);
2599
2616
  case "SURVEYOR":
@@ -4363,6 +4380,12 @@ const CitizenVendorApp = () => {
4363
4380
  const AddSurveyor = Digit.ComponentRegistryService.getComponent("AddSurveyor");
4364
4381
  const SurveyorDetails = Digit.ComponentRegistryService.getComponent("SurveyorDetails");
4365
4382
  const VendorCreate = Digit.ComponentRegistryService.getComponent("VENDORCreate");
4383
+ const AddDriver = Digit.ComponentRegistryService.getComponent("AddDriver");
4384
+ const DriverDetails = Digit.ComponentRegistryService.getComponent("DriverDetails");
4385
+ const AddVehicle = Digit.ComponentRegistryService.getComponent("AddVehicle");
4386
+ const VehicleDetails = Digit.ComponentRegistryService.getComponent("VehicleDetails");
4387
+ const EditDriver = Digit.ComponentRegistryService.getComponent("EditDriver");
4388
+ const EditVehicle = Digit.ComponentRegistryService.getComponent("EditVehicle");
4366
4389
  return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
4367
4390
  className: "ground-container employee-app-container form-container"
4368
4391
  }, /*#__PURE__*/React.createElement(ModuleHeader, {
@@ -4386,6 +4409,48 @@ const CitizenVendorApp = () => {
4386
4409
  }, /*#__PURE__*/React.createElement(EditVendorDetails, Object.assign({}, props, {
4387
4410
  parentRoute: path
4388
4411
  })))
4412
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4413
+ path: `${path}/registry/driver-details/:id`,
4414
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4415
+ layoutClass: "action"
4416
+ }, /*#__PURE__*/React.createElement(DriverDetails, Object.assign({}, props, {
4417
+ parentRoute: path
4418
+ })))
4419
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4420
+ path: `${path}/registry/modify-driver/:id`,
4421
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4422
+ layoutClass: "action"
4423
+ }, /*#__PURE__*/React.createElement(EditDriver, Object.assign({}, props, {
4424
+ parentRoute: path
4425
+ })))
4426
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4427
+ path: `${path}/registry/vehicle-details/:id`,
4428
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4429
+ layoutClass: "action"
4430
+ }, /*#__PURE__*/React.createElement(VehicleDetails, Object.assign({}, props, {
4431
+ parentRoute: path
4432
+ })))
4433
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4434
+ path: `${path}/registry/modify-vehicle/:id`,
4435
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4436
+ layoutClass: "action"
4437
+ }, /*#__PURE__*/React.createElement(EditVehicle, Object.assign({}, props, {
4438
+ parentRoute: path
4439
+ })))
4440
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4441
+ path: `${path}/registry/new-driver`,
4442
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4443
+ layoutClass: "action"
4444
+ }, /*#__PURE__*/React.createElement(AddDriver, Object.assign({}, props, {
4445
+ parentRoute: path
4446
+ })))
4447
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4448
+ path: `${path}/registry/new-vehicle`,
4449
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4450
+ layoutClass: "action"
4451
+ }, /*#__PURE__*/React.createElement(AddVehicle, Object.assign({}, props, {
4452
+ parentRoute: path
4453
+ })))
4389
4454
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
4390
4455
  path: `${path}/registry/new-supervisor`,
4391
4456
  component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
@@ -4568,7 +4633,7 @@ const EditVendorDetails = props => {
4568
4633
  case "ADD_DRIVER":
4569
4634
  return setShowModal(true);
4570
4635
  case "EDIT":
4571
- return history.push(`/digit-ui/${userType}/fsm/registry/modify-vendor/dsoId`);
4636
+ return history.push(`/digit-ui/${userType}/fsm/registry/modify-vendor/${dsoId}`);
4572
4637
  case "HOME":
4573
4638
  return history.push(`/digit-ui/${userType}/fsm/registry?selectedTabs=VENDOR`);
4574
4639
  }
@@ -6703,91 +6768,91 @@ const CheckPage = ({
6703
6768
  label: t("VENDOR_ID"),
6704
6769
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.VendorId))}`,
6705
6770
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6706
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6771
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6707
6772
  })
6708
6773
  }), /*#__PURE__*/React.createElement(Row, {
6709
6774
  label: t("VENDOR_BANK_IFSC_CODE"),
6710
6775
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.IFSC))}`,
6711
6776
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6712
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6777
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6713
6778
  })
6714
6779
  }), /*#__PURE__*/React.createElement(Row, {
6715
6780
  label: t("VENDOR_BANK_NAME"),
6716
6781
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.Bank))}`,
6717
6782
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6718
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6783
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6719
6784
  })
6720
6785
  }), /*#__PURE__*/React.createElement(Row, {
6721
6786
  label: t("VENDOR_BANK_BRANCH"),
6722
6787
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.BankbranchName))}`,
6723
6788
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6724
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6789
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6725
6790
  })
6726
6791
  }), /*#__PURE__*/React.createElement(Row, {
6727
6792
  label: t("VENDOR_MICR_NO"),
6728
6793
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.micrNo))}`,
6729
6794
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6730
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6795
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6731
6796
  })
6732
6797
  }), /*#__PURE__*/React.createElement(Row, {
6733
6798
  label: t("BANK_ACCONT_NO"),
6734
6799
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.AccountNo))}`,
6735
6800
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6736
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6801
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6737
6802
  })
6738
6803
  }), /*#__PURE__*/React.createElement(Row, {
6739
6804
  label: t("PAN_NO"),
6740
6805
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.PanNo))}`,
6741
6806
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6742
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6807
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6743
6808
  })
6744
6809
  }), /*#__PURE__*/React.createElement(Row, {
6745
6810
  label: t("GST_NO"),
6746
6811
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.GstNo))}`,
6747
6812
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6748
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6813
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6749
6814
  })
6750
6815
  }), /*#__PURE__*/React.createElement(Row, {
6751
6816
  label: t("GST_REGISTERED_STATE/UT"),
6752
6817
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.GstState))}`,
6753
6818
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6754
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-detailss`
6819
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6755
6820
  })
6756
6821
  }), /*#__PURE__*/React.createElement(Row, {
6757
6822
  label: t("REGISTRATION_NO"),
6758
6823
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.RegistrationNo))}`,
6759
6824
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6760
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6825
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6761
6826
  })
6762
6827
  }), /*#__PURE__*/React.createElement(Row, {
6763
6828
  label: t("EPF_NO"),
6764
6829
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.EpfNo))}`,
6765
6830
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6766
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6831
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6767
6832
  })
6768
6833
  }), /*#__PURE__*/React.createElement(Row, {
6769
6834
  label: t("ESI_NO"),
6770
6835
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : vendordet.EsiNo))}`,
6771
6836
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6772
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6837
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6773
6838
  })
6774
6839
  }), /*#__PURE__*/React.createElement(Row, {
6775
6840
  label: t("VENDOR_TYPE"),
6776
6841
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : (_vendordet$VendorType = vendordet.VendorType) === null || _vendordet$VendorType === void 0 ? void 0 : _vendordet$VendorType.code))}`,
6777
6842
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6778
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6843
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6779
6844
  })
6780
6845
  }), /*#__PURE__*/React.createElement(Row, {
6781
6846
  label: t("VENDOR_CATEGORY"),
6782
6847
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : (_vendordet$VendorCate = vendordet.VendorCategory) === null || _vendordet$VendorCate === void 0 ? void 0 : _vendordet$VendorCate.code))}`,
6783
6848
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6784
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6849
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6785
6850
  })
6786
6851
  }), /*#__PURE__*/React.createElement(Row, {
6787
6852
  label: t("VENDOR_STATUS"),
6788
6853
  text: `${t(checkForNA(vendordet === null || vendordet === void 0 ? void 0 : (_vendordet$Status = vendordet.Status) === null || _vendordet$Status === void 0 ? void 0 : _vendordet$Status.code))}`,
6789
6854
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
6790
- jumpTo: `/digit-ui/employee/vendor/registry/additionaldetails/vendor-details`
6855
+ jumpTo: `/digit-ui/${window.location.pathname.includes("/citizen") ? "citizen" : "employee"}/vendor/registry/additionaldetails/vendor-details`
6791
6856
  })
6792
6857
  }))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(CardSubHeader, null, t("VENDOR_DOCUMENTS_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
6793
6858
  label: t("VENDOR_DOCUMENTS"),
@@ -7214,6 +7279,7 @@ const DriverConfig = (t, disabled = false) => {
7214
7279
  };
7215
7280
 
7216
7281
  const AddDriver = () => {
7282
+ var _Digit$UserService$ge, _Digit$UserService$ge2;
7217
7283
  const tenantId = Digit.ULBService.getCurrentTenantId();
7218
7284
  const {
7219
7285
  t
@@ -7221,12 +7287,26 @@ const AddDriver = () => {
7221
7287
  const stateId = Digit.ULBService.getStateId();
7222
7288
  const [showToast, setShowToast] = useState(null);
7223
7289
  const queryClient = useQueryClient();
7290
+ const history = useHistory();
7224
7291
  const [, setMutationHappened] = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false);
7225
7292
  const [,, clearError] = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false);
7226
7293
  const [,, clearSuccessData] = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false);
7294
+ const isCitizen = Digit.UserService.getType() === "WT_VENDOR" || Digit.UserService.hasAccess(["WT_VENDOR"]);
7227
7295
  const {
7228
7296
  mutate
7229
- } = Digit.Hooks.fsm.useDriverCreate(tenantId);
7297
+ } = Digit.Hooks.fsm.useDriverCreate(stateId);
7298
+ const {
7299
+ mutate: mutateVendor
7300
+ } = Digit.Hooks.fsm.useVendorUpdate("dl.djb");
7301
+ const mobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
7302
+ const {
7303
+ data: vendorData,
7304
+ isLoading: isVendorLoading
7305
+ } = Digit.Hooks.fsm.useDsoSearch(tenantId, {
7306
+ mobileNumber: mobileNumber
7307
+ }, {
7308
+ enabled: !!(isCitizen && mobileNumber)
7309
+ });
7230
7310
  useEffect(() => {
7231
7311
  setMutationHappened(false);
7232
7312
  clearSuccessData();
@@ -7267,7 +7347,6 @@ const AddDriver = () => {
7267
7347
  const closeToast = () => {
7268
7348
  setShowToast(null);
7269
7349
  };
7270
- const isCitizen = Digit.UserService.getType() === "WT_VENDOR";
7271
7350
  console.log(isCitizen, "iscitizen");
7272
7351
  const onSubmit = data => {
7273
7352
  var _data$selectGender, _data$serviceType;
@@ -7280,7 +7359,7 @@ const AddDriver = () => {
7280
7359
  const additionalDetails = data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code;
7281
7360
  const formData = {
7282
7361
  driver: {
7283
- tenantId: !isCitizen ? "dl.djb" : tenantId,
7362
+ tenantId: "dl.djb",
7284
7363
  name: name,
7285
7364
  licenseNumber: license,
7286
7365
  status: "ACTIVE",
@@ -7309,12 +7388,56 @@ const AddDriver = () => {
7309
7388
  setTimeout(closeToast, 5000);
7310
7389
  },
7311
7390
  onSuccess: (data, variables) => {
7391
+ var _vendorData$;
7312
7392
  setShowToast({
7313
7393
  key: "success",
7314
7394
  action: "ADD_DRIVER"
7315
7395
  });
7316
7396
  setTimeout(closeToast, 5000);
7317
7397
  queryClient.invalidateQueries("FSM_DRIVER_SEARCH");
7398
+ if (isCitizen && vendorData !== null && vendorData !== void 0 && (_vendorData$ = vendorData[0]) !== null && _vendorData$ !== void 0 && _vendorData$.dsoDetails) {
7399
+ const newDriver = data.driver.map(v => ({
7400
+ ...v,
7401
+ vendorDriverStatus: "ACTIVE",
7402
+ status: "ACTIVE"
7403
+ }));
7404
+ const vendor = vendorData[0].dsoDetails;
7405
+ const updatedVendor = {
7406
+ vendor: {
7407
+ ...vendor,
7408
+ drivers: vendor.drivers ? [...vendor.drivers, ...newDriver] : [...newDriver]
7409
+ }
7410
+ };
7411
+ mutateVendor(updatedVendor, {
7412
+ onError: error => {
7413
+ setShowToast({
7414
+ key: "error",
7415
+ action: error
7416
+ });
7417
+ },
7418
+ onSuccess: () => {
7419
+ var _Digit$UserService$ge3, _Digit$UserService$ge4, _Digit$UserService$ge5;
7420
+ setShowToast({
7421
+ key: "success",
7422
+ action: "ADD_DRIVER"
7423
+ });
7424
+ queryClient.invalidateQueries("DSO_SEARCH");
7425
+ const userType = ((_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : (_Digit$UserService$ge4 = _Digit$UserService$ge3.info) === null || _Digit$UserService$ge4 === void 0 ? void 0 : (_Digit$UserService$ge5 = _Digit$UserService$ge4.type) === null || _Digit$UserService$ge5 === void 0 ? void 0 : _Digit$UserService$ge5.toLowerCase()) || "citizen";
7426
+ setTimeout(() => {
7427
+ closeToast();
7428
+ history.push(`/digit-ui/${userType}/vendor/search-vendor?selectedTabs=DRIVER`);
7429
+ }, 3000);
7430
+ }
7431
+ });
7432
+ } else {
7433
+ var _Digit$UserService$ge6, _Digit$UserService$ge7, _Digit$UserService$ge8;
7434
+ const userType = ((_Digit$UserService$ge6 = Digit.UserService.getUser()) === null || _Digit$UserService$ge6 === void 0 ? void 0 : (_Digit$UserService$ge7 = _Digit$UserService$ge6.info) === null || _Digit$UserService$ge7 === void 0 ? void 0 : (_Digit$UserService$ge8 = _Digit$UserService$ge7.type) === null || _Digit$UserService$ge8 === void 0 ? void 0 : _Digit$UserService$ge8.toLowerCase()) || "citizen";
7435
+ queryClient.invalidateQueries("FSM_DRIVER_SEARCH");
7436
+ setTimeout(() => {
7437
+ closeToast();
7438
+ history.push(`/digit-ui/${userType}/vendor/search-vendor?selectedTabs=DRIVER`);
7439
+ }, 3000);
7440
+ }
7318
7441
  }
7319
7442
  });
7320
7443
  };
@@ -7947,6 +8070,7 @@ const AddVehicle = ({
7947
8070
  parentUrl,
7948
8071
  heading
7949
8072
  }) => {
8073
+ var _Digit$UserService$ge, _Digit$UserService$ge2;
7950
8074
  const tenantId = Digit.ULBService.getCurrentTenantId();
7951
8075
  const stateId = Digit.ULBService.getStateId();
7952
8076
  const [showToast, setShowToast] = useState(null);
@@ -7958,9 +8082,22 @@ const AddVehicle = ({
7958
8082
  const [, setMutationHappened] = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false);
7959
8083
  const [,, clearError] = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false);
7960
8084
  const [,, clearSuccessData] = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false);
8085
+ const isCitizen = Digit.UserService.getType() === "WT_VENDOR" || Digit.UserService.hasAccess(["WT_VENDOR"]);
7961
8086
  const {
7962
8087
  mutate
7963
- } = Digit.Hooks.fsm.useVehicleCreate(tenantId);
8088
+ } = Digit.Hooks.fsm.useVehicleCreate(stateId);
8089
+ const {
8090
+ mutate: mutateVendor
8091
+ } = Digit.Hooks.fsm.useVendorUpdate("dl.djb");
8092
+ const mobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
8093
+ const {
8094
+ data: vendorData,
8095
+ isLoading: isVendorLoading
8096
+ } = Digit.Hooks.fsm.useDsoSearch(tenantId, {
8097
+ mobileNumber: mobileNumber
8098
+ }, {
8099
+ enabled: !!(isCitizen && mobileNumber)
8100
+ });
7964
8101
  useEffect(() => {
7965
8102
  setMutationHappened(false);
7966
8103
  clearSuccessData();
@@ -8058,10 +8195,9 @@ const AddVehicle = ({
8058
8195
  const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
8059
8196
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
8060
8197
  const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
8061
- const isCitizen = Digit.UserService.getType() === "WT_VENDOR";
8062
8198
  const formData = {
8063
8199
  vehicle: {
8064
- tenantId: !isCitizen ? "dl.djb" : tenantId,
8200
+ tenantId: "dl.djb",
8065
8201
  registrationNumber: registrationNumber,
8066
8202
  model: vehicleModal,
8067
8203
  type: vehicleType,
@@ -8086,7 +8222,8 @@ const AddVehicle = ({
8086
8222
  },
8087
8223
  additionalDetails: {
8088
8224
  serviceType: additionalDetails
8089
- }
8225
+ },
8226
+ vehicleOwner: "ULB"
8090
8227
  }
8091
8228
  };
8092
8229
  mutate(formData, {
@@ -8098,15 +8235,55 @@ const AddVehicle = ({
8098
8235
  setTimeout(closeToast, 5000);
8099
8236
  },
8100
8237
  onSuccess: (data, variables) => {
8238
+ var _vendorData$;
8101
8239
  setShowToast({
8102
8240
  key: "success",
8103
8241
  action: "ADD_VEHICLE"
8104
8242
  });
8105
8243
  queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
8106
- setTimeout(() => {
8107
- closeToast();
8108
- history.push(`/digit-ui/employee/vendor/search-vendor?selectedTabs=VEHICLE`);
8109
- }, 3000);
8244
+ if (isCitizen && vendorData !== null && vendorData !== void 0 && (_vendorData$ = vendorData[0]) !== null && _vendorData$ !== void 0 && _vendorData$.dsoDetails) {
8245
+ const newVehicle = data.vehicle.map(v => ({
8246
+ ...v,
8247
+ vendorVehicleStatus: "ACTIVE",
8248
+ status: "ACTIVE"
8249
+ }));
8250
+ const vendor = vendorData[0].dsoDetails;
8251
+ const updatedVendor = {
8252
+ vendor: {
8253
+ ...vendor,
8254
+ vehicles: vendor.vehicles ? [...vendor.vehicles, ...newVehicle] : [...newVehicle]
8255
+ }
8256
+ };
8257
+ mutateVendor(updatedVendor, {
8258
+ onError: error => {
8259
+ setShowToast({
8260
+ key: "error",
8261
+ action: error
8262
+ });
8263
+ },
8264
+ onSuccess: () => {
8265
+ var _Digit$UserService$ge3, _Digit$UserService$ge4, _Digit$UserService$ge5;
8266
+ setShowToast({
8267
+ key: "success",
8268
+ action: "ADD_VEHICLE"
8269
+ });
8270
+ queryClient.invalidateQueries("DSO_SEARCH");
8271
+ const userType = ((_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : (_Digit$UserService$ge4 = _Digit$UserService$ge3.info) === null || _Digit$UserService$ge4 === void 0 ? void 0 : (_Digit$UserService$ge5 = _Digit$UserService$ge4.type) === null || _Digit$UserService$ge5 === void 0 ? void 0 : _Digit$UserService$ge5.toLowerCase()) || "citizen";
8272
+ setTimeout(() => {
8273
+ closeToast();
8274
+ history.push(`/digit-ui/${userType}/vendor/search-vendor?selectedTabs=VEHICLE`);
8275
+ }, 3000);
8276
+ }
8277
+ });
8278
+ } else {
8279
+ var _Digit$UserService$ge6, _Digit$UserService$ge7, _Digit$UserService$ge8;
8280
+ const userType = ((_Digit$UserService$ge6 = Digit.UserService.getUser()) === null || _Digit$UserService$ge6 === void 0 ? void 0 : (_Digit$UserService$ge7 = _Digit$UserService$ge6.info) === null || _Digit$UserService$ge7 === void 0 ? void 0 : (_Digit$UserService$ge8 = _Digit$UserService$ge7.type) === null || _Digit$UserService$ge8 === void 0 ? void 0 : _Digit$UserService$ge8.toLowerCase()) || "citizen";
8281
+ queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
8282
+ setTimeout(() => {
8283
+ closeToast();
8284
+ history.push(`/digit-ui/${userType}/vendor/search-vendor?selectedTabs=VEHICLE`);
8285
+ }, 3000);
8286
+ }
8110
8287
  }
8111
8288
  });
8112
8289
  };
@@ -8600,6 +8777,16 @@ const VENDORModule = ({
8600
8777
  path,
8601
8778
  url
8602
8779
  } = useRouteMatch();
8780
+ const moduleCode = "VENDOR";
8781
+ const language = Digit.StoreData.getCurrentLanguage();
8782
+ const {
8783
+ isLoading,
8784
+ data: store
8785
+ } = Digit.Services.useStore({
8786
+ stateCode,
8787
+ moduleCode,
8788
+ language
8789
+ });
8603
8790
  addComponentsToRegistry();
8604
8791
  Digit.SessionStorage.set("VENDOR_TENANTS", tenants);
8605
8792
  useEffect(() => userType === "employee" && Digit.LocalizationService.getLocale({