Investment

Add:
-  components/Button/CoyButton.tsx
-  constants/local-storage-key.ts

Fix:
- Integrasi pada proses transaksi pmebelian investasi

### No Issue
This commit is contained in:
2025-10-02 17:29:25 +08:00
parent aa85e05f79
commit 2be4afdcb1
12 changed files with 514 additions and 113 deletions

View File

@@ -137,3 +137,67 @@ export async function apiInvestmentGetAll() {
}
}
export async function apiInvestmentCreateInvoice({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(
`/mobile/investment/${id}/invoice`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiInvestmentGetInvoice({
id,
authorId,
category,
}: {
id?: string;
authorId?: string;
category: "my-invest" | "transaction" | "invoice";
}) {
const categoryQuery = `?category=${category}`;
const authorIdQuery = authorId ? `&authorId=${authorId}` : "";
try {
const response = await apiConfig.get(
`/mobile/investment/${id}/invoice${categoryQuery}${authorIdQuery}`
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiInvestmentUpdateInvoice({
id,
data,
status,
}: {
id: string;
data: {
imageId?: string;
};
status: "berhasil" | "gagal" | "proses" | "menunggu";
}) {
try {
const response = await apiConfig.put(
`/mobile/investment/${id}/invoice?status=${status}`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}

View File

@@ -110,7 +110,11 @@ export async function apiForumCreateReportCommentar({
export async function apiMasterInvestment({
category,
}: {
category?: "pencarian-investor" | "periode-deviden" | "pembagian-deviden" | string;
category?:
| "pencarian-investor"
| "periode-deviden"
| "pembagian-deviden"
| string;
}) {
const selectCategory = category ? `?category=${category}` : "";
try {
@@ -122,3 +126,12 @@ export async function apiMasterInvestment({
throw error;
}
}
export async function apiMasterBank() {
try {
const response = await apiConfig.get(`/mobile/master/bank`);
return response.data;
} catch (error) {
throw error;
}
}