Merge pull request #30 from bipproduction/investasi/payment_gateway
Investasi/payment gateway
4
.env
@@ -5,4 +5,6 @@
|
|||||||
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
|
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
|
||||||
|
|
||||||
DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public"
|
DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public"
|
||||||
PWD="QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb"
|
PWD="QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb"
|
||||||
|
Client_KEY="SB-Mid-client-9NDTxltqdZrEB9m-"
|
||||||
|
Server_KEY="SB-Mid-server-NyltU-U7fLVQd1nv1LWBKylr"
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
"iron-session": "^6.3.1",
|
"iron-session": "^6.3.1",
|
||||||
"jotai": "^2.4.3",
|
"jotai": "^2.4.3",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
"midtrans-client": "^1.3.1",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"next": "^13.5.4-canary.8",
|
"next": "^13.5.4-canary.8",
|
||||||
"postcss": "8.4.27",
|
"postcss": "8.4.27",
|
||||||
|
|||||||
@@ -100,21 +100,23 @@ model MasterBidangBisnis {
|
|||||||
// -------------------- INVESTASI --------------------- //
|
// -------------------- INVESTASI --------------------- //
|
||||||
// Table investasi / saham
|
// Table investasi / saham
|
||||||
model Investasi {
|
model Investasi {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
title String
|
title String
|
||||||
targetDana String
|
targetDana String
|
||||||
hargaLembar String
|
hargaLembar String
|
||||||
totalLembar String
|
totalLembar String
|
||||||
roi String
|
roi String
|
||||||
active Boolean @default(true)
|
active Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
|
||||||
updatedAt DateTime @default(now()) @updatedAt
|
countDown DateTime?
|
||||||
author User? @relation(fields: [authorId], references: [id])
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
author User? @relation(fields: [authorId], references: [id])
|
||||||
authorId String?
|
authorId String?
|
||||||
catatan String?
|
catatan String?
|
||||||
sisaLembar String
|
sisaLembar String
|
||||||
lembarTerbeli String? @default("0")
|
lembarTerbeli String? @default("0")
|
||||||
progress String? @default("0")
|
progress String? @default("0")
|
||||||
|
|
||||||
MasterPeriodeDeviden MasterPeriodeDeviden? @relation(fields: [masterPeriodeDevidenId], references: [id])
|
MasterPeriodeDeviden MasterPeriodeDeviden? @relation(fields: [masterPeriodeDevidenId], references: [id])
|
||||||
masterPeriodeDevidenId String?
|
masterPeriodeDevidenId String?
|
||||||
@@ -218,16 +220,31 @@ model MasterBank {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model TransaksiInvestasi {
|
model TransaksiInvestasi {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
Investasi Investasi? @relation(fields: [investasiId], references: [id])
|
Investasi Investasi @relation(fields: [investasiId], references: [id])
|
||||||
investasiId String?
|
investasiId String
|
||||||
Author User? @relation(fields: [authorId], references: [id])
|
Author User @relation(fields: [authorId], references: [id])
|
||||||
authorId String?
|
authorId String
|
||||||
|
|
||||||
|
namaBank String?
|
||||||
|
nomorRekening String?
|
||||||
|
token String?
|
||||||
|
redirect_url String?
|
||||||
|
quantity String
|
||||||
|
price String
|
||||||
|
gross_amount String
|
||||||
|
merchant_name String
|
||||||
|
status_code String?
|
||||||
|
status_message String?
|
||||||
|
transaction_id String?
|
||||||
|
order_id String?
|
||||||
|
payment_type String?
|
||||||
|
transaction_time String?
|
||||||
|
transaction_status String?
|
||||||
|
fraud_status String?
|
||||||
|
pdf_url String?
|
||||||
|
finish_redirect_url String?
|
||||||
|
|
||||||
namaBank String
|
|
||||||
nomorRekening String
|
|
||||||
lembarTerbeli String
|
|
||||||
totalTransfer String
|
|
||||||
active Boolean @default(true)
|
active Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|||||||
BIN
public/aset/investasi/home-hipmi.png
Normal file
|
After Width: | Height: | Size: 291 KiB |
BIN
public/file/07ff2276-c08d-4e4e-8ab1-09bd3da614e4.pdf
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
BIN
public/file/2382858f-5586-40d5-a63f-aa3f4cb35bb5.pdf
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/file/2e4f2d30-e190-40b7-9719-c114c2816786.pdf
Normal file
BIN
public/file/3525303f-3537-4278-a7b9-b08f8210e62e.pdf
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
BIN
public/file/77f3b86b-9a8f-40d6-abcc-3da54b5e18a5.pdf
Normal file
|
After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
BIN
public/file/8eada122-415d-4e47-b272-ca386da87de2.pdf
Normal file
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
BIN
public/file/a936677b-e936-4858-83bd-ad6ca561fa75.pdf
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
BIN
public/file/bc01912d-857b-4223-b7be-cad8e941fe55.pdf
Normal file
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
BIN
public/file/dcf5d2e5-99aa-4317-b6e7-114f22cdd530.pdf
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
BIN
public/file/f1e236c5-e9c6-4fd8-9359-690fcc831172.pdf
Normal file
|
After Width: | Height: | Size: 816 KiB |
1
public/file/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Image for file
|
||||||
|
Before Width: | Height: | Size: 60 KiB |
BIN
public/investasi/096dd9a5-9c99-40bc-a965-6e5cbbbac65c.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
BIN
public/investasi/0d8dff94-0f13-412d-b629-2ccdaa5eb0cd.png
Normal file
|
After Width: | Height: | Size: 816 KiB |
BIN
public/investasi/0f380d71-f1d7-4d36-a303-8f5e35e2f4a9.jpeg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/investasi/122c806d-00f2-45eb-a7f0-b03f96a8d065.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
BIN
public/investasi/1a18c5f1-7cae-4a30-9a58-9a4d4080cd7e.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 60 KiB |
BIN
public/investasi/1cf3bcf1-23cf-46ca-9376-706e38ad6232.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
public/investasi/23aa0fd6-5479-4c8e-b5a3-4370739496de.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
public/investasi/2e2e21c5-233a-4982-99cb-944f3732c7ce.jpeg
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
public/investasi/3071eb24-6c32-4933-b910-86f4708dea33.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
public/investasi/31c56c35-62ad-4d99-9759-79b8041526b0.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 60 KiB |
BIN
public/investasi/4c94a52d-e7ba-4206-ae3f-e0224ed250b1.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 60 KiB |
BIN
public/investasi/5121f1ac-0f77-4e6b-9efd-9a720a428a90.png
Normal file
|
After Width: | Height: | Size: 816 KiB |
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 194 KiB |
BIN
public/investasi/7536ab7e-6e83-4a67-890e-b8310fd34489.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
BIN
public/investasi/7c89447d-c0bb-43a5-be74-6a5af2f64c46.jpeg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
public/investasi/8a7ba77a-c9eb-4414-9b5d-9818fa1fdfe0.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 194 KiB |
BIN
public/investasi/968362f6-c34e-4873-afd7-57e2c954bf0a.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 194 KiB |
BIN
public/investasi/9faf04ce-7621-4b2d-8c4f-fb447aa71ecc.png
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
public/investasi/b6b5f6f8-0c08-466c-adb2-4e06973dc744.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
BIN
public/investasi/cbe1b9b4-db4d-4774-8347-73898ffbeb6d.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
public/investasi/d5520b3e-1cd0-47b0-bdcd-1bcb61a18ad4.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
BIN
public/investasi/d7676dc6-7213-47aa-9a69-31078d8b038b.jpeg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
public/investasi/db3fafcd-cefe-4d24-8cc8-bf34d35f9d2d.png
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
public/investasi/dd37b54c-8d1a-4c17-aa2c-ebf18f6ff3cf.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
public/investasi/e071a6c4-c9c2-4df1-9f36-b5c0176646a5.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 194 KiB |
BIN
public/investasi/e5ed3b6d-7215-4018-84c7-3f90c0c92552.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
BIN
public/investasi/ed11274a-a1ea-47da-bd06-96cffbb5945c.jpeg
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
public/investasi/f365bf66-febb-4d48-aec8-acd7f3f59cbe.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
public/investasi/f769c96d-5787-42ac-965d-96c65be604cd.jpeg
Normal file
|
After Width: | Height: | Size: 156 KiB |
1
public/investasi/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Image for investasi
|
||||||
@@ -6,6 +6,7 @@ export async function GET(
|
|||||||
req: NextRequest,
|
req: NextRequest,
|
||||||
{ params }: { params: { id: string } }
|
{ params }: { params: { id: string } }
|
||||||
) {
|
) {
|
||||||
|
console.log(params.id)
|
||||||
const data = await prisma.prospektusInvestasi.findUnique({
|
const data = await prisma.prospektusInvestasi.findUnique({
|
||||||
where: { id: params.id },
|
where: { id: params.id },
|
||||||
select: {
|
select: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Admin_Investasi } from "@/app_modules/admin/investasi";
|
import { Admin_Investasi } from "@/app_modules/admin/investasi";
|
||||||
import Admin_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
|
import Admin_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
|
||||||
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
||||||
import Admin_getTargetTerbesarInvestasi from "@/app_modules/admin/investasi/fun/get_target_terbesar";
|
import Admin_getPublishProgresInvestasi from "@/app_modules/admin/investasi/fun/get_publish_progres";
|
||||||
import Admin_getTotalInvestasiByUser from "@/app_modules/admin/investasi/fun/get_total_investasi_by_user";
|
import Admin_getTotalInvestasiByUser from "@/app_modules/admin/investasi/fun/get_total_investasi_by_user";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
@@ -11,8 +11,8 @@ export default async function Page() {
|
|||||||
const countPublish = await Admin_CountStatusInvestasi(3);
|
const countPublish = await Admin_CountStatusInvestasi(3);
|
||||||
const countReject = await Admin_CountStatusInvestasi(4);
|
const countReject = await Admin_CountStatusInvestasi(4);
|
||||||
const totalInvestasiByUser = await Admin_getTotalInvestasiByUser()
|
const totalInvestasiByUser = await Admin_getTotalInvestasiByUser()
|
||||||
const targetTerbesar = await Admin_getTargetTerbesarInvestasi()
|
const publishProgres = await Admin_getPublishProgresInvestasi()
|
||||||
// console.log(totalInvestasi)
|
// console.log(targetTerbesar)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -23,6 +23,7 @@ export default async function Page() {
|
|||||||
countPublish={countPublish}
|
countPublish={countPublish}
|
||||||
countReject={countReject}
|
countReject={countReject}
|
||||||
totalInvestasiByUser={totalInvestasiByUser}
|
totalInvestasiByUser={totalInvestasiByUser}
|
||||||
|
publishProgres={publishProgres}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
{/* <pre>{JSON.stringify(totalInvestasiByUser, null,2)}</pre> */}
|
{/* <pre>{JSON.stringify(totalInvestasiByUser, null,2)}</pre> */}
|
||||||
|
|||||||
10
src/app/dev/admin/investasi/table_status/publish/page.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { Admin_TablePublishInvestasi } from "@/app_modules/admin/investasi";
|
||||||
|
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
||||||
|
|
||||||
|
export default async function Page() {
|
||||||
|
const listInvestasi = await Admin_funGetAllInvestasi();
|
||||||
|
|
||||||
|
return<>
|
||||||
|
<Admin_TablePublishInvestasi dataInvestsi={listInvestasi as any}/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
10
src/app/dev/admin/investasi/table_status/reject/page.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { Admin_TableRejectInvestasi } from "@/app_modules/admin/investasi";
|
||||||
|
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
||||||
|
|
||||||
|
export default async function Page() {
|
||||||
|
const dataInvestsi = await Admin_funGetAllInvestasi()
|
||||||
|
return <>
|
||||||
|
<Admin_TableRejectInvestasi dataInvestsi={dataInvestsi as any}/>
|
||||||
|
|
||||||
|
</>
|
||||||
|
}
|
||||||
9
src/app/dev/admin/investasi/table_status/review/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { Admin_TableReviewInvestasi } from "@/app_modules/admin/investasi";
|
||||||
|
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
||||||
|
|
||||||
|
export default async function Page() {
|
||||||
|
const dataInvestsi = await Admin_funGetAllInvestasi()
|
||||||
|
return <>
|
||||||
|
<Admin_TableReviewInvestasi dataInvestsi={dataInvestsi as any}/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
import { DetailPropektus } from "@/app_modules/investasi";
|
import { DetailPropektus } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
export default async function Page({params}:{params: {id: string}}) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id)
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
|
|
||||||
|
|
||||||
return<>
|
return (
|
||||||
<DetailPropektus dataInvestasi={dataInvestasi as any}/>
|
<>
|
||||||
|
<DetailPropektus dataInvestasi={dataInvestasi as any} />
|
||||||
</>
|
</>
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
import { DetailSahamTerbeli } from "@/app_modules/investasi";
|
import { DetailSahamTerbeli } from "@/app_modules/investasi";
|
||||||
|
import funTotalInvestorByIdInvestasi from "@/app_modules/investasi/fun/fun_total_investor_by_id";
|
||||||
|
import getOneTransaksiBerhasilByIdInvestasi from "@/app_modules/investasi/fun/get_one_transaksi_berhasil_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
return <DetailSahamTerbeli id={params.id} />;
|
const dataTransaksi = await getOneTransaksiBerhasilByIdInvestasi(params.id);
|
||||||
|
const investor = await funTotalInvestorByIdInvestasi(
|
||||||
|
dataTransaksi?.Investasi.id as any
|
||||||
|
);
|
||||||
|
// console.log(investor);
|
||||||
|
|
||||||
|
return <DetailSahamTerbeli dataTransaksi={dataTransaksi as any} investor={investor} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,23 @@
|
|||||||
import { InvestasiSahamTerbeli } from "@/app_modules/investasi";
|
import { InvestasiSahamTerbeli } from "@/app_modules/investasi";
|
||||||
|
import getListTransaksiBerhasilInvestasi from "@/app_modules/investasi/fun/get_list_transaksi_berhasil_by_id";
|
||||||
|
import yaml from "yaml";
|
||||||
|
import fs from "fs";
|
||||||
|
import { cookies } from "next/headers";
|
||||||
|
import { unsealData } from "iron-session";
|
||||||
|
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
const c = cookies().get("ssn");
|
||||||
|
const user = JSON.parse(
|
||||||
|
await unsealData(c?.value as string, {
|
||||||
|
password: config.server.password,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const listTransaksi = await getListTransaksiBerhasilInvestasi(user.id)
|
||||||
|
// console.log(listTransaksi)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<InvestasiSahamTerbeli />
|
<InvestasiSahamTerbeli listTransaksi={listTransaksi as any} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default async function Page() {
|
|||||||
const userId = tkn.id;
|
const userId = tkn.id;
|
||||||
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
||||||
const listTransaksi = await getListAllTransaksiById_Investasi(userId);
|
const listTransaksi = await getListAllTransaksiById_Investasi(userId);
|
||||||
|
// console.log(listTransaksi)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
12
src/app/dev/investasi/proses_transaksi/[id]/layout.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { LayoutProsesTransaksiInvestasi } from "@/app_modules/investasi";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export default async function Layout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<LayoutProsesTransaksiInvestasi>{children}</LayoutProsesTransaksiInvestasi>
|
||||||
|
);
|
||||||
|
}
|
||||||
29
src/app/dev/investasi/proses_transaksi/[id]/page.tsx
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { ProsesTransaksiInvestasi } from "@/app_modules/investasi";
|
||||||
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
import { unsealData } from "iron-session";
|
||||||
|
import { cookies } from "next/headers";
|
||||||
|
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||||
|
import yaml from "yaml";
|
||||||
|
import fs from "fs";
|
||||||
|
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
const c = cookies().get("ssn");
|
||||||
|
const user = JSON.parse(
|
||||||
|
await unsealData(c?.value as string, {
|
||||||
|
password: config.server.password,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const userLogin = await funGetUserProfile(user.id);
|
||||||
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
|
// console.log(userLogin);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ProsesTransaksiInvestasi
|
||||||
|
dataInvestasi={dataInvestasi as any}
|
||||||
|
userLogin={userLogin as any}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -8,7 +8,10 @@ export const RouterAdminInvestasi = {
|
|||||||
halaman_aksi: "/dev/admin/investasi/halaman_aksi/",
|
halaman_aksi: "/dev/admin/investasi/halaman_aksi/",
|
||||||
konfirmasi: "/dev/admin/investasi/konfirmasi/",
|
konfirmasi: "/dev/admin/investasi/konfirmasi/",
|
||||||
bukti_transfer: "/dev/admin/investasi/bukti_transfer",
|
bukti_transfer: "/dev/admin/investasi/bukti_transfer",
|
||||||
status_transfer: "/dev/admin/investasi/status_transfer"
|
status_transfer: "/dev/admin/investasi/status_transfer",
|
||||||
|
table_status_publish: "/dev/admin/investasi/table_status/publish",
|
||||||
|
table_status_review: "/dev/admin/investasi/table_status/review",
|
||||||
|
table_status_reject: "/dev/admin/investasi/table_status/reject",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RouterAdminAward = {
|
export const RouterAdminAward = {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export const RouterInvestasi = {
|
|||||||
|
|
||||||
// proses beli saham
|
// proses beli saham
|
||||||
proses_investasi: "/dev/investasi/proses_investasi/",
|
proses_investasi: "/dev/investasi/proses_investasi/",
|
||||||
|
proses_transaksi: "/dev/investasi/proses_transaksi/",
|
||||||
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
||||||
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
||||||
metode_transfer: "/dev/investasi/metode_transfer/",
|
metode_transfer: "/dev/investasi/metode_transfer/",
|
||||||
@@ -30,6 +31,7 @@ export const RouterInvestasi = {
|
|||||||
edit_berita: "/dev/investasi/edit_berita/",
|
edit_berita: "/dev/investasi/edit_berita/",
|
||||||
|
|
||||||
// detail //
|
// detail //
|
||||||
|
detail: "/dev/investasi/detail/",
|
||||||
detail_portofolio: "",
|
detail_portofolio: "",
|
||||||
detail_saham_terbeli: "/dev/investasi/detail_saham_terbeli/",
|
detail_saham_terbeli: "/dev/investasi/detail_saham_terbeli/",
|
||||||
detail_prospektus: "/dev/investasi/detail_prospektus/",
|
detail_prospektus: "/dev/investasi/detail_prospektus/",
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { Title } from "@mantine/core"
|
import { Divider, Stack, Title } from "@mantine/core"
|
||||||
|
|
||||||
export default function Admin_Award(){
|
export default function Admin_Award(){
|
||||||
return<>
|
return<>
|
||||||
<Title>halaman award</Title>
|
<Stack spacing={"sm"}>
|
||||||
|
<Title>Award</Title>
|
||||||
|
<Divider mb={"md"} />
|
||||||
|
<Stack align="center" justify="center" h={"80vh"}>
|
||||||
|
<Title>Cooming Soon !!</Title>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,39 @@
|
|||||||
"use server"
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma"
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
export default async function Admin_funGetAllInvestasi() {
|
export default async function Admin_funGetAllInvestasi() {
|
||||||
const res = await prisma.investasi.findMany({
|
const res = await prisma.investasi.findMany({
|
||||||
where: {
|
where: {
|
||||||
MasterStatusInvestasi: {
|
MasterStatusInvestasi: {
|
||||||
name: {
|
name: {
|
||||||
not: "Draft"
|
not: "Draft",
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
select: {
|
},
|
||||||
id: true,
|
},
|
||||||
title: true,
|
select: {
|
||||||
authorId: true,
|
id: true,
|
||||||
hargaLembar: true,
|
title: true,
|
||||||
targetDana: true,
|
authorId: true,
|
||||||
totalLembar: true,
|
hargaLembar: true,
|
||||||
roi: true,
|
targetDana: true,
|
||||||
active: true,
|
totalLembar: true,
|
||||||
imagesId: true,
|
roi: true,
|
||||||
catatan: true,
|
active: true,
|
||||||
MasterStatusInvestasi: true,
|
imagesId: true,
|
||||||
BeritaInvestasi: true,
|
catatan: true,
|
||||||
DokumenInvestasi: true,
|
MasterStatusInvestasi: true,
|
||||||
ProspektusInvestasi: true,
|
BeritaInvestasi: true,
|
||||||
MasterPembagianDeviden: true,
|
DokumenInvestasi: true,
|
||||||
MasterPencarianInvestor: true,
|
ProspektusInvestasi: true,
|
||||||
MasterPeriodeDeviden: true,
|
MasterPembagianDeviden: true,
|
||||||
},
|
MasterPencarianInvestor: true,
|
||||||
})
|
MasterPeriodeDeviden: true,
|
||||||
// console.log(res)
|
author: true,
|
||||||
return res
|
progress: true,
|
||||||
}
|
sisaLembar: true
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// console.log(res)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,20 +3,31 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
export default async function Admin_getTargetTerbesarInvestasi() {
|
export default async function Admin_getPublishProgresInvestasi() {
|
||||||
const data = await prisma.investasi.findMany({
|
const data = await prisma.investasi.findMany({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
targetDana: "desc",
|
updatedAt: "desc"
|
||||||
},
|
},
|
||||||
|
where: {
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
name: "Publish",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
select: {
|
select: {
|
||||||
|
id: true,
|
||||||
|
|
||||||
author: {
|
author: {
|
||||||
select: {
|
select: {
|
||||||
username: true,
|
username: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
updatedAt: true,
|
||||||
targetDana: true,
|
targetDana: true,
|
||||||
|
progress: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,9 @@ import Admin_BuktiTransferInvestasi from "./bukti_transfer/view";
|
|||||||
import Admin_LayoutBuktiTransferInvestasi from "./bukti_transfer/layout";
|
import Admin_LayoutBuktiTransferInvestasi from "./bukti_transfer/layout";
|
||||||
import Admin_StatusTransferInvesatasi from "./status_transfer/view";
|
import Admin_StatusTransferInvesatasi from "./status_transfer/view";
|
||||||
import Admin_LayoutStatusTransferInvesatasi from "./status_transfer/layout";
|
import Admin_LayoutStatusTransferInvesatasi from "./status_transfer/layout";
|
||||||
|
import Admin_TableReviewInvestasi from "./main/table_review";
|
||||||
|
import Admin_TablePublishInvestasi from "./main/table_publish";
|
||||||
|
import Admin_TableRejectInvestasi from "./main/table_reject";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Admin_Investasi,
|
Admin_Investasi,
|
||||||
@@ -18,4 +21,7 @@ export {
|
|||||||
Admin_LayoutBuktiTransferInvestasi,
|
Admin_LayoutBuktiTransferInvestasi,
|
||||||
Admin_StatusTransferInvesatasi,
|
Admin_StatusTransferInvesatasi,
|
||||||
Admin_LayoutStatusTransferInvesatasi,
|
Admin_LayoutStatusTransferInvesatasi,
|
||||||
|
Admin_TablePublishInvestasi,
|
||||||
|
Admin_TableReviewInvestasi,
|
||||||
|
Admin_TableRejectInvestasi,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,8 +51,13 @@ import _ from "lodash";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
import toast, { toastConfig } from "react-simple-toasts";
|
||||||
import Admin_funRejectInvestasi from "../fun/fun_reject_investasi";
|
import Admin_funRejectInvestasi from "../fun/fun_reject_investasi";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
|
import "react-simple-toasts/dist/theme/dark.css";
|
||||||
|
import { BeritaInvestasi } from "@/app_modules/investasi";
|
||||||
|
|
||||||
|
toastConfig({ theme: "dark" });
|
||||||
|
|
||||||
export default function Admin_KonfirmasiInvestasi({
|
export default function Admin_KonfirmasiInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
@@ -101,13 +106,14 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
async function onReject() {
|
async function onReject() {
|
||||||
const body = {
|
const body = {
|
||||||
id: investasi.id,
|
id: investasi.id,
|
||||||
catatan: catatan,
|
catatan: investasi.catatan,
|
||||||
status: "4",
|
status: "4",
|
||||||
};
|
};
|
||||||
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
||||||
await Admin_funRejectInvestasi(body).then((res) => {
|
await Admin_funRejectInvestasi(body).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
|
router.back();
|
||||||
toggle();
|
toggle();
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
@@ -116,9 +122,13 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function onPublish() {
|
async function onPublish() {
|
||||||
const res = await funGantiStatusInvestasi(investasi.id, "3");
|
await funGantiStatusInvestasi(investasi.id, "3").then((res) => {
|
||||||
setTimeout(() => setPublish(false), 1000);
|
if (res.status === 200) {
|
||||||
toast("Proyek Investasi Di Publish");
|
setTimeout(() => setPublish(false), 1000);
|
||||||
|
router.push(RouterAdminInvestasi.table_status_review);
|
||||||
|
toast("Proyek Investasi Di Publish");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -146,6 +156,18 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
|
// <Button
|
||||||
|
// radius={50}
|
||||||
|
// leftIcon={<IconBan />}
|
||||||
|
// bg={"orange"}
|
||||||
|
// color="orange"
|
||||||
|
// onClick={() => {
|
||||||
|
// setTimeout(() => setPublish(true), 1000);
|
||||||
|
// toast("Proyek Investasi Di Non-Aktifkan");
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// Non - aktifkan
|
||||||
|
// </Button>
|
||||||
<Button
|
<Button
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={"green"}
|
bg={"green"}
|
||||||
@@ -157,18 +179,6 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
>
|
>
|
||||||
Publish
|
Publish
|
||||||
</Button>
|
</Button>
|
||||||
// <Button
|
|
||||||
// radius={50}
|
|
||||||
// leftIcon={<IconBan />}
|
|
||||||
// bg={"orange"}
|
|
||||||
// color="orange"
|
|
||||||
// onClick={() => {
|
|
||||||
// setTimeout(() => setPublish(true), 1000);
|
|
||||||
// toast("Proyek Investasi Di Non-Aktifkan");
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// Non - aktifkan
|
|
||||||
// </Button>
|
|
||||||
)}
|
)}
|
||||||
</Center>
|
</Center>
|
||||||
{investasi.MasterStatusInvestasi.id === "3" ? (
|
{investasi.MasterStatusInvestasi.id === "3" ? (
|
||||||
@@ -191,7 +201,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
|
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={4}>
|
<Grid.Col span={6}>
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<Center my={"sm"}>
|
<Center my={"sm"}>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={4} mb={"xs"}>
|
||||||
@@ -209,17 +219,27 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|
||||||
{/* Rincian Data */}
|
{/* Rincian Data */}
|
||||||
<Grid.Col span={4}>
|
<Grid.Col span={6}>
|
||||||
<Grid p={"md"} mb={"md"}>
|
<Grid mt={"md"}>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {investasi.targetDana}</Text>
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+investasi.targetDana)}
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp.{investasi.hargaLembar} </Text>
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+investasi.hargaLembar)}{" "}
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
@@ -239,7 +259,13 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text> {investasi.totalLembar} lembar</Text>
|
<Text>
|
||||||
|
{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+investasi.totalLembar)}{" "}
|
||||||
|
lembar
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Pembagian Deviden</Text>
|
||||||
@@ -249,11 +275,14 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
{/* Note dan dokumen */}
|
<Grid>
|
||||||
<Grid.Col span={4}>
|
<Grid.Col span={6}>
|
||||||
<Stack>
|
{/* Note */}
|
||||||
{/* Note */}
|
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
||||||
|
""
|
||||||
|
) : (
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text fw={"bold"}>Note :</Text>
|
<Text fw={"bold"}>Note :</Text>
|
||||||
<Text fw={"lighter"} fs={"italic"}>
|
<Text fw={"lighter"} fs={"italic"}>
|
||||||
@@ -263,6 +292,18 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
kekurangnya.
|
kekurangnya.
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
)}
|
||||||
|
{publish &&
|
||||||
|
investasi.MasterStatusInvestasi.id === "3" &&
|
||||||
|
_.isEmpty(investasi.BeritaInvestasi) ? (
|
||||||
|
<BeritaInvestasi dataInvestasi={investasi} />
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</Grid.Col>
|
||||||
|
{/* Note dan dokumen */}
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
{/* File file */}
|
{/* File file */}
|
||||||
<Stack>
|
<Stack>
|
||||||
{/* Prospektus */}
|
{/* Prospektus */}
|
||||||
@@ -336,7 +377,13 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
autosize
|
autosize
|
||||||
minRows={2}
|
minRows={2}
|
||||||
maxRows={4}
|
maxRows={4}
|
||||||
onChange={(val) => setCatatan(val.target.value)}
|
value={investasi.catatan === null ? [] : investasi.catatan}
|
||||||
|
onChange={(val) =>
|
||||||
|
setInvestasi({
|
||||||
|
...investasi,
|
||||||
|
catatan: val.target.value,
|
||||||
|
})
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Group position="right">
|
<Group position="right">
|
||||||
<Button radius={50} compact onClick={() => onReject()}>
|
<Button radius={50} compact onClick={() => onReject()}>
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Center,
|
||||||
|
Title,
|
||||||
|
Table,
|
||||||
|
Group,
|
||||||
|
Avatar,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import _ from "lodash";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
|
export default function TablePublikasiProgresInvestasi({
|
||||||
|
publishProgres,
|
||||||
|
}: {
|
||||||
|
publishProgres: any[];
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper
|
||||||
|
radius={"md"}
|
||||||
|
bg={"gray.4"}
|
||||||
|
p={"sm"}
|
||||||
|
h={400}
|
||||||
|
// sx={{ borderStyle: "solid", borderColor: "teal" }}
|
||||||
|
>
|
||||||
|
<Stack spacing={"xl"}>
|
||||||
|
<Center>
|
||||||
|
<Title order={4}>Publikasi & Progres Investasi</Title>
|
||||||
|
</Center>
|
||||||
|
<Table bg={"gray.2"} sx={{borderRadius: "10px"}}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Publis</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Progres</Center>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{_.isEmpty(publishProgres)
|
||||||
|
? []
|
||||||
|
: publishProgres.map((e) => (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>
|
||||||
|
<Group position="left">
|
||||||
|
<Avatar variant="gradient" radius={"xl"} />{" "}
|
||||||
|
{e.author.username}
|
||||||
|
</Group>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
|
{moment(e.updatedAt).format("DD MMM YYYY")}{" "}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>{e.progress} %</Center>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</Table>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
"use client";
|
||||||
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
import {
|
import {
|
||||||
@@ -7,13 +8,18 @@ import {
|
|||||||
ScrollArea,
|
ScrollArea,
|
||||||
Table,
|
Table,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Stack,
|
||||||
|
Avatar,
|
||||||
|
Group,
|
||||||
|
Text,
|
||||||
|
Center,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconEyeCheck } from "@tabler/icons-react";
|
import { IconChevronLeft, IconEyeCheck } from "@tabler/icons-react";
|
||||||
import { IconEdit, IconEye } from "@tabler/icons-react";
|
import { IconEdit, IconEye } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function TablePublish({
|
export default function Admin_TablePublishInvestasi({
|
||||||
dataInvestsi,
|
dataInvestsi,
|
||||||
}: {
|
}: {
|
||||||
dataInvestsi: MODEL_Investasi[];
|
dataInvestsi: MODEL_Investasi[];
|
||||||
@@ -21,30 +27,41 @@ export default function TablePublish({
|
|||||||
const [investasi, setInvestasi] = useState(dataInvestsi);
|
const [investasi, setInvestasi] = useState(dataInvestsi);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
// console.log(investasi);
|
||||||
|
|
||||||
const tableBody = investasi.map((e) =>
|
const tableBody = investasi.map((e) =>
|
||||||
e.MasterStatusInvestasi.id === "3" ? (
|
e.MasterStatusInvestasi.id === "3" ? (
|
||||||
<tr key={e.id}>
|
<tr key={e.id}>
|
||||||
|
<td>
|
||||||
|
<Group position="left">
|
||||||
|
<Avatar variant="outline" radius={"xl"} />
|
||||||
|
<Text>{e.author.username}</Text>
|
||||||
|
</Group>
|
||||||
|
</td>
|
||||||
<td>{e.title}</td>
|
<td>{e.title}</td>
|
||||||
<td>
|
<td>
|
||||||
{e.MasterStatusInvestasi.id === "3" ? (
|
<Center> {e.progress} %</Center>
|
||||||
<Badge variant="dot" color="green">
|
|
||||||
{e.MasterStatusInvestasi.name}
|
|
||||||
</Badge>
|
|
||||||
) : (
|
|
||||||
"-"
|
|
||||||
)}
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Tooltip label="Detail" withArrow position="bottom">
|
<Center> {new Intl.NumberFormat("id-ID", {maximumFractionDigits: 10}).format(+e.sisaLembar)}</Center>
|
||||||
<ActionIcon
|
</td>
|
||||||
variant="transparent"
|
<td>
|
||||||
onClick={() =>
|
<Center> {new Intl.NumberFormat("id-ID", {maximumFractionDigits: 10}).format(+e.totalLembar)}</Center>
|
||||||
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
|
||||||
}
|
</td>
|
||||||
>
|
<td>
|
||||||
<IconEyeCheck />
|
<Center>
|
||||||
</ActionIcon>
|
<Tooltip label="Detail" withArrow position="bottom">
|
||||||
</Tooltip>
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<IconEyeCheck color="green" />
|
||||||
|
</ActionIcon>
|
||||||
|
</Tooltip>
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : (
|
) : (
|
||||||
@@ -54,26 +71,48 @@ export default function TablePublish({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box my={"lg"}>
|
<Stack>
|
||||||
<ScrollArea w={"100%"}>
|
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi.main_investasi)}>
|
||||||
{/* <Title order={5} mb={5}>
|
|
||||||
|
<IconChevronLeft />
|
||||||
|
</ActionIcon>
|
||||||
|
<Box>
|
||||||
|
<ScrollArea w={"100%"}>
|
||||||
|
{/* <Title order={5} mb={5}>
|
||||||
List Publish
|
List Publish
|
||||||
</Title> */}
|
</Title> */}
|
||||||
<Badge color="green" variant="light" radius={0} size={"xl"}>
|
<Badge color="green" variant="light" radius={0} size={"xl"}>
|
||||||
Publish
|
Publish
|
||||||
</Badge>
|
</Badge>
|
||||||
<Table withBorder highlightOnHover>
|
<Table
|
||||||
<thead>
|
withBorder
|
||||||
<tr>
|
highlightOnHover
|
||||||
<th>Nama Proyek Investasi</th>
|
verticalSpacing={"md"}
|
||||||
<th>Status</th>
|
horizontalSpacing={"md"}
|
||||||
<th>Aksi</th>
|
>
|
||||||
</tr>
|
<thead>
|
||||||
</thead>
|
<tr>
|
||||||
<tbody>{tableBody}</tbody>
|
<th>Username</th>
|
||||||
</Table>
|
<th>Nama Proyek Investasi</th>
|
||||||
</ScrollArea>
|
<th>
|
||||||
</Box>
|
<Center>Progres</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Sisa Saham</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Total Saham</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
"use client";
|
||||||
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
import {
|
import {
|
||||||
@@ -7,12 +8,18 @@ import {
|
|||||||
ScrollArea,
|
ScrollArea,
|
||||||
Table,
|
Table,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Stack,
|
||||||
|
Center,
|
||||||
|
Avatar,
|
||||||
|
Group,
|
||||||
|
Text,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconEdit } from "@tabler/icons-react";
|
import { IconChevronLeft, IconEdit } from "@tabler/icons-react";
|
||||||
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function TableReject({
|
export default function Admin_TableRejectInvestasi({
|
||||||
dataInvestsi,
|
dataInvestsi,
|
||||||
}: {
|
}: {
|
||||||
dataInvestsi: MODEL_Investasi[];
|
dataInvestsi: MODEL_Investasi[];
|
||||||
@@ -23,28 +30,27 @@ export default function TableReject({
|
|||||||
const tableBody = investasi.map((e) =>
|
const tableBody = investasi.map((e) =>
|
||||||
e.MasterStatusInvestasi.id === "4" ? (
|
e.MasterStatusInvestasi.id === "4" ? (
|
||||||
<tr key={e.id}>
|
<tr key={e.id}>
|
||||||
<td>{e.title}</td>
|
|
||||||
<td>
|
<td>
|
||||||
{e.MasterStatusInvestasi.id === "4" ? (
|
<Group position="left">
|
||||||
<Badge variant="dot" color="red">
|
<Avatar variant="outline" radius={"xl"} />
|
||||||
{e.MasterStatusInvestasi.name}
|
<Text>{e.author.username}</Text>
|
||||||
</Badge>
|
</Group>
|
||||||
) : (
|
|
||||||
"-"
|
|
||||||
)}
|
|
||||||
</td>
|
</td>
|
||||||
|
<td>{_.capitalize(e.title)}</td>
|
||||||
<td>{e.catatan}</td>
|
<td>{e.catatan}</td>
|
||||||
<td>
|
<td>
|
||||||
<Tooltip label="Konfirmasi" withArrow position="bottom">
|
<Center>
|
||||||
<ActionIcon
|
<Tooltip label="Konfirmasi" withArrow position="bottom">
|
||||||
variant="transparent"
|
<ActionIcon
|
||||||
onClick={() =>
|
variant="transparent"
|
||||||
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
onClick={() =>
|
||||||
}
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
>
|
}
|
||||||
<IconEdit />
|
>
|
||||||
</ActionIcon>
|
<IconEdit color="green" />
|
||||||
</Tooltip>
|
</ActionIcon>
|
||||||
|
</Tooltip>
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : (
|
) : (
|
||||||
@@ -54,24 +60,37 @@ export default function TableReject({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box my={"lg"}>
|
<Stack>
|
||||||
<ScrollArea w={"100%"}>
|
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi.main_investasi)}>
|
||||||
<Badge color="red" variant="light" radius={0} size={"xl"}>
|
|
||||||
Reject
|
<IconChevronLeft />
|
||||||
</Badge>
|
</ActionIcon>
|
||||||
<Table withBorder highlightOnHover>
|
<Box>
|
||||||
<thead>
|
<ScrollArea w={"100%"}>
|
||||||
<tr>
|
<Badge color="red" variant="light" radius={0} size={"xl"}>
|
||||||
<th>Nama Proyek Investasi</th>
|
Reject
|
||||||
<th>Status</th>
|
</Badge>
|
||||||
<th>Catatan</th>
|
<Table
|
||||||
<th>Aksi</th>
|
withBorder
|
||||||
</tr>
|
highlightOnHover
|
||||||
</thead>
|
verticalSpacing={"md"}
|
||||||
<tbody>{tableBody}</tbody>
|
horizontalSpacing={"md"}
|
||||||
</Table>
|
>
|
||||||
</ScrollArea>
|
<thead>
|
||||||
</Box>
|
<tr>
|
||||||
|
<th>Username</th>
|
||||||
|
<th>Nama Proyek Investasi</th>
|
||||||
|
<th>Catatan</th>
|
||||||
|
<th>
|
||||||
|
<Center>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
"use client";
|
||||||
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
import {
|
import {
|
||||||
@@ -7,12 +8,17 @@ import {
|
|||||||
ScrollArea,
|
ScrollArea,
|
||||||
Table,
|
Table,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Stack,
|
||||||
|
Group,
|
||||||
|
Avatar,
|
||||||
|
Text,
|
||||||
|
Center,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconEdit } from "@tabler/icons-react";
|
import { IconChevronLeft, IconEdit } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function TableReview({
|
export default function Admin_TableReviewInvestasi({
|
||||||
dataInvestsi,
|
dataInvestsi,
|
||||||
}: {
|
}: {
|
||||||
dataInvestsi: MODEL_Investasi[];
|
dataInvestsi: MODEL_Investasi[];
|
||||||
@@ -23,17 +29,28 @@ export default function TableReview({
|
|||||||
const tableBody = investasi.map((e) =>
|
const tableBody = investasi.map((e) =>
|
||||||
e.MasterStatusInvestasi.id === "2" ? (
|
e.MasterStatusInvestasi.id === "2" ? (
|
||||||
<tr key={e.id}>
|
<tr key={e.id}>
|
||||||
<td>{e.title}</td>
|
|
||||||
<td>
|
<td>
|
||||||
{e.MasterStatusInvestasi.id === "2" ? (
|
<Group position="left">
|
||||||
<Badge variant="dot" color="orange">
|
<Avatar variant="outline" radius={"xl"} />
|
||||||
{e.MasterStatusInvestasi.name}
|
<Text>{e.author.username}</Text>
|
||||||
</Badge>
|
</Group>
|
||||||
) : (
|
|
||||||
"-"
|
|
||||||
)}
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
{e.title}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
|
{e.ProspektusInvestasi === null ? (
|
||||||
|
<Badge color="red">Unavailable</Badge>
|
||||||
|
) : (
|
||||||
|
<Badge variant="dot" color="green">
|
||||||
|
Available
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
<Tooltip label="Konfirmasi" withArrow position="bottom">
|
<Tooltip label="Konfirmasi" withArrow position="bottom">
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
@@ -41,9 +58,10 @@ export default function TableReview({
|
|||||||
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<IconEdit />
|
<IconEdit color="green" />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : (
|
) : (
|
||||||
@@ -52,23 +70,29 @@ export default function TableReview({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box my={"lg"}>
|
<Stack>
|
||||||
<ScrollArea w={"100%"}>
|
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi.main_investasi)}>
|
||||||
<Badge color="orange" variant="light" radius={0} size={"xl"}>
|
<IconChevronLeft />
|
||||||
Review
|
</ActionIcon>
|
||||||
</Badge>
|
<Box>
|
||||||
<Table withBorder highlightOnHover>
|
<ScrollArea w={"100%"}>
|
||||||
<thead>
|
<Badge color="orange" variant="light" radius={0} size={"xl"}>
|
||||||
<tr>
|
Review
|
||||||
<th>Nama Proyek Investasi</th>
|
</Badge>
|
||||||
<th>Status</th>
|
<Table withBorder highlightOnHover verticalSpacing={"md"} horizontalSpacing={"md"}>
|
||||||
<th>Aksi</th>
|
<thead>
|
||||||
</tr>
|
<tr>
|
||||||
</thead>
|
<th>Username</th>
|
||||||
<tbody>{tableBody}</tbody>
|
<th>Nama Proyek Investasi</th>
|
||||||
</Table>
|
<th><Center>File Prospektus</Center></th>
|
||||||
</ScrollArea>
|
<th><Center>Aksi</Center></th>
|
||||||
</Box>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Center,
|
||||||
|
Title,
|
||||||
|
Table,
|
||||||
|
Group,
|
||||||
|
Avatar,
|
||||||
|
} from "@mantine/core";
|
||||||
|
|
||||||
|
export default function TableTotalInvestasi({
|
||||||
|
totalInvestasiByUser,
|
||||||
|
}: {
|
||||||
|
totalInvestasiByUser: any[];
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper
|
||||||
|
radius={"md"}
|
||||||
|
bg={"gray.4"}
|
||||||
|
p={"sm"}
|
||||||
|
h={400}
|
||||||
|
// sx={{ borderStyle: "solid", borderColor: "teal" }}
|
||||||
|
>
|
||||||
|
<Stack spacing={"xl"}>
|
||||||
|
<Center>
|
||||||
|
<Title order={4}>Total Investasi Pengguna</Title>
|
||||||
|
</Center>
|
||||||
|
<Table bg={"gray.2"} sx={{ borderRadius: "10px" }}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Total</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{totalInvestasiByUser.map((e) => (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>
|
||||||
|
<Group>
|
||||||
|
<Avatar variant="gradient" radius={"xl"} /> {e.username}
|
||||||
|
</Group>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>{e._count.Investasi}</Center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</Table>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -18,12 +18,25 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconEdit } from "@tabler/icons-react";
|
import {
|
||||||
|
IconArrowBadgeRight,
|
||||||
|
IconArrowBigRightLine,
|
||||||
|
IconArrowsMaximize,
|
||||||
|
IconCaretRight,
|
||||||
|
IconChevronsDownRight,
|
||||||
|
IconChevronsRight,
|
||||||
|
IconEdit,
|
||||||
|
IconZoomCheck,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import TablePublish from "./table_publish";
|
import Admin_TablePublishInvestasi from "./table_publish";
|
||||||
import TableReview from "./table_review";
|
import Admin_TableReviewInvestasi from "./table_review";
|
||||||
import TableReject from "./table_reject";
|
import Admin_TableRejectInvestasi from "./table_reject";
|
||||||
|
import moment from "moment";
|
||||||
|
import _ from "lodash";
|
||||||
|
import TableTotalInvestasi from "./table_total_investasi";
|
||||||
|
import TablePublikasiProgresInvestasi from "./table_publikasi_progres";
|
||||||
|
|
||||||
export default function Admin_Investasi({
|
export default function Admin_Investasi({
|
||||||
listInvestasi,
|
listInvestasi,
|
||||||
@@ -32,6 +45,7 @@ export default function Admin_Investasi({
|
|||||||
countPublish,
|
countPublish,
|
||||||
countReject,
|
countReject,
|
||||||
totalInvestasiByUser,
|
totalInvestasiByUser,
|
||||||
|
publishProgres,
|
||||||
}: {
|
}: {
|
||||||
listInvestasi: MODEL_Investasi[];
|
listInvestasi: MODEL_Investasi[];
|
||||||
countDraft: number | any;
|
countDraft: number | any;
|
||||||
@@ -39,6 +53,7 @@ export default function Admin_Investasi({
|
|||||||
countPublish: number | any;
|
countPublish: number | any;
|
||||||
countReject: number | any;
|
countReject: number | any;
|
||||||
totalInvestasiByUser: any[];
|
totalInvestasiByUser: any[];
|
||||||
|
publishProgres: any[];
|
||||||
}) {
|
}) {
|
||||||
const [investasi, setInvestasi] = useState(listInvestasi);
|
const [investasi, setInvestasi] = useState(listInvestasi);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -48,84 +63,81 @@ export default function Admin_Investasi({
|
|||||||
id: 1,
|
id: 1,
|
||||||
name: "Draft",
|
name: "Draft",
|
||||||
jumlah: countDraft,
|
jumlah: countDraft,
|
||||||
color: "yellow"
|
link: "",
|
||||||
|
color: "yellow",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: "Review",
|
name: "Review",
|
||||||
jumlah: countReview,
|
jumlah: countReview,
|
||||||
color: "orange"
|
link: RouterAdminInvestasi.table_status_review,
|
||||||
|
color: "orange",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: "Publish",
|
name: "Publish",
|
||||||
jumlah: countPublish,
|
jumlah: countPublish,
|
||||||
color: "green"
|
link: RouterAdminInvestasi.table_status_publish,
|
||||||
|
color: "green",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: "Reject",
|
name: "Reject",
|
||||||
jumlah: countReject,
|
jumlah: countReject,
|
||||||
color: "red"
|
link: RouterAdminInvestasi.table_status_reject,
|
||||||
|
color: "red",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Title>Investasi</Title>
|
<Stack spacing={"sm"}>
|
||||||
<Divider mb={"md"} />
|
<Title>Investasi</Title>
|
||||||
<Grid mb={"md"}>
|
<Divider mb={"md"} />
|
||||||
{listBox.map((e) => (
|
{/* Status box */}
|
||||||
<Grid.Col sm={12} md={6} lg={3} key={e.id}>
|
<Grid mb={"md"}>
|
||||||
<Paper
|
{listBox.map((e) => (
|
||||||
h={100}
|
<Grid.Col sm={12} md={6} lg={3} key={e.id}>
|
||||||
p={"xs"}
|
<Paper
|
||||||
bg={"gray"}
|
bg={`${e.color}.1`}
|
||||||
// bg={e.color}
|
p={"xs"}
|
||||||
>
|
// sx={{borderStyle: "solid", borderColor: e.color}}
|
||||||
<Center>
|
>
|
||||||
<Stack spacing={0}>
|
<Stack align="center" justify="center" spacing={0} mb={-35}>
|
||||||
<Text>{e.name}</Text>
|
<Text tt={"uppercase"}>{e.name}</Text>
|
||||||
<Center>
|
<Text fw={"bold"} fz={50}>
|
||||||
<Text fw={"bold"} fz={40}>
|
{e.jumlah}
|
||||||
{e.jumlah}
|
</Text>
|
||||||
</Text>
|
|
||||||
</Center>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Center>
|
<Group position="right">
|
||||||
</Paper>
|
{e.link === "" ? (
|
||||||
</Grid.Col>
|
<ActionIcon variant="transparent">
|
||||||
))}
|
{/* <IconChevronsRight color="black" /> */}
|
||||||
</Grid>
|
</ActionIcon>
|
||||||
|
) : (
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() => router.push(e.link)}
|
||||||
|
>
|
||||||
|
<IconChevronsRight color="black" />
|
||||||
|
</ActionIcon>
|
||||||
|
)}
|
||||||
|
</Group>
|
||||||
|
</Paper>
|
||||||
|
</Grid.Col>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Paper w={300} radius={"md"} p={"sm"} sx={{borderStyle: "solid", borderColor: "teal"}} >
|
{/* Table Total & Progres */}
|
||||||
<Stack spacing={"xl"}>
|
{/* <Grid>
|
||||||
<Title order={4}>Total Investasi Per User</Title>
|
<Grid.Col sm={12} md={4} lg={4}>
|
||||||
<Table >
|
<TableTotalInvestasi totalInvestasiByUser={totalInvestasiByUser} />
|
||||||
<thead>
|
</Grid.Col>
|
||||||
<tr>
|
<Grid.Col sm={12} md={8} lg={8}>
|
||||||
<th><Center>Username</Center></th>
|
<TablePublikasiProgresInvestasi publishProgres={publishProgres} />
|
||||||
<th><Center>Total</Center></th>
|
</Grid.Col>
|
||||||
</tr>
|
</Grid> */}
|
||||||
</thead>
|
</Stack>
|
||||||
<tbody>
|
|
||||||
{totalInvestasiByUser.map((e) => (
|
|
||||||
<tr key={e.id}>
|
|
||||||
<td><Group><Avatar variant="light" radius={"xl"}/> {e.username}</Group></td>
|
|
||||||
<td><Center>{e._count.Investasi}</Center></td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</Table>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
{/* <TablePublish dataInvestsi={investasi as any} />
|
|
||||||
<TableReview dataInvestsi={investasi as any} />
|
|
||||||
<TableReject dataInvestsi={investasi as any} /> */}
|
|
||||||
{/* <pre>{JSON.stringify(totalInvestasiByUser, null, 2)}</pre> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Title } from "@mantine/core";
|
import { Center, Divider, Stack, Title } from "@mantine/core";
|
||||||
import Admin_Investasi from "../investasi/main/view";
|
import Admin_Investasi from "../investasi/main/view";
|
||||||
|
|
||||||
|
|
||||||
export default function AdminMain() {
|
export default function AdminMain() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Title>Main Dashboard</Title>
|
<Stack spacing={"sm"}>
|
||||||
|
<Title>Main Dashboard</Title>
|
||||||
|
<Divider mb={"md"} />
|
||||||
|
<Stack align="center" justify="center" h={"80vh"}>
|
||||||
|
<Title>Cooming Soon !!</Title>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function MainCrowd() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Paper>
|
</Paper>
|
||||||
<Paper
|
<Paper
|
||||||
bg={Warna.biru}
|
bg={"blue.4"}
|
||||||
radius={"md"}
|
radius={"md"}
|
||||||
p={"xs"}
|
p={"xs"}
|
||||||
onClick={() => toast("Cooming Soon Feature...")}
|
onClick={() => toast("Cooming Soon Feature...")}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export default function HomeView({ user }: { user: MODEL_User_profile }) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Paper bg={"dark"} radius={5} my={"xs"}>
|
<Paper bg={"dark"} radius={5} my={"xs"}>
|
||||||
<Image alt="logo" src={"/aset/logo.png"} />
|
<Image alt="logo" src={"/aset/investasi/home-hipmi.png"} />
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{/* <pre>{JSON.stringify(stateUser, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(stateUser, null, 2)}</pre> */}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export default function InvestasiCreate({
|
|||||||
</Paper>
|
</Paper>
|
||||||
) : (
|
) : (
|
||||||
<Paper w={"100%"} bg={"gray.6"} p={"sm"}>
|
<Paper w={"100%"} bg={"gray.6"} p={"sm"}>
|
||||||
<Text>{pdf.name}</Text>
|
<Text truncate>{pdf.name}</Text>
|
||||||
</Paper>
|
</Paper>
|
||||||
)}
|
)}
|
||||||
{/* {JSON.stringify(filePdf)} */}
|
{/* {JSON.stringify(filePdf)} */}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default function DetailInvestasi({
|
|||||||
];
|
];
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
router.push(RouterInvestasi.proses_investasi + `${investasi.id}`);
|
router.push(RouterInvestasi.proses_transaksi + `${investasi.id}`);
|
||||||
setTransaksiValue({
|
setTransaksiValue({
|
||||||
...transaksiValue,
|
...transaksiValue,
|
||||||
lembarTerbeli: "",
|
lembarTerbeli: "",
|
||||||
@@ -224,7 +224,7 @@ export default function DetailInvestasi({
|
|||||||
onSubmit()
|
onSubmit()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Investasi
|
Beli Saham
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
)}
|
)}
|
||||||
|
|||||||