diff --git a/src/Components/ToastBox.jsx b/src/Components/ToastBox.jsx
index 43631dd..316cd10 100644
--- a/src/Components/ToastBox.jsx
+++ b/src/Components/ToastBox.jsx
@@ -1,6 +1,7 @@
import { CheckCircleIcon, WarningIcon } from "@chakra-ui/icons";
import { Box, Text } from "@chakra-ui/react";
import React from "react";
+import { PiWarningBold } from "react-icons/pi";
const ToastBox = ({ message, status }) => {
return (
@@ -9,10 +10,10 @@ const ToastBox = ({ message, status }) => {
rounded={"sm"}
className="web-text-large d-flex gap-2 align-items-center"
p={3}
- bg={status === "error" ? "red.500" : status === "warn" ? "blue.500" : "green.500"}
+ bg={status === "error" ? "red.500" : status === "warn" ? "yellow.500" : status === "info" ? "blue.500" : "green.500"}
>
- {status === "error" || status === "warn" ? : }
+ {status === "error" || status === "warn" ? : status === "info" ? : }
{message}
);
diff --git a/src/Pages/IO_Management/CreateIO/IODetails.jsx b/src/Pages/IO_Management/CreateIO/IODetails.jsx
index 622a472..548671d 100644
--- a/src/Pages/IO_Management/CreateIO/IODetails.jsx
+++ b/src/Pages/IO_Management/CreateIO/IODetails.jsx
@@ -7,8 +7,8 @@ import * as yup from "yup";
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
import { generateUniqueId } from "../../../Contexts/GlobalStateProvider";
-import { useGetInvestmentTypesQuery } from "../../../Services/investment.type.service";
-import { useGetActiveSponserMasterQuery } from "../../../Services/sponser.service";
+import { useGetInvestmentTypesQuery } from "../../../Services/io.service";
+import { useGetActiveSponserMasterQuery } from "../../../Services/io.service";
import {
useCreateIOMutation,
useGetIOByIdQuery,
diff --git a/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx b/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx
index c70c07c..beaaeec 100644
--- a/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx
+++ b/src/Pages/IO_Management/CreateIO/IONAVDetails.jsx
@@ -184,6 +184,8 @@ const IONAVDetails = () => {
*/}
+{IODetails?.isInvestedAmount ? :null}
+
diff --git a/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx b/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx
index d4b87a1..738540b 100644
--- a/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx
+++ b/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx
@@ -325,6 +325,8 @@ const DistributionInvestor = ({ isOpen, onClose, exit }) => {
onClose()
setIsFinalCalculateLoading(false)
reset()
+ setCalculatedDate(null)
+ setIsCalcualtedData(false)
}
@@ -333,7 +335,7 @@ const DistributionInvestor = ({ isOpen, onClose, exit }) => {
- Distribution To Investor Transaction
+ {exit ? "Enter Exit Amount":" Distribution To Investor Transaction"}
@@ -342,8 +344,8 @@ const DistributionInvestor = ({ isOpen, onClose, exit }) => {
*/}
{/* */}
-
- Amount to Distribute
+
+ {exit ? "Enter Exit Amount":"Amount to Distribute"}
{
}
+ {isCalcualtedData?<>
+ >:""}
diff --git a/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx b/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx
index 3471146..81060a4 100644
--- a/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx
+++ b/src/Pages/IO_Management/ViewIO/ViewIOdata.jsx
@@ -29,7 +29,7 @@ import ViewIOnav from "./ViewIOnav";
import ViewDistribution from "./ViewDistribution";
import InvestmentDocument from "../CreateIO/InvestmentDocument";
import KeyMerits from "../CreateIO/KeyMerits";
-import Investors from "../CreateIO/Investors"
+import Investors from "../CreateIO/Investors";
import EditIO from "../EditIO/EditIO";
import IOArtifacts from "../CreateIO/IOArtifacts";
import IOCashDetails from "../CreateIO/IOCashDetails";
@@ -38,34 +38,43 @@ import { useGetIOprepopulateDataQuery } from "../../../Services/io.service";
import UnderConstruction from "../../UnderConstruction";
import Destribution from "../CreateIO/Destribution";
-
const ViewIOdata = () => {
- const params = useParams()
- const id = params?.id
+ const params = useParams();
+ const id = params?.id;
const { data, error, isLoading } = useGetIOprepopulateDataQuery();
const { isOpen, onOpen, onClose } = useDisclosure();
const navigate = useNavigate();
const [isEditing, setIsEditing] = useState(false);
const { IODetails, setIODetails } = useContext(GlobalStateContext);
console.log(IODetails?.isInvestedAmount);
-
-
const tabs = [
{ label: "IO Details", content: },
- { label: "Investment documents", content: },
+ {
+ label: "Investment documents",
+ content: ,
+ },
{ label: "Key merits", content: },
{ label: "IO artifacts", content: },
{ label: "Investors", content: },
// { label: "Investors", content: },
{ label: "IO Cash Details", content: },
{ label: "IO NAV Details", content: },
- { label: "Distribution to Investors", content: },
+ {
+ label: "Distribution to Investors",
+ content: ,
+ },
// { label: "Distribution to Investors", content: },
];
return (
-
+
{/* navigate(-1)}
@@ -77,34 +86,35 @@ const ViewIOdata = () => {
-
-
- {tabs.map(({ label }, index) => (
-
- {label}
-
- ))}
+
+
+ {tabs.map(({ label }, index) => (
+
+ {label}
+
+ ))}
{tabs.map(({ content }, index) => (
- {content}
+ {content}
))}
diff --git a/src/Pages/Master/ExchangeRate/EditExchangeRate.jsx b/src/Pages/Master/ExchangeRate/EditExchangeRate.jsx
index bb4082a..51d9cbd 100644
--- a/src/Pages/Master/ExchangeRate/EditExchangeRate.jsx
+++ b/src/Pages/Master/ExchangeRate/EditExchangeRate.jsx
@@ -30,8 +30,7 @@ import {
} from "../../../Services/exchange.rate.service";
import ToastBox from "../../../Components/ToastBox";
import { getTomorrowDate } from "../../../Constants/Constants";
-
-
+import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
// Convert date to YYYY-MM-DD format
const formatDateValue = (date) => {
@@ -47,11 +46,16 @@ const formatDateValue = (date) => {
return [year, month, day].join("-");
};
-const EditExchangeRate = ({ id, setIsLoading }) => {
- const btnRef = useRef();
+const EditExchangeRate = ({
+ id,
+ setIsLoading,
+ isOpen,
+ onOpen,
+ onClose,
+ btnRef,
+}) => {
const toast = useToast();
- const { isOpen, onOpen, onClose } = useDisclosure();
- const { rateExchange, setRateExchange } = useContext(GlobalStateContext);
+ const {} = useDisclosure();
const [isBtnLoading, setIsBtnLoading] = useState(false);
const { data, isLoading, errors } = useGetExchangeRateByIdQuery(id, {
@@ -89,31 +93,6 @@ const EditExchangeRate = ({ id, setIsLoading }) => {
return (
<>
-
-
-
{
Edit rate
-
-
-
- From
-
- {foundObject?.fromCurrency?.currencyCode}
-
-
-
- To
-
- {foundObject?.toCurrency?.currencyCode}
-
-
-
+ {isLoading ? (
+
+ ) : (
+ <>
+ {" "}
+
+
+
+ From
+
+ {foundObject?.fromCurrency?.currencyCode}
+
+
+
+ To
+
+ {foundObject?.toCurrency?.currencyCode}
+
+
+
- {/*
+ {/*
Last effective date
{formatDate(foundObject?.effectiveFrom)}
*/}
-
- Effective from
-
- {formatDate(getTomorrowDate())}
-
-
+
+ Effective from
+ {formatDate(getTomorrowDate())}
+
-
- Rate
- setRate(e.target.value)}
- />
-
-
+
+ Rate
+ setRate(e.target.value)}
+ />
+
+
+
+
-
-
-
-
-
+
+
+ >
+ )}
diff --git a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx
index 04dcf56..e97b09f 100644
--- a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx
+++ b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx
@@ -15,14 +15,15 @@ import {
Tag,
Text,
Tooltip,
+ useDisclosure,
useToast,
} from "@chakra-ui/react";
-import React, { useContext, useEffect, useState } from "react";
+import React, { useContext, useEffect, useRef, useState } from "react";
import { OPACITY_ON_LOAD } from "../../../Layout/animations";
import DataTable from "../../../Components/DataTable/DataTable";
import { HiDotsVertical } from "react-icons/hi";
import { Link, Link as RouterLink, useNavigate } from "react-router-dom";
-import { AddIcon, EmailIcon } from "@chakra-ui/icons";
+import { AddIcon, EditIcon, EmailIcon } from "@chakra-ui/icons";
import Pagination from "../../../Components/Pagination";
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
@@ -38,6 +39,7 @@ import { formatCurrency } from "../../../Components/CurrencyInput";
const ExchangeRate = () => {
const toast = useToast();
+ const btnRef = useRef();
const navigate = useNavigate();
const { slideFromRight, rateExchange, setRateExchange } =
useContext(GlobalStateContext);
@@ -48,6 +50,9 @@ const ExchangeRate = () => {
const [mouseEntered, setMouseEntered] = useState(false);
const [mouseEnteredId, setMouseEnteredId] = useState("");
+
+ const { isOpen, onOpen, onClose } = useDisclosure();
+
// ===============================[ Paginations ]
const [pageSize, setPageSize] = useState(TABLE_PAGINATION?.size);
const [currentPage, setCurrentPage] = useState(1);
@@ -132,12 +137,34 @@ const ExchangeRate = () => {
// Edit
//
-
-
+
+
+
{
tableHeadRow={tableHeadRow}
data={extractedArray}
isLoading={isExchangeRateLoading}
- viewActionId={actionId}
- setViewActionId={setActionId}
// totalPages={10}
setMouseEnteredId={setMouseEnteredId}
@@ -223,6 +248,19 @@ const ExchangeRate = () => {
alertHandler={handleDelete}
isLoading={isLoading}
/>
+
+
+
);
};
diff --git a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx
index fb6e01c..8aa920c 100644
--- a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx
+++ b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx
@@ -11,7 +11,7 @@ import {
useCreateInvestmentTypeMutation,
useGetInvestmentTypeByIdQuery,
useUpdateInvestmentTypeMutation,
-} from "../../../Services/investment.type.service";
+} from "../../../Services/io.service";
import ToastBox from "../../../Components/ToastBox";
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
diff --git a/src/Pages/Master/InvestmentType/InvestmentType.jsx b/src/Pages/Master/InvestmentType/InvestmentType.jsx
index 5d3f03f..ced6c27 100644
--- a/src/Pages/Master/InvestmentType/InvestmentType.jsx
+++ b/src/Pages/Master/InvestmentType/InvestmentType.jsx
@@ -21,7 +21,7 @@ import NormalTable from "../../../Components/DataTable/NormalTable";
import {
useDeleteInvestmentTypeMutation,
useGetInvestmentTypesQuery,
-} from "../../../Services/investment.type.service";
+} from "../../../Services/io.service";
import { TABLE_PAGINATION } from "../../../Constants/Paginations";
const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter
@@ -152,7 +152,7 @@ const InvestmentType = () => {
),
Action: (
- {
>
-
+ */}
{
diff --git a/src/Pages/Master/Sponser/AddSponser.jsx b/src/Pages/Master/Sponser/AddSponser.jsx
index 7f706b3..b20090b 100644
--- a/src/Pages/Master/Sponser/AddSponser.jsx
+++ b/src/Pages/Master/Sponser/AddSponser.jsx
@@ -7,13 +7,12 @@ import * as yup from "yup";
import { useNavigate, useParams } from "react-router-dom";
import { v4 as uuidv4 } from "uuid";
import FormInputMain from "../../../Components/FormInputMain";
-import {useCreateSponserMutation,useGetSponserByIdQuery,useUpdateSponserMutation,} from "../../../Services/sponser.service";
import ToastBox from "../../../Components/ToastBox";
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
import SwitchButton from "../../../Components/SwitchButton";
import DummyComponent from "../../../Components/DummyComponent";
-
+import { useCreateSponserMutation, useGetSponserByIdQuery, useUpdateSponserMutation } from "../../../Services/io.service";
// ======================= [validation] =========================
export const addSponser = yup.object().shape({
diff --git a/src/Pages/Master/Sponser/Sponsers.jsx b/src/Pages/Master/Sponser/Sponsers.jsx
index 5340eb3..39fbb31 100644
--- a/src/Pages/Master/Sponser/Sponsers.jsx
+++ b/src/Pages/Master/Sponser/Sponsers.jsx
@@ -11,7 +11,7 @@ import { useNavigate } from "react-router-dom";
import ToastBox from "../../../Components/ToastBox";
import { debounce } from "./AddSponser";
import { TABLE_PAGINATION } from "../../../Constants/Paginations";
-import {useDeleteSponserMutation,useGetSponserMasterQuery,useToggleStatusMutation,} from "../../../Services/sponser.service";
+import { useDeleteSponserMutation, useGetSponserMasterQuery } from "../../../Services/io.service";
export const formatDate = (date) => {
const d = new Date(date);
@@ -39,7 +39,6 @@ const Sponser = () => {
const [actionId, setActionId] = useState(false);
const [mouseEntered, setMouseEntered] = useState(false);
const [mouseEnteredId, setMouseEnteredId] = useState("");
- const [toggleStatus] = useToggleStatusMutation();
const [deleteSponser] = useDeleteSponserMutation();
const { sponser, setSponser, slideFromRight } = useContext(GlobalStateContext);
@@ -161,7 +160,7 @@ const Sponser = () => {
console.log(response?.data);
if(response?.error?.data?.code === 400){
toast({
- render: () => ,
+ render: () => ,
});
setIsLoading(false);
setDeleteAlert(false);
diff --git a/src/Pages/Master/Sponser/ViewSponser.jsx b/src/Pages/Master/Sponser/ViewSponser.jsx
index b53cd9a..56a97eb 100644
--- a/src/Pages/Master/Sponser/ViewSponser.jsx
+++ b/src/Pages/Master/Sponser/ViewSponser.jsx
@@ -5,7 +5,7 @@ import { useContext, useEffect, useState } from "react";
import FormInputView from "../../../Components/FormInputView";
import { useForm } from "react-hook-form"; // assuming react-hook-form is used
import { OPACITY_ON_LOAD } from "../../../Layout/animations";
-import { useGetSponserByIdQuery } from "../../../Services/sponser.service";
+import { useGetSponserByIdQuery } from "../../../Services/io.service";
const ViewSponser = () => {
const params = useParams();
diff --git a/src/Services/exchange.rate.service.js b/src/Services/exchange.rate.service.js
index ef0a186..666a845 100644
--- a/src/Services/exchange.rate.service.js
+++ b/src/Services/exchange.rate.service.js
@@ -12,6 +12,7 @@ export const exchangeRate = createApi({
tagTypes: ["getAllExchangeRate", "getExchangeById"],
endpoints: (builder) => ({
+
getAllExchangeRates: builder.query({
query: ({ page, size }) =>
`/currencyExchange/admin?page=${page}&size=${size}`,
@@ -20,7 +21,7 @@ export const exchangeRate = createApi({
getExchangeRateById: builder.query({
query: (id) => `/currencyExchange/admin/${id}`,
- providesTags: ["getAllExchangeRate"],
+ providesTags: ["getExchangeById"],
}),
updateExchangeRate: builder.mutation({
diff --git a/src/Services/investment.type.service.js b/src/Services/investment.type.service.js
index ffdd0dc..1dbc1e1 100644
--- a/src/Services/investment.type.service.js
+++ b/src/Services/investment.type.service.js
@@ -1,72 +1,72 @@
-// investmentType.service.js
-import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
-// import { api } from "./api.service";
-import { baseQuery } from "./token.serivce";
+// // investmentType.service.js
+// import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
+// // import { api } from "./api.service";
+// import { baseQuery } from "./token.serivce";
-// const baseUrl = api?.defaults.baseURL;
+// // const baseUrl = api?.defaults.baseURL;
-// Define a service using a base URL and expected endpoints
-export const investmentType = createApi({
- reducerPath: "investmentType",
- baseQuery: baseQuery,
- tagTypes: ["getInvestmentType", "getInvestmentTypeID"],
- endpoints: (builder) => ({
+// // Define a service using a base URL and expected endpoints
+// export const investmentType = createApi({
+// reducerPath: "investmentType",
+// baseQuery: baseQuery,
+// tagTypes: ["getInvestmentType", "getInvestmentTypeID"],
+// endpoints: (builder) => ({
- // ========[Get All]=========
+// // ========[Get All]=========
- getInvestmentTypes: builder.query({
- query: ({ page, size }) =>
- `/investmentType/admin?page=${page}&size=${size}`,
- providesTags: ["getInvestmentType"],
- }),
+// getInvestmentTypes: builder.query({
+// query: ({ page, size }) =>
+// `/investmentType/admin?page=${page}&size=${size}`,
+// providesTags: ["getInvestmentType"],
+// }),
- // ========[Get ID]=========
+// // ========[Get ID]=========
- getInvestmentTypeById: builder.query({
- query: (id) => `/investmentType/admin/${id}`,
- providesTags: ["getInvestmentTypeID"],
- }),
+// getInvestmentTypeById: builder.query({
+// query: (id) => `/investmentType/admin/${id}`,
+// providesTags: ["getInvestmentTypeID"],
+// }),
- // ========[Create Investment]========
+// // ========[Create Investment]========
- createInvestmentType: builder.mutation({
- query: (data) => ({
- url: `/investmentType/admin/`,
- method: "POST",
- body: data,
- }),
- invalidatesTags: ["getInvestmentType"],
- }),
+// createInvestmentType: builder.mutation({
+// query: (data) => ({
+// url: `/investmentType/admin/`,
+// method: "POST",
+// body: data,
+// }),
+// invalidatesTags: ["getInvestmentType"],
+// }),
- // ========[Update Investment]=======
+// // ========[Update Investment]=======
- updateInvestmentType: builder.mutation({
- query: ({ data, id }) => ({
- url: `/investmentType/admin/${id}`,
- method: "PATCH",
- body: data,
- }),
- invalidatesTags: ["getInvestmentTypeID", "getInvestmentType"],
- }),
+// updateInvestmentType: builder.mutation({
+// query: ({ data, id }) => ({
+// url: `/investmentType/admin/${id}`,
+// method: "PATCH",
+// body: data,
+// }),
+// invalidatesTags: ["getInvestmentTypeID", "getInvestmentType"],
+// }),
- // ========[Delete Investment]=======
+// // ========[Delete Investment]=======
- deleteInvestmentType: builder.mutation({
- query: (id) => ({
- url: `/investmentType/admin/delete/${id}`,
- method: "DELETE",
- }),
- invalidatesTags: ["getInvestmentType"],
- }),
+// deleteInvestmentType: builder.mutation({
+// query: (id) => ({
+// url: `/investmentType/admin/delete/${id}`,
+// method: "DELETE",
+// }),
+// invalidatesTags: ["getInvestmentType"],
+// }),
- }),
-});
+// }),
+// });
-// Export hooks for usage in functional components
-export const {
- useGetInvestmentTypesQuery,
- useGetInvestmentTypeByIdQuery,
- useCreateInvestmentTypeMutation,
- useUpdateInvestmentTypeMutation,
- useDeleteInvestmentTypeMutation,
-} = investmentType;
+// // Export hooks for usage in functional components
+// export const {
+// useGetInvestmentTypesQuery,
+// useGetInvestmentTypeByIdQuery,
+// useCreateInvestmentTypeMutation,
+// useUpdateInvestmentTypeMutation,
+// useDeleteInvestmentTypeMutation,
+// } = investmentType;
diff --git a/src/Services/io.service.js b/src/Services/io.service.js
index f3b6a66..9ffe66e 100644
--- a/src/Services/io.service.js
+++ b/src/Services/io.service.js
@@ -15,6 +15,9 @@ export const ioService = createApi({
"getArtifactsVideo",
"getInvestmentDocuments",
"getIOById",
+ "getSponser",
+ "getInvestmentType",
+ "getInvestmentTypeID"
],
endpoints: (builder) => ({
// =====[get prepopulate data]
@@ -181,7 +184,6 @@ export const ioService = createApi({
invalidatesTags: ["getIOById"],
}),
-
updateStatusIo: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/transaction/${id}/update-status/`,
@@ -242,8 +244,6 @@ export const ioService = createApi({
invalidatesTags: ["getIOById"],
}),
-
-
updateExitToInvestor: builder.mutation({
query: ({ id, data }) => ({
url: `/io/admin/transaction/${id}/exit`,
@@ -275,7 +275,6 @@ export const ioService = createApi({
invalidatesTags: ["getIOById"],
}),
-
setDisplayOrderIOArtifactsImage: builder.mutation({
query: ({ data }) => ({
url: `/io/admin/artifact/image/resetDisplayOrder`,
@@ -285,8 +284,6 @@ export const ioService = createApi({
invalidatesTags: ["getIOById"],
}),
-
-
setDisplayOrderIOArtifactsVideo: builder.mutation({
query: ({ data }) => ({
url: `/io/admin/artifact/video/resetDisplayOrder`,
@@ -296,6 +293,130 @@ export const ioService = createApi({
invalidatesTags: ["getIOById"],
}),
+ // ========[Create Sponser]========
+
+ createSponser: builder.mutation({
+ query: (data) => ({
+ url: `/sponsor/admin`,
+ method: "POST",
+ body: data,
+ }),
+ invalidatesTags: ["getSponser","prePopulate"],
+ }),
+
+ // ========[Update Sponser]========
+
+ updateSponser: builder.mutation({
+ query: ({ data, id }) => ({
+ url: `/sponsor/admin/${id}`,
+ method: "PATCH",
+ body: data,
+ }),
+ invalidatesTags: ["getSponser","prePopulate"],
+ }),
+
+ // ======[Get All]=====
+
+ getSponserMaster: builder.query({
+ query: ({ page, size }) => `/sponsor/admin?page=${page}&size=${size}`,
+ providesTags: ["getSponser"],
+ }),
+
+ // ========[Delete Sponser]========
+
+ deleteSponser: builder.mutation({
+ query: (id) => ({
+ url: `/sponsor/admin/delete/${id}`,
+ method: "DELETE",
+ }),
+ invalidatesTags: ["getSponser"],
+ }),
+
+ // ========[Get Active]========
+
+ getActiveSponserMaster: builder.query({
+ query: () => `/sponsor/admin/active`,
+ }),
+
+ getSponserMasterActive: builder.query({
+ query: () => "/sponsor/admin/active",
+ }),
+
+ // ======[Get ID]=====
+
+ getSponserById: builder.query({
+ query: (id) => `/sponsor/admin/${id}`,
+ }),
+
+ // ========[Get Active]========
+
+ getActiveSponserMaster: builder.query({
+ query: () => `/sponsor/admin/active`,
+ }),
+
+
+
+
+// ===============================[ Investment Type ]===================================
+
+
+ // ========[Get All]=========
+
+ getInvestmentTypes: builder.query({
+ query: ({ page, size }) =>
+ `/investmentType/admin?page=${page}&size=${size}`,
+ providesTags: ["getInvestmentType"],
+ }),
+
+ // ========[Get ID]=========
+
+ getInvestmentTypeById: builder.query({
+ query: (id) => `/investmentType/admin/${id}`,
+ providesTags: ["getInvestmentTypeID"],
+ }),
+
+ // ========[Create Investment]========
+
+ createInvestmentType: builder.mutation({
+ query: (data) => ({
+ url: `/investmentType/admin/`,
+ method: "POST",
+ body: data,
+ }),
+ invalidatesTags: ["getInvestmentType", "prePopulate"],
+ }),
+
+ // ========[Update Investment]=======
+
+ updateInvestmentType: builder.mutation({
+ query: ({ data, id }) => ({
+ url: `/investmentType/admin/${id}`,
+ method: "PATCH",
+ body: data,
+ }),
+ invalidatesTags: ["getInvestmentTypeID", "getInvestmentType", "prePopulate"],
+ }),
+
+ // ========[Delete Investment]=======
+
+ deleteInvestmentType: builder.mutation({
+ query: (id) => ({
+ url: `/investmentType/admin/delete/${id}`,
+ method: "DELETE",
+ }),
+ invalidatesTags: ["getInvestmentType", 'prePopulate'],
+ }),
+
+
+
+
+
+
+
+
+
+
+
@@ -346,9 +467,27 @@ export const {
useGetDistributionInvestorMutation,
-
-
useGetDistributedToInvestorMutation,
useUpdateExitToInvestorMutation,
+
+// ==============[ Sponser ]===============
+ useGetSponserMasterQuery,
+ useGetSponserMasterActiveQuery,
+ useCreateSponserMutation,
+ useUpdateSponserMutation,
+ useGetSponserByIdQuery,
+ useDeleteSponserMutation,
+ useGetActiveSponserMasterQuery,
+
+
+ // ============[ Investment Type ]========
+
+
+ useGetInvestmentTypesQuery,
+ useGetInvestmentTypeByIdQuery,
+ useCreateInvestmentTypeMutation,
+ useUpdateInvestmentTypeMutation,
+ useDeleteInvestmentTypeMutation,
+
} = ioService;
diff --git a/src/Services/sponser.service.js b/src/Services/sponser.service.js
index 5951e8b..c2e5a82 100644
--- a/src/Services/sponser.service.js
+++ b/src/Services/sponser.service.js
@@ -1,105 +1,105 @@
-//sponser.service
-// Need to use the React-specific entry point to import createApi
-import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
-// import { api } from "./api.service";
-import { baseQuery } from "./token.serivce";
-import { ioService } from "./io.service";
+// //sponser.service
+// // Need to use the React-specific entry point to import createApi
+// import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
+// // import { api } from "./api.service";
+// import { baseQuery } from "./token.serivce";
+// import { ioService } from "./io.service";
-// const baseUrl = api?.defaults.baseURL;
+// // const baseUrl = api?.defaults.baseURL;
-// const baseUrl = `${import.meta.env.VITE_API_BASE_URL}/${import.meta.env.VITE_API_VERSION}`
+// // const baseUrl = `${import.meta.env.VITE_API_BASE_URL}/${import.meta.env.VITE_API_VERSION}`
-// Define a service using a base URL and expected endpoints
-export const sponserMaster = createApi({
- reducerPath: "sponserMaster",
- baseQuery: baseQuery,
- tagTypes: ["getSponser", "prePopulate"],
- endpoints: (builder) => ({
+// // Define a service using a base URL and expected endpoints
+// export const sponserMaster = createApi({
+// reducerPath: "sponserMaster",
+// baseQuery: baseQuery,
+// tagTypes: ["getSponser", "prePopulate"],
+// endpoints: (builder) => ({
- // ======[Get All]=====
+// // ======[Get All]=====
- getSponserMaster: builder.query({
- query: ({ page, size }) => `/sponsor/admin?page=${page}&size=${size}`,
- providesTags: ["getSponser"],
- }),
+// getSponserMaster: builder.query({
+// query: ({ page, size }) => `/sponsor/admin?page=${page}&size=${size}`,
+// providesTags: ["getSponser"],
+// }),
- // ========[Get Active]========
+// // ========[Get Active]========
- getActiveSponserMaster: builder.query({
- query: () => `/sponsor/admin/active`,
- }),
+// getActiveSponserMaster: builder.query({
+// query: () => `/sponsor/admin/active`,
+// }),
- getSponserMasterActive: builder.query({
- query: () => "/sponsor/admin/active",
- }),
+// getSponserMasterActive: builder.query({
+// query: () => "/sponsor/admin/active",
+// }),
- // ======[Get ID]=====
+// // ======[Get ID]=====
- getSponserById: builder.query({
- query: (id) => `/sponsor/admin/${id}`,
- }),
+// getSponserById: builder.query({
+// query: (id) => `/sponsor/admin/${id}`,
+// }),
- // ========[Toggle Status]========
+// // ========[Toggle Status]========
- toggleStatus: builder.mutation({
- query: ({ id }) => ({
- url: `/sponsor/admin/toggle-status/${id}`,
- method: "PATCH",
- }),
- invalidatesTags: ["getSponser"],
- }),
+// toggleStatus: builder.mutation({
+// query: ({ id }) => ({
+// url: `/sponsor/admin/toggle-status/${id}`,
+// method: "PATCH",
+// }),
+// invalidatesTags: ["getSponser"],
+// }),
- // ========[Create Sponser]========
+// // ========[Create Sponser]========
- createSponser: builder.mutation({
- query: (data) => ({
- url: `/sponsor/admin`,
- method: "POST",
- body: data,
- }),
- invalidatesTags: ["getSponser","prePopulate"],
- }),
+// createSponser: builder.mutation({
+// query: (data) => ({
+// url: `/sponsor/admin`,
+// method: "POST",
+// body: data,
+// }),
+// invalidatesTags: ["getSponser","prePopulate"],
+// }),
- // ========[Update Sponser]========
+// // ========[Update Sponser]========
- updateSponser: builder.mutation({
- query: ({ data, id }) => ({
- url: `/sponsor/admin/${id}`,
- method: "PATCH",
- body: data,
- }),
- invalidatesTags: ["getSponser"],
- }),
+// updateSponser: builder.mutation({
+// query: ({ data, id }) => ({
+// url: `/sponsor/admin/${id}`,
+// method: "PATCH",
+// body: data,
+// }),
+// invalidatesTags: ["getSponser"],
+// }),
- // ========[Delete Sponser]========
+// // ========[Delete Sponser]========
- deleteSponser: builder.mutation({
- query: (id) => ({
- url: `/sponsor/admin/delete/${id}`,
- method: "DELETE",
- }),
- invalidatesTags: ["getSponser"],
- }),
+// deleteSponser: builder.mutation({
+// query: (id) => ({
+// url: `/sponsor/admin/delete/${id}`,
+// method: "DELETE",
+// }),
+// invalidatesTags: ["getSponser"],
+// }),
- }),
-});
+// }),
+// });
-// Export hooks for usage in functional components
-export const {
- useGetSponserMasterQuery,
- useGetSponserMasterActiveQuery,
- useToggleStatusMutation,
- useCreateSponserMutation,
- useUpdateSponserMutation,
- useGetSponserByIdQuery,
- useDeleteSponserMutation,
- useGetActiveSponserMasterQuery
-} = sponserMaster;
+// // Export hooks for usage in functional components
+// export const {
+// useGetSponserMasterQuery,
+// useGetSponserMasterActiveQuery,
+// useToggleStatusMutation,
+// useCreateSponserMutation,
+// useUpdateSponserMutation,
+// useGetSponserByIdQuery,
+// useDeleteSponserMutation,
+// useGetActiveSponserMasterQuery
+// } = sponserMaster;
diff --git a/src/Store/Store.js b/src/Store/Store.js
index 6725a81..c0a64a8 100644
--- a/src/Store/Store.js
+++ b/src/Store/Store.js
@@ -1,7 +1,7 @@
import { configureStore } from "@reduxjs/toolkit";
import { setupListeners } from "@reduxjs/toolkit/query";
-import { sponserMaster } from "../Services/sponser.service";
-import { investmentType } from "../Services/investment.type.service";
+// import { sponserMaster } from "../Services/sponser.service";
+// import { investmentType } from "../Services/investment.type.service";
import { exchangeRate } from "../Services/exchange.rate.service";
import { ioService } from "../Services/io.service";
import { investorDetails } from "../Services/investor.details.service";
@@ -17,8 +17,8 @@ import { drawalRequest } from "../Services/drawal.request.service";
export const store = configureStore({
reducer: {
[apiSlice.reducerPath]: apiSlice.reducer,
- [sponserMaster.reducerPath]: sponserMaster.reducer,
- [investmentType.reducerPath]: investmentType.reducer,
+ // [sponserMaster.reducerPath]: sponserMaster.reducer,
+ // [investmentType.reducerPath]: investmentType.reducer,
[exchangeRate.reducerPath]: exchangeRate.reducer,
[ioService.reducerPath]: ioService.reducer,
[investorDetails.reducerPath]: investorDetails.reducer,
@@ -36,8 +36,8 @@ export const store = configureStore({
},
}).concat(
apiSlice.middleware,
- sponserMaster.middleware,
- investmentType.middleware,
+ // sponserMaster.middleware,
+ // investmentType.middleware,
exchangeRate.middleware,
ioService.middleware,
investorDetails.middleware,