Merge branch 'Sprint-10' into sprint10/dashbaord
This commit is contained in:
@@ -520,7 +520,7 @@ const FormField = ({
|
||||
ps={1}
|
||||
{...field}
|
||||
{...props} size='md' colorScheme='forestGreen'>
|
||||
<Text as={"span"} fontSize={"sm"}>Is This Sharia Compliant</Text>
|
||||
<Text as={"span"} fontSize={"sm"}>Is This Shariah Compliant</Text>
|
||||
</Checkbox>
|
||||
</HStack>
|
||||
);} else{
|
||||
|
||||
@@ -233,7 +233,7 @@ const DashboardLayout = ({ isOnline }) => {
|
||||
return (
|
||||
<span className="d-flex align-items-end gap-2">
|
||||
<RiExchangeBoxLine className="h4 m-0 fw-normal" />
|
||||
Deposite Request
|
||||
Deposit Request
|
||||
</span>
|
||||
);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import ToastBox from "../../Components/ToastBox";
|
||||
import NormalTable from "../../Components/DataTable/NormalTable";
|
||||
import GlobalStateContext from "../../Contexts/GlobalStateContext";
|
||||
import { useGetInvestorsQuery } from "../../Services/investor.details.service";
|
||||
import { TABLE_PAGINATION } from "../../Constants/Paginations";
|
||||
import { INVESTOR_TABLE_PAGINATION, TABLE_PAGINATION } from "../../Constants/Paginations";
|
||||
import { formatDate, generateSerialNumber } from "../../Constants/Constants";
|
||||
import { ViewIcon } from "@chakra-ui/icons";
|
||||
import { useGetUnbanInvestorQuery } from "../../Services/ban.investor.service";
|
||||
@@ -58,8 +58,8 @@ const Notification = () => {
|
||||
const [form, setForm] = useState({});
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [selectedRadio, setSelectedRadio] = useState([]);
|
||||
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
|
||||
const [currentPage, setCurrentPage] = useState(TABLE_PAGINATION?.page);
|
||||
const [pageSize, setPageSize] = useState(INVESTOR_TABLE_PAGINATION?.size);
|
||||
const [currentPage, setCurrentPage] = useState(INVESTOR_TABLE_PAGINATION?.page);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
|
||||
const [country, setCountry] = useState("");
|
||||
@@ -116,7 +116,7 @@ const Notification = () => {
|
||||
page: 1, // Omit pagination for search
|
||||
size: 10000, // Omit pagination for search
|
||||
// page: debouncedSearchTerm ? undefined : currentPage, // Disable pagination for search
|
||||
// size: debouncedSearchTerm ? undefined : pageSize, // Disable pagination for search
|
||||
// size: debouncedSearchTerm ? undefined : 10000 || pageSize || 500, // Disable pagination for search
|
||||
search: debouncedSearchTerm, // Pass search term
|
||||
country_xid: country,
|
||||
KYCStatus: kyc,
|
||||
|
||||
@@ -108,7 +108,7 @@ const ViewDistributionInvestor = ({ isOpen, onClose, id: exitId, amount }) => {
|
||||
"Last Name",
|
||||
"Amount",
|
||||
"Holding (%)",
|
||||
"Distriution Amt($)",
|
||||
"Distribution Amt($)",
|
||||
"Yeild (%)",
|
||||
];
|
||||
|
||||
@@ -169,10 +169,10 @@ const ViewDistributionInvestor = ({ isOpen, onClose, id: exitId, amount }) => {
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
"Distriution Amt($)": (
|
||||
"Distribution Amt($)": (
|
||||
<Box minW={24} isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"} fontWeight={"500"}>
|
||||
{IODetails?.ioTransactionRecords?.Pending[index]?.transactionAmount?.toLocaleString(undefined, {
|
||||
{item?.distribution_amt?.toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}
|
||||
|
||||
@@ -60,9 +60,9 @@ export const investmentDocSchema = yup.object().shape({
|
||||
// return value && value.size <= 2 * 1024 * 1024; // 2MB in bytes
|
||||
// })
|
||||
fileName: yup.string().required("File name is required")
|
||||
.max(30, "File name must be at most 30 characters"), // Maximum length validation,
|
||||
.max(35, "File name must be at most 30 characters"), // Maximum length validation,
|
||||
documentNameArabic: yup.string().required("File name Arabic is required")
|
||||
.max(25, "File name must be at most 30 characters"),
|
||||
.max(25, "File name must be at most 35 characters"),
|
||||
});
|
||||
|
||||
const InvestmentDocuments = ({
|
||||
|
||||
@@ -17,6 +17,9 @@ import {
|
||||
ModalHeader,
|
||||
ModalOverlay,
|
||||
FormErrorMessage,
|
||||
Text,
|
||||
Textarea,
|
||||
Box,
|
||||
} from "@chakra-ui/react";
|
||||
import {
|
||||
useGetIOprepopulateDataQuery,
|
||||
@@ -37,6 +40,8 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
const { data } = useGetIOprepopulateDataQuery();
|
||||
const [updateStatusIo] = useUpdateStatusIoMutation();
|
||||
const [updateCancleStatus] = useUpdateCancleStatusToMutation();
|
||||
const [message, setMessage] = useState(null);
|
||||
const [messageError, setMessageError] = useState(null);
|
||||
|
||||
// useEffect(() => {
|
||||
// setSelectedStatusId(status?.[0]?.id);
|
||||
@@ -47,11 +52,14 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
setSelectedStatusId(id);
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
const handleSubmit = async (data) => {
|
||||
if (!selectedStatusId) {
|
||||
setError("Please select status");
|
||||
return;
|
||||
}
|
||||
if (!message) {
|
||||
return setMessageError("message is required");
|
||||
}
|
||||
setError("");
|
||||
setIsLoading(true);
|
||||
try {
|
||||
@@ -60,9 +68,10 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
// If selectedItem is 'Cancelled', make the updateCancelStatus API call
|
||||
if (selectedItem === import.meta.env.VITE_STATUS_CANCELLED) {
|
||||
res = await updateCancleStatus({
|
||||
id
|
||||
id: id,
|
||||
data: { comments: message },
|
||||
});
|
||||
}
|
||||
}
|
||||
// Otherwise, make the updateStatusIo API call
|
||||
else {
|
||||
res = await updateStatusIo({
|
||||
@@ -72,7 +81,7 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
id,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
console.log("API Response:", res);
|
||||
setIsLoading(false);
|
||||
handleClose();
|
||||
@@ -84,6 +93,8 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
const handleClose = () => {
|
||||
setSelectedItem(null);
|
||||
setSelectedStatusId(null);
|
||||
setMessage(null);
|
||||
setMessageError(null);
|
||||
onClose();
|
||||
setError("");
|
||||
};
|
||||
@@ -121,7 +132,8 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
colorScheme={
|
||||
selectedItem === import.meta.env.VITE_STATUS_DRAFT
|
||||
? "gray"
|
||||
: selectedItem === import.meta.env.VITE_STATUS_PROCESSING
|
||||
: selectedItem ===
|
||||
import.meta.env.VITE_STATUS_PROCESSING
|
||||
? "yellow"
|
||||
: selectedItem === import.meta.env.VITE_STATUS_OPEN
|
||||
? "blue"
|
||||
@@ -154,7 +166,7 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
<Badge
|
||||
rounded={"full"}
|
||||
pt={1.5}
|
||||
pb={1.5}
|
||||
pb={1.5}
|
||||
ps={4}
|
||||
pe={4}
|
||||
mt={1.5}
|
||||
@@ -163,7 +175,8 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
colorScheme={
|
||||
statusAdmin === import.meta.env.VITE_STATUS_DRAFT
|
||||
? "gray"
|
||||
: statusAdmin === import.meta.env.VITE_STATUS_PROCESSING
|
||||
: statusAdmin ===
|
||||
import.meta.env.VITE_STATUS_PROCESSING
|
||||
? "yellow"
|
||||
: statusAdmin === import.meta.env.VITE_STATUS_OPEN
|
||||
? "blue"
|
||||
@@ -171,7 +184,8 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
? "green"
|
||||
: statusAdmin === import.meta.env.VITE_STATUS_EXITED
|
||||
? "red"
|
||||
: statusAdmin === import.meta.env.VITE_STATUS_CANCELLED
|
||||
: statusAdmin ===
|
||||
import.meta.env.VITE_STATUS_CANCELLED
|
||||
? "orange"
|
||||
: "purple"
|
||||
}
|
||||
@@ -191,6 +205,24 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
|
||||
{error}
|
||||
</FormErrorMessage>
|
||||
</FormControl>
|
||||
{selectedItem === import.meta.env.VITE_STATUS_CANCELLED && (
|
||||
<FormControl mt={5} isRequired>
|
||||
<FormLabel fontSize={"sm"} fontWeight={400}>
|
||||
Message
|
||||
</FormLabel>
|
||||
<Textarea
|
||||
resize={"none"}
|
||||
rounded={5}
|
||||
size="sm"
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
/>
|
||||
</FormControl>
|
||||
)}
|
||||
{messageError && (
|
||||
<Text fontSize={"sm"} color={"red"}>
|
||||
{messageError}
|
||||
</Text>
|
||||
)}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button
|
||||
|
||||
@@ -203,7 +203,7 @@ const BankDetails = () => {
|
||||
return (
|
||||
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={38}>
|
||||
<HStack>
|
||||
<Text as={'span'} fontSize={'sm'} fontWeight={700}>Bank Deatils</Text>
|
||||
<Text as={'span'} fontSize={'sm'} fontWeight={700}>Bank Details</Text>
|
||||
</HStack>
|
||||
<HStack
|
||||
display={"flex"}
|
||||
|
||||
@@ -114,7 +114,7 @@ const InvestorDetails = () => {
|
||||
];
|
||||
|
||||
// ====================================================[Table Filter]================================================================
|
||||
const exportInvestor = investorDetails?.data?.rows?.map((item, idx) => ({
|
||||
const exportInvestor = investorDetails?.data?.rows?.map((item) => ({
|
||||
Id: parseInt(item?.id, 10) || item?.id, // Convert to integer, fallback to string if conversion fails
|
||||
"Client ID": item?.clientReference_id, // This is likely a string
|
||||
"First Name": item?.principal?.firstName,
|
||||
@@ -243,18 +243,10 @@ const InvestorDetails = () => {
|
||||
isTruncated={true}
|
||||
>
|
||||
<Text as={"span"} color={"teal.900"}>
|
||||
{item.clientReference_id === "T2481950"
|
||||
? parseFloat(15100 || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})
|
||||
: parseFloat(item?.Portfolio_InInvCur || 0).toLocaleString(
|
||||
undefined,
|
||||
{
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}
|
||||
)}
|
||||
{parseFloat(item?.Portfolio_InInvCur || 0).toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}
|
||||
<Badge ms={1} colorScheme="green">
|
||||
{item?.currencyCode}
|
||||
</Badge>
|
||||
|
||||
@@ -150,6 +150,22 @@ const Kyc = () => {
|
||||
/>
|
||||
</FormControl>
|
||||
</HStack>
|
||||
<HStack spacing={4} mb={4}>
|
||||
<FormControl>
|
||||
<FormLabel mb={1} fontSize={"sm"}>
|
||||
PEP Status
|
||||
</FormLabel>
|
||||
<Input
|
||||
bg={"#ccc3"}
|
||||
border={"none"}
|
||||
size={"sm"}
|
||||
value={data?.data?.KYC?.PEPStatus ? "Yes" : "No"}
|
||||
type="text"
|
||||
readOnly
|
||||
/>
|
||||
</FormControl>
|
||||
<FormControl></FormControl>
|
||||
</HStack>
|
||||
{/* <HStack spacing={4}>
|
||||
<FormControl>
|
||||
<FormLabel mb={1} fontSize={"sm"}>Address</FormLabel>
|
||||
|
||||
@@ -254,7 +254,7 @@ const AddSponser = () => {
|
||||
} characters.`,
|
||||
},
|
||||
{
|
||||
label: "Email adress",
|
||||
label: "Email address",
|
||||
name: "email",
|
||||
placeHolder: " ",
|
||||
type: "email",
|
||||
|
||||
@@ -256,8 +256,9 @@ export const ioService = createApi({
|
||||
|
||||
updateCancleStatusTo: builder.mutation({
|
||||
query: ({ id, data }) => ({
|
||||
url: `/io/admin/transaction/${id}/cancel`,
|
||||
url: `/io/admin/maker-transaction/${id}/io-cancel`,
|
||||
method: "POST",
|
||||
body:data
|
||||
}),
|
||||
invalidatesTags: ["getIOById"],
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user