Compare commits
14 Commits
sprint10/r
...
Sprint-10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd6cd4659a | ||
|
|
b405da8657 | ||
|
|
ae7b5bbf41 | ||
|
|
e269f6a3b7 | ||
|
|
4d6bd87601 | ||
|
|
b141743190 | ||
|
|
f9d0b3ce6c | ||
|
|
965263a3f2 | ||
|
|
96f813f632 | ||
|
|
79ec8d92ae | ||
| 35d3e07224 | |||
|
|
651c775c2a | ||
| 6c2a38becb | |||
| bddf7381a6 |
@@ -237,9 +237,21 @@ export const decryptString = (ciphertext) => {
|
||||
return originalText;
|
||||
};
|
||||
|
||||
export const SUPER_ADMIN_ID = Number(import.meta.env.VITE_SUPER_ADMIN_ID) || 1
|
||||
export const MAKER_ID = import.meta.env.VITE_MAKER_ID || 1
|
||||
export const CHECKER_ID = import.meta.env.VITE_CHECKER_ID || 2
|
||||
// export const SUPER_ADMIN_ID = Number(import.meta.env.VITE_SUPER_ADMIN_ID) || 1
|
||||
// export const MAKER_ID = import.meta.env.VITE_MAKER_ID || 1
|
||||
// export const CHECKER_ID = import.meta.env.VITE_CHECKER_ID || 2
|
||||
|
||||
// export const isMaker = (role = decryptString(localStorage?.getItem("role"))) => role === import.meta.env.VITE_MAKER;
|
||||
// export const isChecker = (role = decryptString(localStorage?.getItem("role"))) => role === import.meta.env.VITE_CHECKER;
|
||||
|
||||
export const SUPER_ADMIN_ID = Number(import.meta.env?.VITE_SUPER_ADMIN_ID) || 1;
|
||||
export const MAKER_ID = Number(import.meta.env?.VITE_MAKER_ID) || 1;
|
||||
export const CHECKER_ID = Number(import.meta.env?.VITE_CHECKER_ID) || 2;
|
||||
|
||||
export const isMaker = (role = decryptString(localStorage?.getItem("role") || "")) =>
|
||||
role === (import.meta.env?.VITE_MAKER || "");
|
||||
|
||||
export const isChecker = (role = decryptString(localStorage?.getItem("role") || "")) =>
|
||||
role === (import.meta.env?.VITE_CHECKER || "");
|
||||
|
||||
|
||||
export const isMaker = (role = decryptString(localStorage?.getItem("role"))) => role === import.meta.env.VITE_MAKER;
|
||||
export const isChecker = (role = decryptString(localStorage?.getItem("role"))) => role === import.meta.env.VITE_CHECKER;
|
||||
|
||||
@@ -61,6 +61,16 @@ const ApproveHistory = () => {
|
||||
onClose: onRejectClose,
|
||||
} = useDisclosure();
|
||||
|
||||
// Debounce the search term to avoid making a request on every keystroke
|
||||
useEffect(() => {
|
||||
const handler = setTimeout(() => {
|
||||
setDebouncedSearchTerm(searchTerm);
|
||||
}, 500); // Adjust delay as needed
|
||||
return () => {
|
||||
clearTimeout(handler);
|
||||
};
|
||||
}, [searchTerm]);
|
||||
|
||||
const {
|
||||
data,
|
||||
isLoading: drawalRequestLoading,
|
||||
@@ -191,11 +201,7 @@ const ApproveHistory = () => {
|
||||
</Box>
|
||||
),
|
||||
"Deposit Date": (
|
||||
<Box
|
||||
w={"100px"}
|
||||
isTruncated={true}
|
||||
display={"flex"}
|
||||
>
|
||||
<Box w={"100px"} isTruncated={true} display={"flex"}>
|
||||
<Text as={"span"} color={"teal.900"}>
|
||||
{formatDate(item?.transaction_date)}
|
||||
</Text>
|
||||
@@ -221,28 +227,27 @@ const ApproveHistory = () => {
|
||||
fontWeight={"500"}
|
||||
className="d-flex align-items-center web-text-small"
|
||||
>
|
||||
{item?.spportFile_path&&<Badge
|
||||
px={2}
|
||||
py={0.5}
|
||||
textTransform={"inherit"}
|
||||
fontWeight={500}
|
||||
colorScheme={"forestGreen"}
|
||||
>
|
||||
<Link
|
||||
href={import.meta.env.VITE_IMAGE_URL + item?.spportFile_path}
|
||||
isExternal
|
||||
display={"flex"}
|
||||
alignItems={"center"}
|
||||
{item?.spportFile_path && (
|
||||
<Badge
|
||||
px={2}
|
||||
py={0.5}
|
||||
textTransform={"inherit"}
|
||||
fontWeight={500}
|
||||
colorScheme={"forestGreen"}
|
||||
>
|
||||
<Box me={"1px"}
|
||||
as="span"
|
||||
cursor={"pointer"}
|
||||
<Link
|
||||
href={import.meta.env.VITE_IMAGE_URL + item?.spportFile_path}
|
||||
isExternal
|
||||
display={"flex"}
|
||||
alignItems={"center"}
|
||||
>
|
||||
View
|
||||
</Box>
|
||||
<ExternalLinkIcon />
|
||||
</Link>
|
||||
</Badge>}
|
||||
<Box me={"1px"} as="span" cursor={"pointer"}>
|
||||
View
|
||||
</Box>
|
||||
<ExternalLinkIcon />
|
||||
</Link>
|
||||
</Badge>
|
||||
)}
|
||||
</Text>
|
||||
),
|
||||
Status: (
|
||||
@@ -255,12 +260,12 @@ const ApproveHistory = () => {
|
||||
rounded={4}
|
||||
colorScheme={
|
||||
item?.transactionStatus === "Approved"
|
||||
? "green"
|
||||
: item?.transactionStatus === "Pending"
|
||||
? "yellow"
|
||||
: item?.transactionStatus === "Reject"
|
||||
? "red"
|
||||
: "gray" // default border color if status doesn't match any condition
|
||||
? "green"
|
||||
: item?.transactionStatus === "Pending"
|
||||
? "yellow"
|
||||
: item?.transactionStatus === "Reject"
|
||||
? "red"
|
||||
: "gray" // default border color if status doesn't match any condition
|
||||
}
|
||||
>
|
||||
{item.transactionStatus}
|
||||
|
||||
@@ -122,8 +122,14 @@ const InvestorDetails = () => {
|
||||
Country: item?.country?.countryName,
|
||||
"Phone Number": item?.principal?.mobileNumber, // Skipping integer conversion, as this is likely a string
|
||||
"E-mail ID": item?.principal?.emailAddress,
|
||||
"Wallet Balance": item?.principal?.WalletBalance_InInvCur, // Skipping integer conversion, as this is likely a string
|
||||
"Investor Portfolio": item?.principal?.Portfolio_InInvCur,
|
||||
"Wallet Balance":parseFloat(item?.WalletBalance_InInvCur || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}), // Skipping integer conversion, as this is likely a string
|
||||
"Investor Portfolio": parseFloat(item?.Portfolio_InInvCur || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}),
|
||||
// Type: item?.investor_type?.investorTypeName,
|
||||
// Status: item.ioStatus ? "Ban" : "Unban",
|
||||
"KYC Status": item.KYCStatus ? "Completed" : "Not complete",
|
||||
|
||||
@@ -33,6 +33,7 @@ import { LiaCrownSolid } from "react-icons/lia";
|
||||
import { PiCrownDuotone } from "react-icons/pi";
|
||||
import { HiOutlineBanknotes } from "react-icons/hi2";
|
||||
import { AtSignIcon } from "@chakra-ui/icons";
|
||||
import { isMaker, MAKER_ID } from "../Constants/Constants";
|
||||
|
||||
export const nav = [
|
||||
{
|
||||
@@ -109,7 +110,7 @@ export const nav = [
|
||||
title: "Fawateer Deposit",
|
||||
submenu: [
|
||||
{
|
||||
title: "Approver Request",
|
||||
title: isMaker() ? "Approve Create" : "Approve Request",
|
||||
path: "/fawateer",
|
||||
icon: RiMoneyDollarBoxLine,
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ import { baseQuery } from "./token.serivce";
|
||||
export const fawateerRequest = createApi({
|
||||
reducerPath: "fawateerRequest",
|
||||
baseQuery: baseQuery,
|
||||
tagTypes: ["getFawateerRequest" ,"getApproveHistory","getApproveComment","getRejectComment","getFawateerMakerRequest"],
|
||||
tagTypes: ["getFawateerRequest", "getApproveHistory", "getApproveComment", "getRejectComment", "getFawateerMakerRequest"],
|
||||
endpoints: (builder) => ({
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export const fawateerRequest = createApi({
|
||||
}),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getFawateerForMakerRequest: builder.query({
|
||||
query: ({ page, size, searchTerm }) => {
|
||||
@@ -89,10 +89,10 @@ export const fawateerRequest = createApi({
|
||||
|
||||
// Export hooks for usage in functional components
|
||||
export const {
|
||||
useGetFawateerRequestQuery,
|
||||
useGetApproveHistoryQuery,
|
||||
useApproveCommentMutation,
|
||||
useRejectCommentMutation,
|
||||
useGetFawateerForMakerRequestQuery,
|
||||
useGetFawateerInvestorsQuery
|
||||
useGetFawateerRequestQuery,
|
||||
useGetApproveHistoryQuery,
|
||||
useApproveCommentMutation,
|
||||
useRejectCommentMutation,
|
||||
useGetFawateerForMakerRequestQuery,
|
||||
useGetFawateerInvestorsQuery
|
||||
} = fawateerRequest;
|
||||
|
||||
Reference in New Issue
Block a user