From 8b97add9e00294fdb9633ecd9ac278c31a6824c8 Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:00:44 +0530 Subject: [PATCH] portpolio api --- src/Pages/AccountDeletion/DeletionRequest.jsx | 2 +- .../IO_Management/ViewIO/ViewIOTable.jsx | 4 +- .../InvestorDetails/ProfileView.jsx | 4 +- .../InvestorDetails/ViewInvestorDetails.jsx | 67 +++++++++++++++++-- .../Master/ExchangeRate/ExchangeRate.jsx | 12 ++-- src/Pages/Master/Sponser/Sponsers.jsx | 8 +-- 6 files changed, 76 insertions(+), 21 deletions(-) diff --git a/src/Pages/AccountDeletion/DeletionRequest.jsx b/src/Pages/AccountDeletion/DeletionRequest.jsx index 4796ae5..f6194b7 100644 --- a/src/Pages/AccountDeletion/DeletionRequest.jsx +++ b/src/Pages/AccountDeletion/DeletionRequest.jsx @@ -62,7 +62,7 @@ const DeletionRequest = () => { }, []); // ====================================================[Table Filter]================================================================ - const filteredData = data?.data?.filter((item) => { + const filteredData = data?.data?.rows?.filter((item) => { // Filter by name (case insensitive) const name = item?.firstName; const searchLower = searchTerm.toLowerCase(); diff --git a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx index 9bd62ab..dd5a0a5 100644 --- a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx +++ b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx @@ -110,7 +110,7 @@ const ViewIOTable = () => { ), "IO Name": ( - + {item.investmentNameEnglish ? item.investmentNameEnglish : "---"} @@ -124,7 +124,7 @@ const ViewIOTable = () => { ), "Investment Type": ( - + {item?.investmentType?.investmentTypeName ? item.investmentType?.investmentTypeName diff --git a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx index e118dc0..b875600 100644 --- a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx +++ b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx @@ -40,12 +40,14 @@ const ProfileView = () => { skip: !id, }); + + const foundObject = data?.data; useEffect(() => { setViewInvestor(data?.data?.portfolio); setTransaction(data?.data?.transaction); - setInvestorWallet(data?.data.wallet); + setInvestorWallet(data?.data.wallet); }, [data]); const formFields = [ diff --git a/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx index ff89183..e7c543e 100644 --- a/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx +++ b/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx @@ -64,8 +64,13 @@ const ViewInvestorDetails = () => { "Deal Name", "Sponsor Name", "Investment Amount", - "Holding Period", - "Estimated return", + "Percentage", + "Market Value", + "Return on Investment", + "Distribution", + "Distribution Percent", + "Total return", + "Total return on Investment", "Status", // "Action", ]; @@ -123,21 +128,69 @@ console.log(viewInvestor); "Investment Amount": ( - {item.investedAmount} + {/* {item.investedAmount} */} + $ {parseFloat(item?.investedAmount || 0).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} ), - "Holding Period": ( + "Percentage": ( - {item.Investor_Holidings} + {item?.MarketValue_Per} % ), - "Estimated return": ( + "Market Value": ( - {item.TotalReturn} + $ {parseFloat(item?.MarketValue || 0).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} + + + ), + "Return on Investment": ( + + + {item.TotalReturn} % + + + ), + "Distribution": ( + + + $ {parseFloat(item?.DistributionAmountReceived || 0).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} + + + ), + "Distribution Percent": ( + + + {item?.Distribution_Per} % + + + ), + "Total return": ( + + + $ {parseFloat(item?.TotalReturn || 0).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} + + + ), + "Total return on Investment": ( + + + {item.TotalReturn_Per} % ), diff --git a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx index e97b09f..24aec28 100644 --- a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx +++ b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx @@ -68,9 +68,9 @@ const ExchangeRate = () => { // ====================================================[Table Setup]================================================================ const tableHeadRow = [ "Sr.No", - "From currency", - "To currency", - "Effective from", + "From Currency", + "To Currency", + "Effective From", "Rate", "Action", ]; @@ -87,7 +87,7 @@ const ExchangeRate = () => { {index + 1}. ), - "From currency": ( + "From Currency": ( { {item?.fromCurrency?.currencyCode} ), - "To currency": ( + "To Currency": ( { {item?.toCurrency?.currencyCode} ), - "Effective from": ( + "Effective From": ( { // ====================================================[Table Setup]================================================================ const tableHeadRow = [ - "Sponsor name", - "Email address", + "Sponsor Name", + "Email Address", "Status", "Action", ]; const extractedArray = filteredData?.map((item) => ({ - "Sponsor name": ( + "Sponsor Name": ( { ), - "Email address": ( + "Email Address": ( {item.email}