Compare commits
14 Commits
f2d8aee6a9
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b141743190 | ||
|
|
f9d0b3ce6c | ||
|
|
965263a3f2 | ||
|
|
04a5d1280f | ||
|
|
d40eadb35e | ||
|
|
f4a2fd2889 | ||
|
|
96f813f632 | ||
|
|
8587b91a33 | ||
|
|
49b06e81a6 | ||
|
|
79ec8d92ae | ||
| 35d3e07224 | |||
|
|
651c775c2a | ||
| 6c2a38becb | |||
| bddf7381a6 |
@@ -309,14 +309,14 @@ const DashboardLayout = ({ isOnline }) => {
|
|||||||
return (
|
return (
|
||||||
<span className="d-flex align-items-end gap-2">
|
<span className="d-flex align-items-end gap-2">
|
||||||
<HiOutlineBanknotes className="h4 m-0 fw-normal" />
|
<HiOutlineBanknotes className="h4 m-0 fw-normal" />
|
||||||
Fawateer Deposit
|
Reversal Transaction / Fawateer Deposit
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
case path.startsWith("/account-deletion-request"):
|
case path.startsWith("/account-deletion-request"):
|
||||||
return (
|
return (
|
||||||
<span className="d-flex align-items-end gap-2">
|
<span className="d-flex align-items-end gap-2">
|
||||||
<RiAccountBoxLine className="h4 m-0 fw-normal" />
|
<RiAccountBoxLine className="h4 m-0 fw-normal" />
|
||||||
Account Deletion Request
|
Reversal Transaction / Account Deletion Request
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ const BankDepositRequest = () => {
|
|||||||
"Last Name",
|
"Last Name",
|
||||||
"Country",
|
"Country",
|
||||||
"Phone Number",
|
"Phone Number",
|
||||||
|
"Deposit Amount",
|
||||||
"Action",
|
"Action",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -212,16 +213,30 @@ const BankDepositRequest = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
),
|
),
|
||||||
Country: (
|
Country: (
|
||||||
<Box w={"80px"} isTruncated={true}>
|
<Box isTruncated={true}>
|
||||||
<Text as={"span"} color={"teal.900"}>
|
<Text as={"span"} color={"teal.900"}>
|
||||||
{item?.countryName}
|
{item?.countryName}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
),
|
),
|
||||||
"Phone Number": (
|
"Phone Number": (
|
||||||
<Box w={"80px"} isTruncated={true}>
|
<Box isTruncated={true}>
|
||||||
<Text as={"span"} color={"teal.900"}>
|
<Text as={"span"} color={"teal.900"}>
|
||||||
{item?.mobileNumber}
|
{item?.ISDCode} {item?.mobileNumber}
|
||||||
|
{/* {item?.ISDcode + " " + item?.mobileNumber} */}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
),
|
||||||
|
"Deposit Amount": (
|
||||||
|
<Box isTruncated={true} display={"flex"} justifyContent={"end"}>
|
||||||
|
<Text as={"span"} color={"teal.900"} textAlign={"right"}>
|
||||||
|
{parseFloat(item?.investorAmount || 0).toLocaleString(undefined, {
|
||||||
|
minimumFractionDigits: 2,
|
||||||
|
maximumFractionDigits: 2,
|
||||||
|
})}
|
||||||
|
<Badge ms={1} colorScheme="green">
|
||||||
|
{item?.currencyCode}
|
||||||
|
</Badge>
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const ApproveHistory = () => {
|
|||||||
const [actionId, setActionId] = useState(false);
|
const [actionId, setActionId] = useState(false);
|
||||||
const [mouseEntered, setMouseEntered] = useState(false);
|
const [mouseEntered, setMouseEntered] = useState(false);
|
||||||
const [mouseEnteredId, setMouseEnteredId] = useState("");
|
const [mouseEnteredId, setMouseEnteredId] = useState("");
|
||||||
|
const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
|
||||||
|
|
||||||
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
|
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
|
||||||
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
|
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
|
||||||
@@ -60,12 +61,31 @@ const ApproveHistory = () => {
|
|||||||
onClose: onRejectClose,
|
onClose: onRejectClose,
|
||||||
} = useDisclosure();
|
} = 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 {
|
const {
|
||||||
data,
|
data,
|
||||||
isLoading: drawalRequestLoading,
|
isLoading: drawalRequestLoading,
|
||||||
error,
|
error,
|
||||||
refetch,
|
refetch,
|
||||||
} = useGetApproveHistoryQuery();
|
} = useGetApproveHistoryQuery(
|
||||||
|
{
|
||||||
|
page: debouncedSearchTerm ? undefined : currentPage, // Omit pagination for search
|
||||||
|
size: debouncedSearchTerm ? undefined : pageSize, // Omit pagination for search
|
||||||
|
searchTerm: debouncedSearchTerm,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
skip: debouncedSearchTerm === "" && searchTerm !== "", // Skip if search is empty and it's not the initial request
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
console.log(data?.data?.rows);
|
console.log(data?.data?.rows);
|
||||||
|
|
||||||
@@ -84,6 +104,15 @@ const ApproveHistory = () => {
|
|||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = setTimeout(() => {
|
||||||
|
setDebouncedSearchTerm(searchTerm);
|
||||||
|
}, 500); // Adjust delay as needed
|
||||||
|
return () => {
|
||||||
|
clearTimeout(handler);
|
||||||
|
};
|
||||||
|
}, [searchTerm]);
|
||||||
// ====================================================[Table Filter]================================================================
|
// ====================================================[Table Filter]================================================================
|
||||||
const filteredData = data?.data?.rows?.filter((item) => {
|
const filteredData = data?.data?.rows?.filter((item) => {
|
||||||
// Filter by name (case insensitive)
|
// Filter by name (case insensitive)
|
||||||
@@ -117,7 +146,7 @@ const ApproveHistory = () => {
|
|||||||
"Status",
|
"Status",
|
||||||
];
|
];
|
||||||
|
|
||||||
const extractedArray = filteredData?.map((item, idx) => ({
|
const extractedArray = data?.data?.rows?.map((item, idx) => ({
|
||||||
// id: item?.id,
|
// id: item?.id,
|
||||||
"Sr.no": (
|
"Sr.no": (
|
||||||
<Text
|
<Text
|
||||||
@@ -172,11 +201,7 @@ const ApproveHistory = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
),
|
),
|
||||||
"Deposit Date": (
|
"Deposit Date": (
|
||||||
<Box
|
<Box w={"100px"} isTruncated={true} display={"flex"}>
|
||||||
w={"100px"}
|
|
||||||
isTruncated={true}
|
|
||||||
display={"flex"}
|
|
||||||
>
|
|
||||||
<Text as={"span"} color={"teal.900"}>
|
<Text as={"span"} color={"teal.900"}>
|
||||||
{formatDate(item?.transaction_date)}
|
{formatDate(item?.transaction_date)}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -202,28 +227,27 @@ const ApproveHistory = () => {
|
|||||||
fontWeight={"500"}
|
fontWeight={"500"}
|
||||||
className="d-flex align-items-center web-text-small"
|
className="d-flex align-items-center web-text-small"
|
||||||
>
|
>
|
||||||
{item?.spportFile_path&&<Badge
|
{item?.spportFile_path && (
|
||||||
px={2}
|
<Badge
|
||||||
py={0.5}
|
px={2}
|
||||||
textTransform={"inherit"}
|
py={0.5}
|
||||||
fontWeight={500}
|
textTransform={"inherit"}
|
||||||
colorScheme={"forestGreen"}
|
fontWeight={500}
|
||||||
>
|
colorScheme={"forestGreen"}
|
||||||
<Link
|
|
||||||
href={import.meta.env.VITE_IMAGE_URL + item?.spportFile_path}
|
|
||||||
isExternal
|
|
||||||
display={"flex"}
|
|
||||||
alignItems={"center"}
|
|
||||||
>
|
>
|
||||||
<Box me={"1px"}
|
<Link
|
||||||
as="span"
|
href={import.meta.env.VITE_IMAGE_URL + item?.spportFile_path}
|
||||||
cursor={"pointer"}
|
isExternal
|
||||||
|
display={"flex"}
|
||||||
|
alignItems={"center"}
|
||||||
>
|
>
|
||||||
View
|
<Box me={"1px"} as="span" cursor={"pointer"}>
|
||||||
</Box>
|
View
|
||||||
<ExternalLinkIcon />
|
</Box>
|
||||||
</Link>
|
<ExternalLinkIcon />
|
||||||
</Badge>}
|
</Link>
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
),
|
),
|
||||||
Status: (
|
Status: (
|
||||||
@@ -236,12 +260,12 @@ const ApproveHistory = () => {
|
|||||||
rounded={4}
|
rounded={4}
|
||||||
colorScheme={
|
colorScheme={
|
||||||
item?.transactionStatus === "Approved"
|
item?.transactionStatus === "Approved"
|
||||||
? "green"
|
? "green"
|
||||||
: item?.transactionStatus === "Pending"
|
: item?.transactionStatus === "Pending"
|
||||||
? "yellow"
|
? "yellow"
|
||||||
: item?.transactionStatus === "Reject"
|
: item?.transactionStatus === "Reject"
|
||||||
? "red"
|
? "red"
|
||||||
: "gray" // default border color if status doesn't match any condition
|
: "gray" // default border color if status doesn't match any condition
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{item.transactionStatus}
|
{item.transactionStatus}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ const ReversalFawateerDeposit = () => {
|
|||||||
"First Name",
|
"First Name",
|
||||||
"Last Name",
|
"Last Name",
|
||||||
"Phone Number",
|
"Phone Number",
|
||||||
|
"Deposit Amount (BHD)",
|
||||||
"Action",
|
"Action",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -188,7 +189,21 @@ const ReversalFawateerDeposit = () => {
|
|||||||
"Phone Number": (
|
"Phone Number": (
|
||||||
<Box w={"100px"} isTruncated={true}>
|
<Box w={"100px"} isTruncated={true}>
|
||||||
<Text as={"span"} color={"teal.900"}>
|
<Text as={"span"} color={"teal.900"}>
|
||||||
{item?.principal?.mobileNumber}
|
{/* {item?.principal?.ISDcode} {item?.principal?.mobileNumber} */}
|
||||||
|
{item?.principal?.ISDcode + " " + item?.principal?.mobileNumber}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
),
|
||||||
|
"Deposit Amount (BHD)": (
|
||||||
|
<Box isTruncated={true}>
|
||||||
|
<Text as={"span"} color={"teal.900"} textAlign={"right"}>
|
||||||
|
{parseFloat(item?.transaction_details?.investorAmount || 0).toLocaleString(undefined, {
|
||||||
|
minimumFractionDigits: 2,
|
||||||
|
maximumFractionDigits: 2,
|
||||||
|
})}
|
||||||
|
<Badge ms={1} colorScheme="green">
|
||||||
|
{item?.currencyCode}
|
||||||
|
</Badge>
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { baseQuery } from "./token.serivce";
|
|||||||
export const fawateerRequest = createApi({
|
export const fawateerRequest = createApi({
|
||||||
reducerPath: "fawateerRequest",
|
reducerPath: "fawateerRequest",
|
||||||
baseQuery: baseQuery,
|
baseQuery: baseQuery,
|
||||||
tagTypes: ["getFawateerRequest" ,"getApproveHistory","getApproveComment","getRejectComment","getFawateerMakerRequest"],
|
tagTypes: ["getFawateerRequest", "getApproveHistory", "getApproveComment", "getRejectComment", "getFawateerMakerRequest"],
|
||||||
endpoints: (builder) => ({
|
endpoints: (builder) => ({
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export const fawateerRequest = createApi({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getFawateerForMakerRequest: builder.query({
|
getFawateerForMakerRequest: builder.query({
|
||||||
query: ({ page, size, searchTerm }) => {
|
query: ({ page, size, searchTerm }) => {
|
||||||
@@ -50,8 +50,19 @@ export const fawateerRequest = createApi({
|
|||||||
providesTags: ["getFawateerMakerRequest"],
|
providesTags: ["getFawateerMakerRequest"],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
// getApproveHistory: builder.query({
|
||||||
|
// query: () => `/fawateer/admin/getAll`,
|
||||||
|
// providesTags: ["getApproveHistory"],
|
||||||
|
// }),
|
||||||
|
|
||||||
getApproveHistory: builder.query({
|
getApproveHistory: builder.query({
|
||||||
query: () => `/fawateer/admin/getAll`,
|
query: ({ page, size, searchTerm }) => {
|
||||||
|
let baseURL = `/fawateer/admin/getAll?search=${searchTerm || ""}`;
|
||||||
|
if (page !== undefined && size !== undefined) {
|
||||||
|
baseURL += `&page=${page}&size=${size}`; // Only add pagination if both are defined
|
||||||
|
}
|
||||||
|
return baseURL;
|
||||||
|
},
|
||||||
providesTags: ["getApproveHistory"],
|
providesTags: ["getApproveHistory"],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -72,16 +83,16 @@ export const fawateerRequest = createApi({
|
|||||||
}),
|
}),
|
||||||
invalidatesTags: ["getFawateerRequest"],
|
invalidatesTags: ["getFawateerRequest"],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Export hooks for usage in functional components
|
// Export hooks for usage in functional components
|
||||||
export const {
|
export const {
|
||||||
useGetFawateerRequestQuery,
|
useGetFawateerRequestQuery,
|
||||||
useGetApproveHistoryQuery,
|
useGetApproveHistoryQuery,
|
||||||
useApproveCommentMutation,
|
useApproveCommentMutation,
|
||||||
useRejectCommentMutation,
|
useRejectCommentMutation,
|
||||||
useGetFawateerForMakerRequestQuery,
|
useGetFawateerForMakerRequestQuery,
|
||||||
useGetFawateerInvestorsQuery
|
useGetFawateerInvestorsQuery
|
||||||
} = fawateerRequest;
|
} = fawateerRequest;
|
||||||
|
|||||||
Reference in New Issue
Block a user