finance-shared 0.0.10 → 0.0.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.
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
5
- import { Dialog as Dialog$1, DialogTitle, DialogContent as DialogContent$1, DialogContentText, DialogActions as DialogActions$1, Button as Button$1, IconButton as IconButton$1, Typography as Typography$1, Box as Box$1, Tooltip, Zoom, TextField as TextField$1, Paper as Paper$1, Grid as Grid$1, styled as styled$3, CircularProgress as CircularProgress$1, Autocomplete as Autocomplete$1, Badge, Checkbox as Checkbox$1, Chip as Chip$1, Divider, RadioGroup, FormControlLabel, Radio, Popover as Popover$1 } from "@mui/material";
5
+ import { Dialog as Dialog$1, DialogTitle, DialogContent as DialogContent$1, DialogContentText, DialogActions as DialogActions$1, Button as Button$1, Typography as Typography$1, IconButton as IconButton$1, Box as Box$1, Tooltip, Zoom, TextField as TextField$1, Paper as Paper$1, Grid as Grid$1, styled as styled$3, CircularProgress as CircularProgress$1, Autocomplete as Autocomplete$1, Badge, Checkbox as Checkbox$1, Chip as Chip$1, Divider, RadioGroup, FormControlLabel, Radio, Popover as Popover$1 } from "@mui/material";
6
6
  import * as React from "react";
7
7
  import React__default, { createContext, useContext, useCallback, useState, useRef, useEffect, isValidElement, cloneElement, Children, memo, createElement, useMemo } from "react";
8
8
  import { unstable_createGetCssVar, createSpacing as createSpacing$1, useTheme as useTheme$3, GlobalStyles as GlobalStyles$1, unstable_memoTheme, css, keyframes, styled as styled$2, createBox, darken as darken$1, unstable_resolveBreakpointValues, handleBreakpoints as handleBreakpoints$1, alpha as alpha$1 } from "@mui/system";
@@ -2509,6 +2509,7 @@ const locale$3 = {
2509
2509
  REMARKS: "Remarks",
2510
2510
  REMOVE_FILE: "Remove File",
2511
2511
  NO_REMARKS_ADDED: "No remarks added",
2512
+ NO_REMARK: "No Remark",
2512
2513
  SUPPORT_FILE: "Supported files",
2513
2514
  CREATED_BY: "Added By",
2514
2515
  DELETE: "Delete",
@@ -2540,7 +2541,12 @@ const locale$3 = {
2540
2541
  REFERRAL_DETAIL_REMARKS: "Referral Detail Remarks",
2541
2542
  RELATIVE_DETAIL_REMARKS: "Relative Detail Remarks",
2542
2543
  NEXT_OF_KIN_DETAIL_REMARKS: "Next Of Kin Detail Remarks",
2543
- DOCUMENTS_REMARKS: "Documents Remarks"
2544
+ DOCUMENTS_REMARKS: "Documents Remarks",
2545
+ LOAN_AMOUNT: "Loan Amount",
2546
+ INTEREST_RATE: "Interest Rate",
2547
+ FEES_DEDUCTION: "Fees Deduction",
2548
+ REPAYMENT_AMOUNT: "Repayment Amount",
2549
+ CASH_IN_HAND: "Cash In Hand"
2544
2550
  };
2545
2551
  const locale$2 = {
2546
2552
  CHANGE_DETECT_TITLE: "Adakah anda pasti mahu membuang perubahan?",
@@ -2564,6 +2570,7 @@ const locale$2 = {
2564
2570
  ASSIGN_TO: "Tugaskan Kepada",
2565
2571
  REMARKS: "Kenyataan",
2566
2572
  NO_REMARKS_ADDED: "Tiada komen ditambah",
2573
+ NO_REMARK: "Tiada Catatan",
2567
2574
  SUPPORT_FILE: "Fail yang disokong",
2568
2575
  CREATED_BY: "Ditambah Oleh",
2569
2576
  DELETE: "Padam",
@@ -2595,7 +2602,12 @@ const locale$2 = {
2595
2602
  REFERRAL_DETAIL_REMARKS: "Catatan Perincian Rujukan",
2596
2603
  RELATIVE_DETAIL_REMARKS: "Catatan Perincian Relatif",
2597
2604
  NEXT_OF_KIN_DETAIL_REMARKS: "Ucapan Perincian Keluarga Seterusnya",
2598
- DOCUMENTS_REMARKS: "Documents Remarks"
2605
+ DOCUMENTS_REMARKS: "Documents Remarks",
2606
+ LOAN_AMOUNT: "Jumlah Pinjaman",
2607
+ INTEREST_RATE: "Kadar Faedah",
2608
+ FEES_DEDUCTION: "Potongan Yuran",
2609
+ REPAYMENT_AMOUNT: "Amaun Bayaran Balik",
2610
+ CASH_IN_HAND: "Wang tunai di tangan"
2599
2611
  };
2600
2612
  instance.addResourceBundle("en", "Dialog", locale$3);
2601
2613
  instance.addResourceBundle("ms", "Dialog", locale$2);
@@ -2606,7 +2618,8 @@ const ConfirmDialog = ({
2606
2618
  cancelText,
2607
2619
  okText,
2608
2620
  handleClose,
2609
- handleConfirm
2621
+ handleConfirm,
2622
+ capitalize: capitalize2 = false
2610
2623
  }) => {
2611
2624
  const { t: t2 } = useTranslation("Dialog");
2612
2625
  return /* @__PURE__ */ jsxs(
@@ -2620,8 +2633,8 @@ const ConfirmDialog = ({
2620
2633
  /* @__PURE__ */ jsx(DialogTitle, { id: "alert-dialog-title", children: title }),
2621
2634
  description && /* @__PURE__ */ jsx(DialogContent$1, { children: /* @__PURE__ */ jsx(DialogContentText, { id: "alert-dialog-description", children: description }) }),
2622
2635
  /* @__PURE__ */ jsxs(DialogActions$1, { children: [
2623
- /* @__PURE__ */ jsx(Button$1, { onClick: handleClose, children: cancelText || t2("CANCEL") }),
2624
- /* @__PURE__ */ jsx(Button$1, { onClick: handleConfirm, color: "primary", autoFocus: true, children: okText || t2("OK") })
2636
+ /* @__PURE__ */ jsx(Button$1, { onClick: handleClose, className: capitalize2 ? "capitalize" : "lowercase", children: cancelText || t2("CANCEL") }),
2637
+ /* @__PURE__ */ jsx(Button$1, { onClick: handleConfirm, autoFocus: true, className: capitalize2 ? "capitalize" : "lowercase", children: okText || t2("OK") })
2625
2638
  ] })
2626
2639
  ]
2627
2640
  }
@@ -8285,9 +8298,10 @@ function CustomDialog({
8285
8298
  onClose,
8286
8299
  content,
8287
8300
  size,
8301
+ maxWidth: maxWidth2,
8288
8302
  hideCloseIcon = false
8289
8303
  }) {
8290
- const dialogSize = size || "md";
8304
+ const dialogSize = maxWidth2 !== void 0 ? maxWidth2 : size || "md";
8291
8305
  const handleClose = (_event, reason) => {
8292
8306
  if (hideCloseIcon && reason && reason === "backdropClick") return;
8293
8307
  onClose();
@@ -8302,6 +8316,7 @@ function CustomDialog({
8302
8316
  children: [
8303
8317
  /* @__PURE__ */ jsxs(DialogTitle, { children: [
8304
8318
  content.title,
8319
+ content.description && /* @__PURE__ */ jsx(Typography$1, { variant: "body2", color: "text.secondary", className: "mb-5 text-14 font-400 italic", children: content.description }),
8305
8320
  !hideCloseIcon && /* @__PURE__ */ jsx(
8306
8321
  IconButton$1,
8307
8322
  {
@@ -20164,7 +20179,7 @@ function setLocalStorageItem(key, value) {
20164
20179
  function removeLocalStorageItem(key) {
20165
20180
  localStorage.removeItem(key);
20166
20181
  }
20167
- function formatAmount({ num, showCurrency = true }) {
20182
+ function formatAmount(num, showCurrency = true) {
20168
20183
  if (num === null || num === void 0 || typeof num !== "number" && isNaN(Number(num))) {
20169
20184
  return showCurrency ? "RM 00.00" : "00.00";
20170
20185
  }
@@ -20183,9 +20198,9 @@ const getSectionTitle = (sectionName) => {
20183
20198
  UserIncomeDetail: "INCOME_DETAIL_REMARKS",
20184
20199
  UserAdditionalInformation: "ADDITONAL_INFORMATION_REMARKS",
20185
20200
  UserExistingFinance: "EXISTING_FINANCE_DETAIL_REMARKS",
20186
- UserReferral: "REFERRAL_DETAIL_REMARKS",
20187
- UserRelative: "RELATIVE_DETAIL_REMARKS",
20188
- UserNextOfKin: "NEXT_OF_KIN_DETAIL_REMARKS",
20201
+ UserReferralDetail: "REFERRAL_DETAIL_REMARKS",
20202
+ UserRelativeDetail: "RELATIVE_DETAIL_REMARKS",
20203
+ UserNextofkin: "NEXT_OF_KIN_DETAIL_REMARKS",
20189
20204
  UserDocuments: "DOCUMENTS_REMARKS"
20190
20205
  };
20191
20206
  return sectionTitleMap[sectionName] || "";
@@ -21704,6 +21719,9 @@ function FuseMessage() {
21704
21719
  );
21705
21720
  }
21706
21721
  const FuseMessage$1 = memo(FuseMessage);
21722
+ const MessageOutlinedIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
21723
+ d: "M4 4h16v12H5.17L4 17.17zm0-2c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm2 10h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"
21724
+ }), "MessageOutlined");
21707
21725
  const PendingActionsIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
21708
21726
  d: "M17 12c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m1.65 7.35L16.5 17.2V14h1v2.79l1.85 1.85zM18 3h-3.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H6c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h6.11c-.59-.57-1.07-1.25-1.42-2H6V5h2v3h8V5h2v5.08c.71.1 1.38.31 2 .6V5c0-1.1-.9-2-2-2m-6 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"
21709
21727
  }), "PendingActions");
@@ -27757,9 +27775,13 @@ const defaultValues$1 = {
27757
27775
  assignedToUserId: ""
27758
27776
  };
27759
27777
  function RemarksDialog({
27778
+ variant = "simple",
27760
27779
  sectionName,
27780
+ sectionTitle: propSectionTitle,
27761
27781
  financeApplicationId,
27762
27782
  tenantId,
27783
+ remarksList: propRemarksList,
27784
+ onRemarkUpdate,
27763
27785
  permissions = {},
27764
27786
  isApplicationRejected = false,
27765
27787
  ReassignStaffFormComponent,
@@ -27775,7 +27797,7 @@ function RemarksDialog({
27775
27797
  } = permissions;
27776
27798
  const { t: t2 } = useTranslation("Dialog");
27777
27799
  const dispatch = useDispatch();
27778
- const sectionTitle = getSectionTitle(sectionName);
27800
+ const sectionTitle = propSectionTitle || getSectionTitle(sectionName);
27779
27801
  const [open, setOpen] = useState(false);
27780
27802
  const [hasOpened, setHasOpened] = useState(false);
27781
27803
  const [localPendingCount, setLocalPendingCount] = useState(null);
@@ -27784,14 +27806,16 @@ function RemarksDialog({
27784
27806
  remarkId: null,
27785
27807
  remarkDetails: null
27786
27808
  });
27787
- const remarksList = useSelector(getRemarkListData);
27809
+ const reduxRemarksList = useSelector(getRemarkListData);
27788
27810
  const isFormLoading = useSelector(getIsAddRemarkFormLoading);
27811
+ const remarksList = variant === "simple" ? propRemarksList || [] : reduxRemarksList;
27789
27812
  const pendingRemarksCount = remarksList.filter(
27790
- (remark) => !remark.hasActionTaken && remark.sectionName === sectionName
27813
+ (remark) => {
27814
+ const isActionTaken = variant === "simple" ? remark.hasActionTakenByCustomer : remark.hasActionTaken;
27815
+ return !isActionTaken && (variant === "simple" || remark.sectionName === sectionName);
27816
+ }
27791
27817
  ).length;
27792
- const isSectionDataLoaded = !!remarksList.find(
27793
- (remark) => remark.sectionName === sectionName
27794
- );
27818
+ const isSectionDataLoaded = variant === "simple" ? true : !!reduxRemarksList.find((remark) => remark.sectionName === sectionName);
27795
27819
  useEffect(() => {
27796
27820
  if (isSectionDataLoaded) {
27797
27821
  setLocalPendingCount(pendingRemarksCount);
@@ -27828,17 +27852,27 @@ function RemarksDialog({
27828
27852
  name: "remarkType"
27829
27853
  });
27830
27854
  useEffect(() => {
27831
- if (open && financeApplicationId) {
27855
+ if (variant === "full" && open && financeApplicationId) {
27832
27856
  dispatch(getRemarkListByFinanceApplicationId({
27833
27857
  financeApplicationId,
27834
27858
  SectionName: sectionName
27835
27859
  }));
27836
27860
  }
27837
- }, [open, financeApplicationId, sectionName, dispatch]);
27861
+ }, [variant, open, financeApplicationId, sectionName, dispatch]);
27838
27862
  const handleToggleRemark = (index) => {
27839
27863
  const remark = remarksList[index];
27840
- const updatedRemark = { ...remark, hasActionTaken: !remark.hasActionTaken };
27841
- dispatch(updateRemark(updatedRemark));
27864
+ if (variant === "simple") {
27865
+ const updatedRemark = {
27866
+ ...remark,
27867
+ hasActionTakenByCustomer: !remark.hasActionTakenByCustomer
27868
+ };
27869
+ if (onRemarkUpdate) {
27870
+ onRemarkUpdate(updatedRemark);
27871
+ }
27872
+ } else {
27873
+ const updatedRemark = { ...remark, hasActionTaken: !remark.hasActionTaken };
27874
+ dispatch(updateRemark(updatedRemark));
27875
+ }
27842
27876
  };
27843
27877
  const handleOpen = () => {
27844
27878
  setOpen(true);
@@ -27890,19 +27924,25 @@ function RemarksDialog({
27890
27924
  }
27891
27925
  };
27892
27926
  return /* @__PURE__ */ jsxs(Fragment, { children: [
27893
- /* @__PURE__ */ jsx(Badge, { badgeContent: displayCount, color: "error", children: /* @__PURE__ */ jsx(
27894
- Button$1,
27895
- {
27896
- "data-test-id": dataTestId,
27897
- className: "rounded",
27898
- variant: "contained",
27899
- size: "small",
27900
- startIcon: /* @__PURE__ */ jsx(PendingActionsIcon, {}),
27901
- onClick: handleOpen,
27902
- sx: remarksButtonStyle,
27903
- children: t2("REMARKS")
27904
- }
27905
- ) }),
27927
+ variant === "simple" ? (
27928
+ // Simple variant: Icon button trigger
27929
+ remarksList.length > 0 && /* @__PURE__ */ jsx(IconButton$1, { onClick: handleOpen, className: "m-0 p-3", children: /* @__PURE__ */ jsx(Badge, { badgeContent: remarksList.length, color: "error", className: "text-white", children: /* @__PURE__ */ jsx(MessageOutlinedIcon, { color: "warning" }) }) })
27930
+ ) : (
27931
+ // Full variant: Button trigger
27932
+ /* @__PURE__ */ jsx(Badge, { badgeContent: displayCount, color: "error", children: /* @__PURE__ */ jsx(
27933
+ Button$1,
27934
+ {
27935
+ "data-test-id": dataTestId,
27936
+ className: "rounded",
27937
+ variant: "contained",
27938
+ size: "small",
27939
+ startIcon: /* @__PURE__ */ jsx(PendingActionsIcon, {}),
27940
+ onClick: handleOpen,
27941
+ sx: remarksButtonStyle,
27942
+ children: t2("REMARKS")
27943
+ }
27944
+ ) })
27945
+ ),
27906
27946
  /* @__PURE__ */ jsxs(
27907
27947
  Dialog$1,
27908
27948
  {
@@ -27932,99 +27972,103 @@ function RemarksDialog({
27932
27972
  )
27933
27973
  ] }),
27934
27974
  /* @__PURE__ */ jsxs(DialogContent$1, { children: [
27935
- canViewRemarks && ((remarksList == null ? void 0 : remarksList.length) === 0 ? /* @__PURE__ */ jsx(Typography$1, { variant: "body1", align: "center", className: "mb-8", children: t2("NO_REMARKS_ADDED") }) : remarksList == null ? void 0 : remarksList.map((remark, index) => /* @__PURE__ */ jsxs("div", { className: "mb-8", children: [
27936
- /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
27975
+ canViewRemarks && ((remarksList == null ? void 0 : remarksList.length) === 0 ? /* @__PURE__ */ jsx(Typography$1, { variant: "body1", align: "center", className: "mb-8", children: variant === "simple" ? t2("NO_REMARK") : t2("NO_REMARKS_ADDED") }) : remarksList == null ? void 0 : remarksList.map((remark, index) => {
27976
+ const isChecked = variant === "simple" ? remark.hasActionTakenByCustomer : remark.hasActionTaken;
27977
+ return /* @__PURE__ */ jsxs("div", { className: "mb-8", children: [
27937
27978
  /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
27938
- canToggleAction && /* @__PURE__ */ jsx(
27939
- Tooltip,
27979
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
27980
+ canToggleAction && /* @__PURE__ */ jsx(
27981
+ Tooltip,
27982
+ {
27983
+ title: isApplicationRejected ? t2("REJECTED_TOOLTIP") : "",
27984
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
27985
+ Checkbox$1,
27986
+ {
27987
+ checked: isChecked,
27988
+ onChange: () => handleToggleRemark(index),
27989
+ disabled: isApplicationRejected
27990
+ }
27991
+ ) })
27992
+ }
27993
+ ),
27994
+ /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx(Typography$1, { variant: "body1", children: isChecked ? /* @__PURE__ */ jsx("s", { children: remark.remark }) : remark.remark }) })
27995
+ ] }),
27996
+ variant === "full" && /* @__PURE__ */ jsx("div", { className: "ml-10", children: /* @__PURE__ */ jsx(
27997
+ Chip$1,
27940
27998
  {
27941
- title: isApplicationRejected ? t2("REJECTED_TOOLTIP") : "",
27942
- children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
27943
- Checkbox$1,
27944
- {
27945
- checked: remark.hasActionTaken,
27946
- onChange: () => handleToggleRemark(index),
27947
- disabled: isApplicationRejected
27948
- }
27949
- ) })
27999
+ sx: {
28000
+ backgroundColor: (remark == null ? void 0 : remark.remarkType) === "Internal" ? themesConfig.internalChipBg || "#90EE90" : themesConfig.externalChipBg || "#87CEEB"
28001
+ },
28002
+ size: "small",
28003
+ label: remark.remarkType
27950
28004
  }
27951
- ),
27952
- /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx(Typography$1, { variant: "body1", children: remark.remark }) })
28005
+ ) })
27953
28006
  ] }),
27954
- /* @__PURE__ */ jsx("div", { className: "ml-10", children: /* @__PURE__ */ jsx(
27955
- Chip$1,
28007
+ variant === "full" && /* @__PURE__ */ jsxs(
28008
+ "div",
27956
28009
  {
27957
- sx: {
27958
- backgroundColor: (remark == null ? void 0 : remark.remarkType) === "Internal" ? themesConfig.internalChipBg || "#90EE90" : themesConfig.externalChipBg || "#87CEEB"
27959
- },
27960
- size: "small",
27961
- label: remark.remarkType
27962
- }
27963
- ) })
27964
- ] }),
27965
- /* @__PURE__ */ jsxs(
27966
- "div",
27967
- {
27968
- className: `flex items-center justify-between ${!canToggleAction ? "ml-40" : ""} mb-10`,
27969
- children: [
27970
- (remark == null ? void 0 : remark.createdBy) && /* @__PURE__ */ jsxs(
27971
- Typography$1,
27972
- {
27973
- variant: "body2",
27974
- className: "italic text-sm text-grey-700",
27975
- children: [
27976
- t2("CREATED_BY"),
27977
- " : ",
27978
- remark == null ? void 0 : remark.createdBy
27979
- ]
27980
- }
27981
- ),
27982
- (remark == null ? void 0 : remark.assignedToUserName) && /* @__PURE__ */ jsxs(
27983
- Typography$1,
27984
- {
27985
- variant: "body2",
27986
- className: "italic text-sm text-grey-700",
27987
- children: [
27988
- t2("ASSIGN_TO"),
27989
- " : ",
27990
- remark.assignedToUserName,
27991
- ReassignStaffFormComponent && /* @__PURE__ */ jsx(
27992
- IconButton$1,
27993
- {
27994
- onClick: (event) => handleReassignStaffMember(event, remark),
27995
- size: "small",
27996
- children: /* @__PURE__ */ jsx(EditIcon, { fontSize: "small" })
27997
- }
27998
- )
27999
- ]
28000
- }
28001
- ),
28002
- ReassignStaffFormComponent && (popoverState == null ? void 0 : popoverState.remarkDetails) && /* @__PURE__ */ jsx(
28003
- ReassignStaffFormComponent,
28004
- {
28005
- open: popoverState.remarkId === remark.id,
28006
- anchorEl: popoverState.anchorEl,
28007
- onClose: handleCloseReassignStaffMemberPopover,
28008
- remarkDetails: popoverState.remarkDetails,
28009
- onReassign: (remarkId, newUserId) => {
28010
- dispatch(reassignStaffMember(remarkId, newUserId, remarksList));
28010
+ className: `flex items-center justify-between ${!canToggleAction ? "ml-40" : ""} mb-10`,
28011
+ children: [
28012
+ (remark == null ? void 0 : remark.createdBy) && /* @__PURE__ */ jsxs(
28013
+ Typography$1,
28014
+ {
28015
+ variant: "body2",
28016
+ className: "italic text-sm text-grey-700",
28017
+ children: [
28018
+ t2("CREATED_BY"),
28019
+ " : ",
28020
+ remark == null ? void 0 : remark.createdBy
28021
+ ]
28011
28022
  }
28012
- }
28013
- ),
28014
- /* @__PURE__ */ jsx(
28015
- Typography$1,
28016
- {
28017
- variant: "body2",
28018
- className: "italic ml-2 text-sm text-grey-700",
28019
- children: remark.created
28020
- }
28021
- )
28022
- ]
28023
- }
28024
- ),
28025
- /* @__PURE__ */ jsx(Divider, {})
28026
- ] }, remark.id))),
28027
- canCreateRemark && !isApplicationRejected && /* @__PURE__ */ jsxs(Paper$1, { elevation: 3, className: "p-20 mt-20", children: [
28023
+ ),
28024
+ (remark == null ? void 0 : remark.assignedToUserName) && /* @__PURE__ */ jsxs(
28025
+ Typography$1,
28026
+ {
28027
+ variant: "body2",
28028
+ className: "italic text-sm text-grey-700",
28029
+ children: [
28030
+ t2("ASSIGN_TO"),
28031
+ " : ",
28032
+ remark.assignedToUserName,
28033
+ ReassignStaffFormComponent && /* @__PURE__ */ jsx(
28034
+ IconButton$1,
28035
+ {
28036
+ onClick: (event) => handleReassignStaffMember(event, remark),
28037
+ size: "small",
28038
+ children: /* @__PURE__ */ jsx(EditIcon, { fontSize: "small" })
28039
+ }
28040
+ )
28041
+ ]
28042
+ }
28043
+ ),
28044
+ ReassignStaffFormComponent && (popoverState == null ? void 0 : popoverState.remarkDetails) && /* @__PURE__ */ jsx(
28045
+ ReassignStaffFormComponent,
28046
+ {
28047
+ open: popoverState.remarkId === remark.id,
28048
+ anchorEl: popoverState.anchorEl,
28049
+ onClose: handleCloseReassignStaffMemberPopover,
28050
+ remarkDetails: popoverState.remarkDetails,
28051
+ onReassign: (remarkId, newUserId) => {
28052
+ dispatch(reassignStaffMember(remarkId, newUserId, remarksList));
28053
+ }
28054
+ }
28055
+ ),
28056
+ /* @__PURE__ */ jsx(
28057
+ Typography$1,
28058
+ {
28059
+ variant: "body2",
28060
+ className: "italic ml-2 text-sm text-grey-700",
28061
+ children: remark.created
28062
+ }
28063
+ )
28064
+ ]
28065
+ }
28066
+ ),
28067
+ variant === "simple" && remark.created && /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Typography$1, { variant: "body2", className: "ml-auto", children: remark.created }) }),
28068
+ /* @__PURE__ */ jsx(Divider, {})
28069
+ ] }, remark.id);
28070
+ })),
28071
+ variant === "full" && canCreateRemark && !isApplicationRejected && /* @__PURE__ */ jsxs(Paper$1, { elevation: 3, className: "p-20 mt-20", children: [
28028
28072
  /* @__PURE__ */ jsx(Typography$1, { variant: "h5", gutterBottom: true, children: t2("ADD_REMARK") }),
28029
28073
  /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs(Grid$1, { container: true, justifyContent: "space-between", spacing: 2, children: [
28030
28074
  /* @__PURE__ */ jsxs(Grid$1, { item: true, xs: 12, md: 6, children: [
@@ -28227,12 +28271,14 @@ const CommonStatusChangeDialog = ({
28227
28271
  );
28228
28272
  };
28229
28273
  function shouldShowButton(loginUserDetail, loginUserRoles2, applicationDetailsData) {
28230
- var _a, _b, _c, _d;
28274
+ var _a, _b, _c, _d, _e, _f;
28231
28275
  const isAdmin = ((_a = loginUserDetail == null ? void 0 : loginUserDetail.data) == null ? void 0 : _a.slug) === loginUserRoles2.Admin;
28232
28276
  const isLawyer = ((_b = loginUserDetail == null ? void 0 : loginUserDetail.data) == null ? void 0 : _b.slug) === loginUserRoles2.Lawyer;
28233
- const isAdminNotSigned = !((_c = applicationDetailsData == null ? void 0 : applicationDetailsData.digitalSignatureDetails) == null ? void 0 : _c.isAdminSinged);
28234
- const isLawyerNotSigned = !((_d = applicationDetailsData == null ? void 0 : applicationDetailsData.digitalSignatureDetails) == null ? void 0 : _d.isLawyerSinged);
28235
- return isAdmin && isAdminNotSigned || isLawyer && isLawyerNotSigned;
28277
+ const isUser = ((_c = loginUserDetail == null ? void 0 : loginUserDetail.data) == null ? void 0 : _c.slug) === loginUserRoles2.User;
28278
+ const isAdminNotSigned = !((_d = applicationDetailsData == null ? void 0 : applicationDetailsData.digitalSignatureDetails) == null ? void 0 : _d.isAdminSinged);
28279
+ const isLawyerNotSigned = !((_e = applicationDetailsData == null ? void 0 : applicationDetailsData.digitalSignatureDetails) == null ? void 0 : _e.isLawyerSinged);
28280
+ const isCustomerNotSigned = !((_f = applicationDetailsData == null ? void 0 : applicationDetailsData.digitalSignatureDetails) == null ? void 0 : _f.isCustomerSinged);
28281
+ return isAdmin && isAdminNotSigned || isLawyer && isLawyerNotSigned || isUser && isCustomerNotSigned;
28236
28282
  }
28237
28283
  const PDFPreviewForTheSignature = ({
28238
28284
  filePath,
@@ -28244,43 +28290,91 @@ const PDFPreviewForTheSignature = ({
28244
28290
  applicationDetailsData,
28245
28291
  loginUserDetail,
28246
28292
  loginUserRoles: loginUserRoles2,
28247
- ColoredSubmitButton
28293
+ ColoredSubmitButton,
28294
+ financeCalculation,
28295
+ t: t2 = (key) => key
28248
28296
  }) => {
28249
28297
  const showButton = shouldShowButton(
28250
28298
  loginUserDetail,
28251
28299
  loginUserRoles2,
28252
28300
  applicationDetailsData
28253
28301
  );
28254
- return /* @__PURE__ */ jsx(Dialog$1, { open, onClose, maxWidth: "lg", fullWidth: true, children: /* @__PURE__ */ jsxs(DialogContent$1, { className: "p-0 h-[80vh]", children: [
28302
+ return /* @__PURE__ */ jsx(Dialog$1, { open, onClose, maxWidth: "lg", fullWidth: true, children: /* @__PURE__ */ jsxs(DialogContent$1, { className: "p-0", children: [
28255
28303
  /* @__PURE__ */ jsx(
28256
28304
  "embed",
28257
28305
  {
28258
28306
  src: filePath,
28259
28307
  type: "application/pdf",
28260
28308
  width: "100%",
28261
- height: "100%"
28309
+ style: { height: "80vh" }
28262
28310
  }
28263
28311
  ),
28264
- showButton && /* @__PURE__ */ jsx("div", { className: "sticky bottom-0 bg-white w-full border-t-1 border-solid border-grey-500 px-10 py-10 text-end", children: /* @__PURE__ */ jsx(
28265
- ColoredSubmitButton,
28266
- {
28267
- variant: "contained",
28268
- disabled: isButtonLoading,
28269
- onClick: onConfirm,
28270
- isLoading: isButtonLoading,
28271
- className: "rounded-6",
28272
- text: bottomButtonLabel
28273
- }
28274
- ) })
28312
+ showButton && /* @__PURE__ */ jsxs("div", { className: "sticky bottom-0 bg-white w-full border-t-1 border-solid border-grey-500 px-10 py-10 text-end", children: [
28313
+ financeCalculation && /* @__PURE__ */ jsxs(Grid$1, { container: true, spacing: 2, children: [
28314
+ /* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, sm: 12, md: 4, className: "flex justify-start", children: /* @__PURE__ */ jsxs(Typography$1, { variant: "body1", children: [
28315
+ /* @__PURE__ */ jsxs("strong", { children: [
28316
+ t2("LOAN_AMOUNT"),
28317
+ ": "
28318
+ ] }),
28319
+ formatAmount(financeCalculation == null ? void 0 : financeCalculation.loanAmount)
28320
+ ] }) }),
28321
+ /* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, sm: 12, md: 4, className: "flex justify-start", children: /* @__PURE__ */ jsxs(Typography$1, { variant: "body1", children: [
28322
+ /* @__PURE__ */ jsxs("strong", { children: [
28323
+ t2("INTEREST_RATE"),
28324
+ ": "
28325
+ ] }),
28326
+ formatAmount(financeCalculation == null ? void 0 : financeCalculation.interestFees)
28327
+ ] }) }),
28328
+ /* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, sm: 12, md: 4, className: "flex justify-start", children: /* @__PURE__ */ jsxs(Typography$1, { variant: "body1", children: [
28329
+ /* @__PURE__ */ jsxs("strong", { children: [
28330
+ t2("FEES_DEDUCTION"),
28331
+ ": "
28332
+ ] }),
28333
+ formatAmount(financeCalculation == null ? void 0 : financeCalculation.feesDeduction)
28334
+ ] }) }),
28335
+ /* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, sm: 12, md: 4, className: "flex justify-start", children: /* @__PURE__ */ jsxs(Typography$1, { variant: "body1", children: [
28336
+ /* @__PURE__ */ jsxs("strong", { children: [
28337
+ t2("REPAYMENT_AMOUNT"),
28338
+ ": "
28339
+ ] }),
28340
+ formatAmount(financeCalculation == null ? void 0 : financeCalculation.repaymentAmount)
28341
+ ] }) }),
28342
+ /* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, sm: 12, md: 4, className: "flex justify-start", children: /* @__PURE__ */ jsxs(Typography$1, { variant: "body1", children: [
28343
+ /* @__PURE__ */ jsxs("strong", { children: [
28344
+ t2("CASH_IN_HAND"),
28345
+ ": "
28346
+ ] }),
28347
+ formatAmount(financeCalculation == null ? void 0 : financeCalculation.cashInHand)
28348
+ ] }) })
28349
+ ] }),
28350
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end mt-10", children: /* @__PURE__ */ jsx(
28351
+ ColoredSubmitButton,
28352
+ {
28353
+ variant: "contained",
28354
+ disabled: isButtonLoading,
28355
+ onClick: onConfirm,
28356
+ isLoading: isButtonLoading,
28357
+ className: "rounded-6",
28358
+ text: bottomButtonLabel
28359
+ }
28360
+ ) })
28361
+ ] })
28275
28362
  ] }) });
28276
28363
  };
28277
- const CustomCheckbox = ({ label, onChange, ...props }) => {
28278
- const [checked, setChecked] = React__default.useState(false);
28279
- const handleChange = (isChecked) => {
28280
- setChecked(isChecked);
28281
- if (onChange) {
28282
- onChange(isChecked);
28364
+ const CustomCheckbox = ({
28365
+ label,
28366
+ onChange,
28367
+ checked: controlledChecked,
28368
+ ...props
28369
+ }) => {
28370
+ const [internalChecked, setInternalChecked] = React__default.useState(false);
28371
+ const isControlled = controlledChecked !== void 0;
28372
+ const isChecked = isControlled ? controlledChecked : internalChecked;
28373
+ const handleChange = (newChecked) => {
28374
+ if (!isControlled) {
28375
+ setInternalChecked(newChecked);
28283
28376
  }
28377
+ onChange == null ? void 0 : onChange(newChecked);
28284
28378
  };
28285
28379
  return /* @__PURE__ */ jsx(Fragment, { children: label ? /* @__PURE__ */ jsx(
28286
28380
  FormControlLabel,
@@ -28288,7 +28382,7 @@ const CustomCheckbox = ({ label, onChange, ...props }) => {
28288
28382
  control: /* @__PURE__ */ jsx(
28289
28383
  Checkbox$1,
28290
28384
  {
28291
- checked,
28385
+ checked: isChecked,
28292
28386
  onChange: (event) => handleChange(event.target.checked),
28293
28387
  ...props
28294
28388
  }
@@ -28298,30 +28392,40 @@ const CustomCheckbox = ({ label, onChange, ...props }) => {
28298
28392
  ) : /* @__PURE__ */ jsx(
28299
28393
  Checkbox$1,
28300
28394
  {
28301
- checked,
28395
+ checked: isChecked,
28302
28396
  onChange: (event) => handleChange(event.target.checked),
28303
28397
  ...props
28304
28398
  }
28305
28399
  ) });
28306
28400
  };
28401
+ instance.addResourceBundle("en", "Dialog", locale$3);
28402
+ instance.addResourceBundle("ms", "Dialog", locale$2);
28307
28403
  function DocumentSigningDialog({
28308
28404
  financeDetail,
28309
28405
  loginUserDetail,
28310
28406
  digitalSignatureRole,
28311
- ColoredSubmitButton
28407
+ ColoredSubmitButton,
28408
+ financeCalculation
28312
28409
  }) {
28313
28410
  const { t: t2 } = useTranslation("Dialog");
28314
28411
  const open = useSelector(getIsDocumentSignatureDialogOpen);
28315
28412
  const documentSignJPDF = useSelector(getDocumentSignJPDF);
28316
28413
  const isProcessSignatureLoading = useSelector(getIsProcessSignatureLoading);
28414
+ const activeFinanceDetail = useSelector(getActiveFinanceDetail);
28317
28415
  const dispatch = useDispatch();
28318
28416
  const onClose = () => {
28319
28417
  dispatch(setIsDocumentSignatureDialogOpen(false));
28320
28418
  };
28321
28419
  const handleButtonClick = () => {
28420
+ let signatureRole = digitalSignatureRole.User;
28421
+ if (loginUserDetail.data.slug === loginUserRoles.Admin) {
28422
+ signatureRole = digitalSignatureRole.Admin;
28423
+ } else if (loginUserDetail.data.slug === loginUserRoles.Lawyer) {
28424
+ signatureRole = digitalSignatureRole.Lawyer;
28425
+ }
28322
28426
  const request_data = {
28323
28427
  FinanceApplicationId: financeDetail.id,
28324
- SignatureRole: loginUserDetail.data.slug === loginUserRoles.Admin ? digitalSignatureRole.Admin : digitalSignatureRole.Lawyer
28428
+ SignatureRole: signatureRole
28325
28429
  };
28326
28430
  dispatch(DigitalProcessSignature(request_data));
28327
28431
  };
@@ -28428,10 +28532,12 @@ function DocumentSigningDialog({
28428
28532
  onClose: () => handlePDFPreviewClose(),
28429
28533
  bottomButtonLabel: t2("SIGN_DOCUMENT"),
28430
28534
  onConfirm: handleButtonClick,
28431
- applicationDetailsData: financeDetail,
28535
+ applicationDetailsData: activeFinanceDetail || financeDetail,
28432
28536
  loginUserDetail,
28433
28537
  loginUserRoles,
28434
- ColoredSubmitButton
28538
+ ColoredSubmitButton,
28539
+ financeCalculation,
28540
+ t: t2
28435
28541
  }
28436
28542
  )
28437
28543
  ] })
@@ -57287,7 +57393,9 @@ const CustomDatePicker = ({
57287
57393
  minDate,
57288
57394
  disabled = false,
57289
57395
  required = false,
57290
- locale: locale$12 = locale
57396
+ locale: locale$12 = locale,
57397
+ dataTestId,
57398
+ iconColor
57291
57399
  }) => {
57292
57400
  return /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: locale$12, children: /* @__PURE__ */ jsx(
57293
57401
  DatePicker,
@@ -57298,6 +57406,11 @@ const CustomDatePicker = ({
57298
57406
  minDate,
57299
57407
  disabled,
57300
57408
  className: "w-full",
57409
+ sx: {
57410
+ "& .MuiSvgIcon-root": {
57411
+ color: iconColor
57412
+ }
57413
+ },
57301
57414
  slotProps: {
57302
57415
  actionBar: {
57303
57416
  actions: ["clear", "cancel"]
@@ -57307,7 +57420,10 @@ const CustomDatePicker = ({
57307
57420
  variant,
57308
57421
  error: !!error,
57309
57422
  helperText: error || "",
57310
- required
57423
+ required,
57424
+ inputProps: {
57425
+ "data-test-id": dataTestId
57426
+ }
57311
57427
  }
57312
57428
  }
57313
57429
  }
@@ -57357,6 +57473,7 @@ export {
57357
57473
  CommonTextField,
57358
57474
  ConfirmDialog,
57359
57475
  CustomAutocomplete,
57476
+ CustomCheckbox,
57360
57477
  CustomDatePicker,
57361
57478
  CustomDialog,
57362
57479
  CustomPopover,