@mseva/upyog-ui-module-asset 1.1.44-dev.1.1 → 1.1.44-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.
@@ -8163,7 +8163,20 @@ const configTLApproverApplication = ({
8163
8163
  populators: {
8164
8164
  name: "comments"
8165
8165
  }
8166
+ }, ...(checkCondtions ? [{
8167
+ label: t("TL_FORWARD_NAME_LABEL"),
8168
+ type: "text",
8169
+ populators: {
8170
+ name: "name",
8171
+ placeholder: t("TL_FORWARD_NAME_PLACEHOLDER")
8172
+ }
8166
8173
  }, {
8174
+ label: t("TL_FORWARD_DATE_LABEL"),
8175
+ type: "date",
8176
+ populators: {
8177
+ name: "date"
8178
+ }
8179
+ }] : []), {
8167
8180
  label: t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),
8168
8181
  populators: /*#__PURE__*/React.createElement(UploadFile, {
8169
8182
  id: "workflow-doc",
@@ -9281,11 +9294,19 @@ const ActionModal$1 = ({
9281
9294
  })();
9282
9295
  }, [file]);
9283
9296
  function submit(data) {
9297
+ var _applicationData;
9284
9298
  applicationData = {
9285
9299
  ...applicationData,
9286
9300
  action: action === null || action === void 0 ? void 0 : action.action,
9287
9301
  comment: data === null || data === void 0 ? void 0 : data.comments,
9288
9302
  assignee: !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? null : [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid],
9303
+ additionalDetails: {
9304
+ ...(((_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : _applicationData.additionalDetails) || {}),
9305
+ ...(data !== null && data !== void 0 && data.name || data !== null && data !== void 0 && data.date ? {
9306
+ forwardedBy: (data === null || data === void 0 ? void 0 : data.name) || "",
9307
+ forwardedDate: (data === null || data === void 0 ? void 0 : data.date) || ""
9308
+ } : {})
9309
+ },
9289
9310
  wfDocuments: uploadedFile ? [{
9290
9311
  documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
9291
9312
  fileName: file === null || file === void 0 ? void 0 : file.name,
@@ -11635,14 +11656,12 @@ const ActionModal$7 = ({
11635
11656
  businessService,
11636
11657
  moduleCode
11637
11658
  }) => {
11638
- var _tradeMdmsData$TradeL, _applicationData, _applicationData$trad;
11659
+ var _applicationData, _applicationData$trad;
11639
11660
  const stateId = Digit.ULBService.getStateId();
11640
11661
  const {
11641
11662
  data: tradeMdmsData,
11642
11663
  isLoading: tradeMdmsLoading
11643
11664
  } = Digit.Hooks.tl.useTradeLicenseMDMS(stateId, "TradeLicense", "TradeUnits", "[?(@.type=='TL')]");
11644
- console.log("tradeMdmsData", tradeMdmsData === null || tradeMdmsData === void 0 ? void 0 : (_tradeMdmsData$TradeL = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL === void 0 ? void 0 : _tradeMdmsData$TradeL.TradeType);
11645
- console.log("applicationData", applicationData);
11646
11665
  const [config, setConfig] = useState({});
11647
11666
  const [defaultValues, setDefaultValues] = useState({});
11648
11667
  const [approvers, setApprovers] = useState([]);
@@ -11652,27 +11671,41 @@ const ActionModal$7 = ({
11652
11671
  const tradeUnits = (_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : (_applicationData$trad = _applicationData.tradeLicenseDetail) === null || _applicationData$trad === void 0 ? void 0 : _applicationData$trad.tradeUnits;
11653
11672
  console.log("tradeUnits", tradeUnits);
11654
11673
  const years = useMemo(() => {
11655
- var _tradeMdmsData$TradeL2;
11674
+ var _tradeMdmsData$TradeL;
11656
11675
  if (tradeMdmsLoading || !tradeMdmsData || !tradeUnits.length) return [];
11657
11676
  const tradeTypeCodes = new Set(tradeUnits.map(unit => unit.tradeType));
11658
- const matchedTradeTypes = (_tradeMdmsData$TradeL2 = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL2 === void 0 ? void 0 : _tradeMdmsData$TradeL2.TradeType.filter(type => tradeTypeCodes.has(type.code));
11677
+ const matchedTradeTypes = (_tradeMdmsData$TradeL = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL === void 0 ? void 0 : _tradeMdmsData$TradeL.TradeType.filter(type => tradeTypeCodes.has(type.code));
11659
11678
  const hasHazardous = matchedTradeTypes.some(unit => unit === null || unit === void 0 ? void 0 : unit.ishazardous);
11660
11679
  console.log("hasHazardous", hasHazardous);
11661
11680
  if (hasHazardous) return ['1'];else return ['1', '2', '3'];
11662
11681
  }, [tradeMdmsLoading, tradeMdmsData, tradeUnits]);
11663
11682
  console.log("years", years);
11664
11683
  function submit(data) {
11665
- var _applicationData2;
11684
+ var _applicationData2, _applicationData3, _applicationData3$tra, _tradeMdmsData$TradeL2, _applicationData$trad2;
11666
11685
  let financialYear = (_applicationData2 = applicationData) === null || _applicationData2 === void 0 ? void 0 : _applicationData2.financialYear;
11667
11686
  const financialYearDate = financialYear === null || financialYear === void 0 ? void 0 : financialYear.split('-')[1];
11668
11687
  const finalFinancialYear = `20${Number(financialYearDate)}-${Number(financialYearDate) + 1}`;
11688
+ 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));
11689
+ 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));
11690
+ const hasHazardous = matchedTradeTypes.some(unit => unit === null || unit === void 0 ? void 0 : unit.ishazardous);
11691
+ const selectedYears = selectedApprover.length > 0 ? parseInt(selectedApprover) : 1;
11669
11692
  applicationData = {
11670
11693
  ...applicationData,
11671
11694
  financialYear: finalFinancialYear,
11672
- action: "INITIATE",
11695
+ applicationType: "RENEWAL",
11696
+ workflowCode: hasHazardous ? "NEWTL.HAZ" : "DIRECTRENEWAL",
11697
+ action: hasHazardous ? "APPLY" : "INITIATE",
11698
+ wfDocuments: null,
11673
11699
  additionalDetail: {
11674
11700
  ...applicationData.additionalDetail,
11675
11701
  validityYears: selectedApprover.length > 0 ? parseInt(selectedApprover) : ""
11702
+ },
11703
+ tradeLicenseDetail: {
11704
+ ...applicationData.tradeLicenseDetail,
11705
+ additionalDetail: {
11706
+ ...((_applicationData$trad2 = applicationData.tradeLicenseDetail) === null || _applicationData$trad2 === void 0 ? void 0 : _applicationData$trad2.additionalDetail),
11707
+ validityYears: selectedYears
11708
+ }
11676
11709
  }
11677
11710
  };
11678
11711
  submitAction({
@@ -12134,12 +12167,21 @@ const ActionModal$a = ({
12134
12167
  };
12135
12168
 
12136
12169
  const ActionModal$b = props => {
12170
+ var _props$action;
12137
12171
  if (props !== null && props !== void 0 && props.businessService.includes("PT")) {
12138
12172
  return /*#__PURE__*/React.createElement(ActionModal, props);
12139
12173
  }
12140
12174
  if (props !== null && props !== void 0 && props.businessService.includes("ptr")) {
12141
12175
  return /*#__PURE__*/React.createElement(ActionModal$6, props);
12142
12176
  }
12177
+ 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") {
12178
+ return /*#__PURE__*/React.createElement(ActionModal$7, Object.assign({}, props, {
12179
+ applicationData: {
12180
+ ...props.applicationData,
12181
+ workflowCode: "DIRECTRENEWAL"
12182
+ }
12183
+ }));
12184
+ }
12143
12185
  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")) {
12144
12186
  return /*#__PURE__*/React.createElement(ActionModal$1, props);
12145
12187
  }
@@ -15270,7 +15312,9 @@ function NewApplicationTimeline({
15270
15312
  workflowDetails,
15271
15313
  t,
15272
15314
  tenantId = Digit.ULBService.getCurrentTenantId(),
15273
- timeObj
15315
+ timeObj,
15316
+ empUserName = null,
15317
+ handleSetEmpDesignation = () => {}
15274
15318
  }) {
15275
15319
  var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _employeeData$data, _employeeData$data$Em;
15276
15320
  const {
@@ -15345,6 +15389,9 @@ function NewApplicationTimeline({
15345
15389
  const translationKey = `COMMON_MASTERS_DESIGNATION_${assignment === null || assignment === void 0 ? void 0 : assignment.designation}`;
15346
15390
  deptMap[emp === null || emp === void 0 ? void 0 : emp.code] = translationKey;
15347
15391
  });
15392
+ if (employeeData && empUserName) {
15393
+ handleSetEmpDesignation(t(deptMap[empUserName]));
15394
+ }
15348
15395
  if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
15349
15396
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
15350
15397
  className: "custom-timeline-container"
@@ -15375,7 +15422,7 @@ function NewApplicationTimeline({
15375
15422
  }))), /*#__PURE__*/React.createElement("div", {
15376
15423
  className: "custom-timeline-entries"
15377
15424
  }, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map((item, index) => {
15378
- 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;
15425
+ 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;
15379
15426
  return /*#__PURE__*/React.createElement("div", {
15380
15427
  key: index,
15381
15428
  className: "custom-timeline-entry"
@@ -15412,13 +15459,9 @@ function NewApplicationTimeline({
15412
15459
  className: "custom-officer-info"
15413
15460
  }, /*#__PURE__*/React.createElement("div", {
15414
15461
  className: "custom-officer-name"
15415
- }, (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", {
15462
+ }, (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", {
15416
15463
  className: "custom-officer-name"
15417
- }, "- ", 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", {
15418
- className: "custom-officer-email"
15419
- }, /*#__PURE__*/React.createElement("span", {
15420
- className: "custom-email-label"
15421
- }, 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", {
15464
+ }, 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", {
15422
15465
  className: "custom-card-column custom-card-column-mid"
15423
15466
  }, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
15424
15467
  className: "custom-action-title"
@@ -15853,6 +15896,22 @@ function ApplicationDetailsContent({
15853
15896
  if (isWSModule) {
15854
15897
  return;
15855
15898
  }
15899
+ if (moduleCode === "TL") {
15900
+ const appNo = applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber;
15901
+ if (!appNo) return;
15902
+ Digit.PaymentService.recieptSearch(tenantId, "TL", {
15903
+ consumerCodes: appNo
15904
+ }).then(response => {
15905
+ var _response$Payments;
15906
+ console.log("TL Payment History response:", response);
15907
+ if ((response === null || response === void 0 ? void 0 : (_response$Payments = response.Payments) === null || _response$Payments === void 0 ? void 0 : _response$Payments.length) > 0) {
15908
+ setPayments(response.Payments);
15909
+ }
15910
+ }).catch(error => {
15911
+ console.error("TL Payment search error:", error);
15912
+ });
15913
+ return;
15914
+ }
15856
15915
  if (!propertyId) {
15857
15916
  return;
15858
15917
  }
@@ -15881,7 +15940,7 @@ function ApplicationDetailsContent({
15881
15940
  } catch (error) {
15882
15941
  console.error("❌ Payment search error for PT/BPREG:", error);
15883
15942
  }
15884
- }, [moduleCode, propertyId, tenantId]);
15943
+ }, [moduleCode, propertyId, tenantId, applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationNumber]);
15885
15944
  return /*#__PURE__*/React.createElement(Card, {
15886
15945
  style: {
15887
15946
  position: "relative"
@@ -16216,7 +16275,7 @@ function ApplicationDetailsToast({
16216
16275
  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");
16217
16276
  break;
16218
16277
  default:
16219
- 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`);
16278
+ 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`);
16220
16279
  }
16221
16280
  return /*#__PURE__*/React.createElement(React.Fragment, null, showToast && /*#__PURE__*/React.createElement(Toast, {
16222
16281
  error: showToast.key === "error",
@@ -16509,6 +16568,17 @@ const ApplicationDetails = props => {
16509
16568
  }
16510
16569
  if (action.action == "PAY" && window.location.href.includes("tl")) {
16511
16570
  history.push(`/digit-ui/employee/payment/collect/${applicationDetails.applicationData.businessService}/${applicationDetails.applicationData.applicationNumber}`);
16571
+ }
16572
+ if (action !== null && action !== void 0 && action.isToast) {
16573
+ 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);
16574
+ setShowToast({
16575
+ key: "error",
16576
+ error: {
16577
+ message: action === null || action === void 0 ? void 0 : action.toastMessage
16578
+ }
16579
+ });
16580
+ setTimeout(closeToast, 5000);
16581
+ return;
16512
16582
  } else if (action !== null && action !== void 0 && action.isWarningPopUp) {
16513
16583
  setWarningPopUp(true);
16514
16584
  } else if (action !== null && action !== void 0 && action.redirectionUrll) {