@mseva/digit-ui-module-sv 1.1.49-dev.1.1 → 1.1.49-dev.1.11

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.
@@ -12425,7 +12425,20 @@ const configTLApproverApplication = ({
12425
12425
  populators: {
12426
12426
  name: "comments"
12427
12427
  }
12428
+ }, ...(checkCondtions ? [{
12429
+ label: t("TL_FORWARD_NAME_LABEL"),
12430
+ type: "text",
12431
+ populators: {
12432
+ name: "name",
12433
+ placeholder: t("TL_FORWARD_NAME_PLACEHOLDER")
12434
+ }
12428
12435
  }, {
12436
+ label: t("TL_FORWARD_DATE_LABEL"),
12437
+ type: "date",
12438
+ populators: {
12439
+ name: "date"
12440
+ }
12441
+ }] : []), {
12429
12442
  label: t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),
12430
12443
  populators: /*#__PURE__*/React.createElement(UploadFile, {
12431
12444
  id: "workflow-doc",
@@ -13543,11 +13556,19 @@ const ActionModal$1 = ({
13543
13556
  })();
13544
13557
  }, [file]);
13545
13558
  function submit(data) {
13559
+ var _applicationData;
13546
13560
  applicationData = {
13547
13561
  ...applicationData,
13548
13562
  action: action === null || action === void 0 ? void 0 : action.action,
13549
13563
  comment: data === null || data === void 0 ? void 0 : data.comments,
13550
13564
  assignee: !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? null : [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid],
13565
+ additionalDetails: {
13566
+ ...(((_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : _applicationData.additionalDetails) || {}),
13567
+ ...(data !== null && data !== void 0 && data.name || data !== null && data !== void 0 && data.date ? {
13568
+ forwardedBy: (data === null || data === void 0 ? void 0 : data.name) || "",
13569
+ forwardedDate: (data === null || data === void 0 ? void 0 : data.date) || ""
13570
+ } : {})
13571
+ },
13551
13572
  wfDocuments: uploadedFile ? [{
13552
13573
  documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
13553
13574
  fileName: file === null || file === void 0 ? void 0 : file.name,
@@ -15897,14 +15918,12 @@ const ActionModal$7 = ({
15897
15918
  businessService,
15898
15919
  moduleCode
15899
15920
  }) => {
15900
- var _tradeMdmsData$TradeL, _applicationData, _applicationData$trad;
15921
+ var _applicationData, _applicationData$trad;
15901
15922
  const stateId = Digit.ULBService.getStateId();
15902
15923
  const {
15903
15924
  data: tradeMdmsData,
15904
15925
  isLoading: tradeMdmsLoading
15905
15926
  } = Digit.Hooks.tl.useTradeLicenseMDMS(stateId, "TradeLicense", "TradeUnits", "[?(@.type=='TL')]");
15906
- console.log("tradeMdmsData", tradeMdmsData === null || tradeMdmsData === void 0 ? void 0 : (_tradeMdmsData$TradeL = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL === void 0 ? void 0 : _tradeMdmsData$TradeL.TradeType);
15907
- console.log("applicationData", applicationData);
15908
15927
  const [config, setConfig] = useState({});
15909
15928
  const [defaultValues, setDefaultValues] = useState({});
15910
15929
  const [approvers, setApprovers] = useState([]);
@@ -15914,27 +15933,41 @@ const ActionModal$7 = ({
15914
15933
  const tradeUnits = (_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : (_applicationData$trad = _applicationData.tradeLicenseDetail) === null || _applicationData$trad === void 0 ? void 0 : _applicationData$trad.tradeUnits;
15915
15934
  console.log("tradeUnits", tradeUnits);
15916
15935
  const years = useMemo(() => {
15917
- var _tradeMdmsData$TradeL2;
15936
+ var _tradeMdmsData$TradeL;
15918
15937
  if (tradeMdmsLoading || !tradeMdmsData || !tradeUnits.length) return [];
15919
15938
  const tradeTypeCodes = new Set(tradeUnits.map(unit => unit.tradeType));
15920
- const matchedTradeTypes = (_tradeMdmsData$TradeL2 = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL2 === void 0 ? void 0 : _tradeMdmsData$TradeL2.TradeType.filter(type => tradeTypeCodes.has(type.code));
15939
+ const matchedTradeTypes = (_tradeMdmsData$TradeL = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL === void 0 ? void 0 : _tradeMdmsData$TradeL.TradeType.filter(type => tradeTypeCodes.has(type.code));
15921
15940
  const hasHazardous = matchedTradeTypes.some(unit => unit === null || unit === void 0 ? void 0 : unit.ishazardous);
15922
15941
  console.log("hasHazardous", hasHazardous);
15923
15942
  if (hasHazardous) return ['1'];else return ['1', '2', '3'];
15924
15943
  }, [tradeMdmsLoading, tradeMdmsData, tradeUnits]);
15925
15944
  console.log("years", years);
15926
15945
  function submit(data) {
15927
- var _applicationData2;
15946
+ var _applicationData2, _applicationData3, _applicationData3$tra, _tradeMdmsData$TradeL2, _applicationData$trad2;
15928
15947
  let financialYear = (_applicationData2 = applicationData) === null || _applicationData2 === void 0 ? void 0 : _applicationData2.financialYear;
15929
15948
  const financialYearDate = financialYear === null || financialYear === void 0 ? void 0 : financialYear.split('-')[1];
15930
15949
  const finalFinancialYear = `20${Number(financialYearDate)}-${Number(financialYearDate) + 1}`;
15950
+ const tradeTypeCodes = new Set((((_applicationData3 = applicationData) === null || _applicationData3 === void 0 ? void 0 : (_applicationData3$tra = _applicationData3.tradeLicenseDetail) === null || _applicationData3$tra === void 0 ? void 0 : _applicationData3$tra.tradeUnits) || []).map(unit => unit.tradeType));
15951
+ const matchedTradeTypes = ((tradeMdmsData === null || tradeMdmsData === void 0 ? void 0 : (_tradeMdmsData$TradeL2 = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL2 === void 0 ? void 0 : _tradeMdmsData$TradeL2.TradeType) || []).filter(type => tradeTypeCodes.has(type.code));
15952
+ const hasHazardous = matchedTradeTypes.some(unit => unit === null || unit === void 0 ? void 0 : unit.ishazardous);
15953
+ const selectedYears = selectedApprover.length > 0 ? parseInt(selectedApprover) : 1;
15931
15954
  applicationData = {
15932
15955
  ...applicationData,
15933
15956
  financialYear: finalFinancialYear,
15934
- action: "INITIATE",
15957
+ applicationType: "RENEWAL",
15958
+ workflowCode: hasHazardous ? "NEWTL.HAZ" : "DIRECTRENEWAL",
15959
+ action: hasHazardous ? "APPLY" : "INITIATE",
15960
+ wfDocuments: null,
15935
15961
  additionalDetail: {
15936
15962
  ...applicationData.additionalDetail,
15937
15963
  validityYears: selectedApprover.length > 0 ? parseInt(selectedApprover) : ""
15964
+ },
15965
+ tradeLicenseDetail: {
15966
+ ...applicationData.tradeLicenseDetail,
15967
+ additionalDetail: {
15968
+ ...((_applicationData$trad2 = applicationData.tradeLicenseDetail) === null || _applicationData$trad2 === void 0 ? void 0 : _applicationData$trad2.additionalDetail),
15969
+ validityYears: selectedYears
15970
+ }
15938
15971
  }
15939
15972
  };
15940
15973
  submitAction({
@@ -16396,12 +16429,21 @@ const ActionModal$a = ({
16396
16429
  };
16397
16430
 
16398
16431
  const ActionModal$b = props => {
16432
+ var _props$action;
16399
16433
  if (props !== null && props !== void 0 && props.businessService.includes("PT")) {
16400
16434
  return /*#__PURE__*/React.createElement(ActionModal, props);
16401
16435
  }
16402
16436
  if (props !== null && props !== void 0 && props.businessService.includes("ptr")) {
16403
16437
  return /*#__PURE__*/React.createElement(ActionModal$6, props);
16404
16438
  }
16439
+ if ((props === null || props === void 0 ? void 0 : (_props$action = props.action) === null || _props$action === void 0 ? void 0 : _props$action.action) === "DIRECT_RENEWAL_BUTTON") {
16440
+ return /*#__PURE__*/React.createElement(ActionModal$7, Object.assign({}, props, {
16441
+ applicationData: {
16442
+ ...props.applicationData,
16443
+ workflowCode: "DIRECTRENEWAL"
16444
+ }
16445
+ }));
16446
+ }
16405
16447
  if (props !== null && props !== void 0 && props.businessService.includes("NewTL") || props !== null && props !== void 0 && props.businessService.includes("TL") || props !== null && props !== void 0 && props.businessService.includes("EDITRENEWAL")) {
16406
16448
  return /*#__PURE__*/React.createElement(ActionModal$1, props);
16407
16449
  }
@@ -19532,7 +19574,9 @@ function NewApplicationTimeline({
19532
19574
  workflowDetails,
19533
19575
  t,
19534
19576
  tenantId = Digit.ULBService.getCurrentTenantId(),
19535
- timeObj
19577
+ timeObj,
19578
+ empUserName = null,
19579
+ handleSetEmpDesignation = () => {}
19536
19580
  }) {
19537
19581
  var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _employeeData$data, _employeeData$data$Em;
19538
19582
  const {
@@ -19607,6 +19651,9 @@ function NewApplicationTimeline({
19607
19651
  const translationKey = `COMMON_MASTERS_DESIGNATION_${assignment === null || assignment === void 0 ? void 0 : assignment.designation}`;
19608
19652
  deptMap[emp === null || emp === void 0 ? void 0 : emp.code] = translationKey;
19609
19653
  });
19654
+ if (employeeData && empUserName) {
19655
+ handleSetEmpDesignation(t(deptMap[empUserName]));
19656
+ }
19610
19657
  if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
19611
19658
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19612
19659
  className: "custom-timeline-container"
@@ -19637,7 +19684,7 @@ function NewApplicationTimeline({
19637
19684
  }))), /*#__PURE__*/React.createElement("div", {
19638
19685
  className: "custom-timeline-entries"
19639
19686
  }, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map((item, index) => {
19640
- var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$assigner5, _item$assigner6, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
19687
+ var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
19641
19688
  return /*#__PURE__*/React.createElement("div", {
19642
19689
  key: index,
19643
19690
  className: "custom-timeline-entry"
@@ -19674,13 +19721,9 @@ function NewApplicationTimeline({
19674
19721
  className: "custom-officer-info"
19675
19722
  }, /*#__PURE__*/React.createElement("div", {
19676
19723
  className: "custom-officer-name"
19677
- }, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA"), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("span", {
19724
+ }, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA")), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("div", {
19678
19725
  className: "custom-officer-name"
19679
- }, "- ", t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName]))), (item === null || item === void 0 ? void 0 : (_item$assigner5 = item.assigner) === null || _item$assigner5 === void 0 ? void 0 : _item$assigner5.emailId) && /*#__PURE__*/React.createElement("div", {
19680
- className: "custom-officer-email"
19681
- }, /*#__PURE__*/React.createElement("span", {
19682
- className: "custom-email-label"
19683
- }, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.emailId))), /*#__PURE__*/React.createElement("div", {
19726
+ }, t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName])))), /*#__PURE__*/React.createElement("div", {
19684
19727
  className: "custom-card-column custom-card-column-mid"
19685
19728
  }, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
19686
19729
  className: "custom-action-title"
@@ -20115,6 +20158,22 @@ function ApplicationDetailsContent({
20115
20158
  if (isWSModule) {
20116
20159
  return;
20117
20160
  }
20161
+ if (moduleCode === "TL") {
20162
+ const appNo = applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber;
20163
+ if (!appNo) return;
20164
+ Digit.PaymentService.recieptSearch(tenantId, "TL", {
20165
+ consumerCodes: appNo
20166
+ }).then(response => {
20167
+ var _response$Payments;
20168
+ console.log("TL Payment History response:", response);
20169
+ if ((response === null || response === void 0 ? void 0 : (_response$Payments = response.Payments) === null || _response$Payments === void 0 ? void 0 : _response$Payments.length) > 0) {
20170
+ setPayments(response.Payments);
20171
+ }
20172
+ }).catch(error => {
20173
+ console.error("TL Payment search error:", error);
20174
+ });
20175
+ return;
20176
+ }
20118
20177
  if (!propertyId) {
20119
20178
  return;
20120
20179
  }
@@ -20143,7 +20202,7 @@ function ApplicationDetailsContent({
20143
20202
  } catch (error) {
20144
20203
  console.error("❌ Payment search error for PT/BPREG:", error);
20145
20204
  }
20146
- }, [moduleCode, propertyId, tenantId]);
20205
+ }, [moduleCode, propertyId, tenantId, applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber]);
20147
20206
  return /*#__PURE__*/React.createElement(Card, {
20148
20207
  style: {
20149
20208
  position: "relative"
@@ -20478,7 +20537,7 @@ function ApplicationDetailsToast({
20478
20537
  label = (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? showToast === null || showToast === void 0 ? void 0 : (_showToast$error7 = showToast.error) === null || _showToast$error7 === void 0 ? void 0 : _showToast$error7.message : t("TL_TL_CANCELLED_MESSAGE_HEAD");
20479
20538
  break;
20480
20539
  default:
20481
- label = (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? showToast === null || showToast === void 0 ? void 0 : (_showToast$error8 = showToast.error) === null || _showToast$error8 === void 0 ? void 0 : _showToast$error8.message : t(`ES_${businessService}_${showToast === null || showToast === void 0 ? void 0 : (_showToast$action2 = showToast.action) === null || _showToast$action2 === void 0 ? void 0 : _showToast$action2.action}_UPDATE_SUCCESS`);
20540
+ label = (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? (showToast === null || showToast === void 0 ? void 0 : (_showToast$error8 = showToast.error) === null || _showToast$error8 === void 0 ? void 0 : _showToast$error8.message) || (showToast === null || showToast === void 0 ? void 0 : showToast.label) : (showToast === null || showToast === void 0 ? void 0 : showToast.label) || t(`ES_${businessService}_${showToast === null || showToast === void 0 ? void 0 : (_showToast$action2 = showToast.action) === null || _showToast$action2 === void 0 ? void 0 : _showToast$action2.action}_UPDATE_SUCCESS`);
20482
20541
  }
20483
20542
  return /*#__PURE__*/React.createElement(React.Fragment, null, showToast && /*#__PURE__*/React.createElement(Toast, {
20484
20543
  error: showToast.key === "error",
@@ -20771,6 +20830,17 @@ const ApplicationDetails = props => {
20771
20830
  }
20772
20831
  if (action.action == "PAY" && window.location.href.includes("tl")) {
20773
20832
  history.push(`/digit-ui/employee/payment/collect/${applicationDetails.applicationData.businessService}/${applicationDetails.applicationData.applicationNumber}`);
20833
+ }
20834
+ if (action !== null && action !== void 0 && action.isToast) {
20835
+ console.log("➡️ isToast triggered — blocking action:", action === null || action === void 0 ? void 0 : action.action, "message:", action === null || action === void 0 ? void 0 : action.toastMessage);
20836
+ setShowToast({
20837
+ key: "error",
20838
+ error: {
20839
+ message: action === null || action === void 0 ? void 0 : action.toastMessage
20840
+ }
20841
+ });
20842
+ setTimeout(closeToast, 5000);
20843
+ return;
20774
20844
  } else if (action !== null && action !== void 0 && action.isWarningPopUp) {
20775
20845
  setWarningPopUp(true);
20776
20846
  } else if (action !== null && action !== void 0 && action.redirectionUrll) {