Alur Payment
# feat - Pembelian saham - Function progres ### No Issue
2
.env
@@ -6,3 +6,5 @@
|
|||||||
|
|
||||||
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,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}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
@@ -55,6 +55,7 @@ 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 { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import "react-simple-toasts/dist/theme/dark.css";
|
import "react-simple-toasts/dist/theme/dark.css";
|
||||||
|
import { BeritaInvestasi } from "@/app_modules/investasi";
|
||||||
|
|
||||||
toastConfig({ theme: "dark" });
|
toastConfig({ theme: "dark" });
|
||||||
|
|
||||||
@@ -112,7 +113,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
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()
|
router.back();
|
||||||
toggle();
|
toggle();
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
@@ -292,6 +293,13 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
|
{publish &&
|
||||||
|
investasi.MasterStatusInvestasi.id === "3" &&
|
||||||
|
_.isEmpty(investasi.BeritaInvestasi) ? (
|
||||||
|
<BeritaInvestasi dataInvestasi={investasi} />
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
{/* Note dan dokumen */}
|
{/* Note dan dokumen */}
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
@@ -373,7 +381,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
onChange={(val) =>
|
onChange={(val) =>
|
||||||
setInvestasi({
|
setInvestasi({
|
||||||
...investasi,
|
...investasi,
|
||||||
catatan: val.target.value
|
catatan: val.target.value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default function TablePublikasiProgresInvestasi({
|
|||||||
radius={"md"}
|
radius={"md"}
|
||||||
bg={"gray.4"}
|
bg={"gray.4"}
|
||||||
p={"sm"}
|
p={"sm"}
|
||||||
|
h={400}
|
||||||
// sx={{ borderStyle: "solid", borderColor: "teal" }}
|
// sx={{ borderStyle: "solid", borderColor: "teal" }}
|
||||||
>
|
>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
|
|||||||
@@ -72,10 +72,8 @@ export default function Admin_TablePublishInvestasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ActionIcon
|
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi.main_investasi)}>
|
||||||
variant="outline"
|
|
||||||
onClick={() => router.push(RouterAdminInvestasi.main_investasi)}
|
|
||||||
>
|
|
||||||
<IconChevronLeft />
|
<IconChevronLeft />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ export default function Admin_TableRejectInvestasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ActionIcon variant="outline" onClick={() => router.back()}>
|
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi.main_investasi)}>
|
||||||
|
|
||||||
<IconChevronLeft />
|
<IconChevronLeft />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default function Admin_TableReviewInvestasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ActionIcon variant="outline" onClick={() => router.back()}>
|
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi.main_investasi)}>
|
||||||
<IconChevronLeft />
|
<IconChevronLeft />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ export default function TableTotalInvestasi({
|
|||||||
<Paper
|
<Paper
|
||||||
radius={"md"}
|
radius={"md"}
|
||||||
bg={"gray.4"}
|
bg={"gray.4"}
|
||||||
|
|
||||||
p={"sm"}
|
p={"sm"}
|
||||||
|
h={400}
|
||||||
// sx={{ borderStyle: "solid", borderColor: "teal" }}
|
// sx={{ borderStyle: "solid", borderColor: "teal" }}
|
||||||
>
|
>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
<Center>
|
<Center>
|
||||||
<Title order={4}>Total Investasi Pengguna</Title>
|
<Title order={4}>Total Investasi Pengguna</Title>
|
||||||
</Center>
|
</Center>
|
||||||
<Table bg={"gray.2"} sx={{borderRadius: "10px"}}>
|
<Table bg={"gray.2"} sx={{ borderRadius: "10px" }}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
|
|||||||
@@ -98,8 +98,10 @@ export default function Admin_Investasi({
|
|||||||
<Grid mb={"md"}>
|
<Grid mb={"md"}>
|
||||||
{listBox.map((e) => (
|
{listBox.map((e) => (
|
||||||
<Grid.Col sm={12} md={6} lg={3} key={e.id}>
|
<Grid.Col sm={12} md={6} lg={3} key={e.id}>
|
||||||
<Paper bg={`${e.color}.1`} p={"xs"}
|
<Paper
|
||||||
// sx={{borderStyle: "solid", borderColor: e.color}}
|
bg={`${e.color}.1`}
|
||||||
|
p={"xs"}
|
||||||
|
// sx={{borderStyle: "solid", borderColor: e.color}}
|
||||||
>
|
>
|
||||||
<Stack align="center" justify="center" spacing={0} mb={-35}>
|
<Stack align="center" justify="center" spacing={0} mb={-35}>
|
||||||
<Text tt={"uppercase"}>{e.name}</Text>
|
<Text tt={"uppercase"}>{e.name}</Text>
|
||||||
@@ -110,10 +112,13 @@ export default function Admin_Investasi({
|
|||||||
<Group position="right">
|
<Group position="right">
|
||||||
{e.link === "" ? (
|
{e.link === "" ? (
|
||||||
<ActionIcon variant="transparent">
|
<ActionIcon variant="transparent">
|
||||||
{/* <IconChevronsRight color="black" /> */}
|
{/* <IconChevronsRight color="black" /> */}
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
) : (
|
) : (
|
||||||
<ActionIcon variant="transparent" onClick={() => router.push(e.link)}>
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() => router.push(e.link)}
|
||||||
|
>
|
||||||
<IconChevronsRight color="black" />
|
<IconChevronsRight color="black" />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
)}
|
)}
|
||||||
@@ -124,20 +129,15 @@ export default function Admin_Investasi({
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* Table Total & Progres */}
|
{/* Table Total & Progres */}
|
||||||
<Grid>
|
{/* <Grid>
|
||||||
<Grid.Col sm={12} md={4} lg={4}>
|
<Grid.Col sm={12} md={4} lg={4}>
|
||||||
<TableTotalInvestasi totalInvestasiByUser={totalInvestasiByUser} />
|
<TableTotalInvestasi totalInvestasiByUser={totalInvestasiByUser} />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col sm={12} md={8} lg={8}>
|
<Grid.Col sm={12} md={8} lg={8}>
|
||||||
<TablePublikasiProgresInvestasi publishProgres={publishProgres} />
|
<TablePublikasiProgresInvestasi publishProgres={publishProgres} />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid> */}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{/* <TablePublish dataInvestsi={investasi as any} />
|
|
||||||
<TableReview dataInvestsi={investasi as any} />
|
|
||||||
<TableReject dataInvestsi={investasi as any} /> */}
|
|
||||||
{/* <pre>{JSON.stringify(targetTerbesar, 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>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Model_Prospektus_Investasi,
|
Model_Prospektus_Investasi,
|
||||||
} from "../model/model_investasi";
|
} from "../model/model_investasi";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
|
||||||
export default function DetailPropektus({
|
export default function DetailPropektus({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
@@ -16,23 +17,16 @@ export default function DetailPropektus({
|
|||||||
}) {
|
}) {
|
||||||
const [prospek, setProspek] = useState(dataInvestasi);
|
const [prospek, setProspek] = useState(dataInvestasi);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{prospek.ProspektusInvestasi !== null ? (
|
{prospek.ProspektusInvestasi !== null ? (
|
||||||
<Link
|
<Link
|
||||||
href={`/file/${prospek.ProspektusInvestasi.url}`}
|
href={RouterInvestasi.api_file_prospektus + `${prospek.ProspektusInvestasi.id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
style={{ textDecorationLine: "none" }}
|
style={{ textDecorationLine: "none" }}
|
||||||
>
|
>
|
||||||
<Paper w={"100%"} bg={"gray"} mb={"md"}>
|
<Paper w={"100%"} bg={"gray"} mb={"md"}>
|
||||||
<Grid
|
<Grid align="center" justify="center" px={"sm"}>
|
||||||
align="center"
|
|
||||||
justify="center"
|
|
||||||
|
|
||||||
px={"sm"}
|
|
||||||
onClick={() => ""}
|
|
||||||
>
|
|
||||||
<Grid.Col span={10}>
|
<Grid.Col span={10}>
|
||||||
<Text>Prospektus_{prospek.title}</Text>
|
<Text>Prospektus_{prospek.title}</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
Group,
|
Group,
|
||||||
Image,
|
Image,
|
||||||
Paper,
|
Paper,
|
||||||
|
Progress,
|
||||||
Slider,
|
Slider,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
@@ -22,13 +23,24 @@ import {
|
|||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import {
|
||||||
IconBookDownload,
|
IconBookDownload,
|
||||||
|
IconCircleCheck,
|
||||||
IconFileDescription,
|
IconFileDescription,
|
||||||
IconSpeakerphone,
|
IconSpeakerphone,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
import { MODEL_Transaksi_Investasi } from "../model/model_investasi";
|
||||||
|
import { useState } from "react";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
export default function DetailSahamTerbeli({id}: {id: string}) {
|
export default function DetailSahamTerbeli({
|
||||||
|
dataTransaksi,
|
||||||
|
investor
|
||||||
|
}: {
|
||||||
|
dataTransaksi: MODEL_Transaksi_Investasi;
|
||||||
|
investor: number
|
||||||
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [investasi, setINvestasi] = useState(dataTransaksi);
|
||||||
const listBox = [
|
const listBox = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -54,50 +66,104 @@ export default function DetailSahamTerbeli({id}: {id: string}) {
|
|||||||
<Group position="apart" mb={"md"}>
|
<Group position="apart" mb={"md"}>
|
||||||
<Flex align={"center"} gap={"xs"}>
|
<Flex align={"center"} gap={"xs"}>
|
||||||
<Avatar src={"/aset/avatar.png"} />
|
<Avatar src={"/aset/avatar.png"} />
|
||||||
<Text>Username</Text>
|
<Text>{investasi.Investasi.author.username}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Text>Sisa waktu : 20 Hari</Text>
|
{(() => {
|
||||||
|
if (
|
||||||
|
Number(investasi.Investasi.MasterPencarianInvestor.name) -
|
||||||
|
moment(new Date()).diff(new Date(investasi.createdAt), "days") <=
|
||||||
|
0
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Group position="right">
|
||||||
|
<IconCircleCheck color="green" />
|
||||||
|
<Text c={"green"}>Selesai</Text>
|
||||||
|
</Group>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Group position="right" spacing={"xs"}>
|
||||||
|
<Text>Sisa waktu:</Text>
|
||||||
|
<Text>
|
||||||
|
{Number(investasi.Investasi.MasterPencarianInvestor.name) -
|
||||||
|
moment(new Date()).diff(
|
||||||
|
new Date(investasi.Investasi.countDown),
|
||||||
|
"days"
|
||||||
|
)}{" "}
|
||||||
|
Hari
|
||||||
|
</Text>
|
||||||
|
</Group>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})()}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
{/* Gambar Investasi */}
|
{/* Gambar Investasi */}
|
||||||
<Paper withBorder mb={"md"}>
|
<Paper withBorder mb={"md"}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Image alt="" src={"/aset/no-img.png"} />
|
<Image alt="" src={RouterInvestasi.api_gambar + `${investasi.Investasi.imagesId}`} />
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{/* Title dan Persentase */}
|
{/* Title dan Persentase */}
|
||||||
<Box mb={"md"}>
|
<Box mb={"md"}>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={4} mb={"xs"}>
|
||||||
Judul Proyek
|
{investasi.Investasi.title}
|
||||||
</Title>
|
</Title>
|
||||||
<Slider
|
<Progress
|
||||||
disabled
|
label={
|
||||||
size={10}
|
"" +
|
||||||
value={60}
|
(
|
||||||
marks={[{ value: 60, label: "60%" }]}
|
((+investasi.Investasi.totalLembar - +investasi.Investasi.sisaLembar) /
|
||||||
/>
|
+investasi.Investasi.totalLembar) *
|
||||||
|
100
|
||||||
|
).toFixed(1) +
|
||||||
|
"%"
|
||||||
|
}
|
||||||
|
value={
|
||||||
|
+(
|
||||||
|
((+investasi.Investasi.totalLembar - +investasi.Investasi.sisaLembar) /
|
||||||
|
+investasi.Investasi.totalLembar) *
|
||||||
|
100
|
||||||
|
).toFixed(2)
|
||||||
|
}
|
||||||
|
color="teal"
|
||||||
|
size="xl"
|
||||||
|
radius="xl"
|
||||||
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Rincian Data */}
|
{/* Rincian Data */}
|
||||||
<Grid p={"md"}>
|
<Grid p={"md"}>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
{/* <Box>
|
||||||
<Text>Terkumpul</Text>
|
<Text>Terkumpul</Text>
|
||||||
<Text>Rp. </Text>
|
<Text>Rp. </Text>
|
||||||
</Box>
|
</Box> */}
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. </Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.Investasi.targetDana)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. </Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.Investasi.hargaLembar)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
<Text>3 Bulan </Text>
|
<Text>{investasi.Investasi.MasterPembagianDeviden.name} bulan </Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Pembagian Deviden</Text>
|
||||||
|
<Text>{investasi.Investasi.MasterPeriodeDeviden.name}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -105,19 +171,23 @@ export default function DetailSahamTerbeli({id}: {id: string}) {
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Investor</Text>
|
<Text>Investor</Text>
|
||||||
<Text>4657</Text>
|
<Text>{investor} pengguna</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>ROI</Text>
|
<Text>ROI</Text>
|
||||||
<Text>%</Text>
|
<Text>{investasi.Investasi.roi}%</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>0</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.Investasi.totalLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Sisa Lembar</Text>
|
||||||
<Text>Selamanya</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.Investasi.sisaLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -135,7 +205,9 @@ export default function DetailSahamTerbeli({id}: {id: string}) {
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Pembelian</Text>
|
<Text>Total Pembelian</Text>
|
||||||
<Text>Rp. 0</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.gross_amount)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -143,7 +215,9 @@ export default function DetailSahamTerbeli({id}: {id: string}) {
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Lembar Dibeli</Text>
|
<Text>Lembar Dibeli</Text>
|
||||||
<Text>100</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.quantity)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -153,7 +227,11 @@ export default function DetailSahamTerbeli({id}: {id: string}) {
|
|||||||
{/* List Box */}
|
{/* List Box */}
|
||||||
<Grid mb={"sm"} justify="center">
|
<Grid mb={"sm"} justify="center">
|
||||||
{listBox.map((e) => (
|
{listBox.map((e) => (
|
||||||
<Grid.Col span={"auto"} key={e.id} onClick={() => router.push(e.route + `${id}`)}>
|
<Grid.Col
|
||||||
|
span={"auto"}
|
||||||
|
key={e.id}
|
||||||
|
onClick={() => router.push(e.route + `${investasi.Investasi.id}`)}
|
||||||
|
>
|
||||||
<Center>
|
<Center>
|
||||||
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
||||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { MODEL_Investasi } from "../model/model_investasi";
|
|||||||
export async function funCreateInvestasi(
|
export async function funCreateInvestasi(
|
||||||
gamabar: FormData,
|
gamabar: FormData,
|
||||||
filePdf: FormData,
|
filePdf: FormData,
|
||||||
data: MODEL_Investasi | any
|
data: MODEL_Investasi
|
||||||
) {
|
) {
|
||||||
// Function upload gambar
|
// Function upload gambar
|
||||||
const file: any = gamabar.get("file");
|
const file: any = gamabar.get("file");
|
||||||
@@ -32,7 +32,7 @@ export async function funCreateInvestasi(
|
|||||||
if (!uploadImage)
|
if (!uploadImage)
|
||||||
return {
|
return {
|
||||||
status: 400,
|
status: 400,
|
||||||
message: "File Kosong",
|
message: "Gambar Kosong",
|
||||||
};
|
};
|
||||||
|
|
||||||
const upFolder = Buffer.from(await file.arrayBuffer());
|
const upFolder = Buffer.from(await file.arrayBuffer());
|
||||||
@@ -67,23 +67,21 @@ export async function funCreateInvestasi(
|
|||||||
const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
||||||
const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
||||||
|
|
||||||
const uploadFile = await prisma.prospektusInvestasi.upsert({
|
const uploadFile = await prisma.prospektusInvestasi.create({
|
||||||
where: {
|
data: {
|
||||||
investasiId: createInvest.id,
|
|
||||||
},
|
|
||||||
update: {
|
|
||||||
url: pdfRandomName,
|
|
||||||
},
|
|
||||||
create: {
|
|
||||||
investasiId: createInvest.id,
|
investasiId: createInvest.id,
|
||||||
url: pdfRandomName,
|
url: pdfRandomName,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
url: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!uploadFile) return {status: 400, message: "Gagal Upload"}
|
|
||||||
const upPdfFolder = Buffer.from(await file.arrayBuffer())
|
|
||||||
fs.writeFileSync(`./public/file/${uploadFile.url}`, upPdfFolder)
|
|
||||||
|
|
||||||
|
if (!uploadFile) return { status: 400, message: "File Kosong" };
|
||||||
|
const upPdfFolder = Buffer.from(await file.arrayBuffer());
|
||||||
|
fs.writeFileSync(`./public/file/${uploadFile.url}`, upPdfFolder);
|
||||||
|
|
||||||
revalidatePath(RouterInvestasi.main_porto);
|
revalidatePath(RouterInvestasi.main_porto);
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ export default async function funCreateTransaksiInvestasi(
|
|||||||
data: {
|
data: {
|
||||||
namaBank: data.namaBank,
|
namaBank: data.namaBank,
|
||||||
nomorRekening: data.nomorRekening,
|
nomorRekening: data.nomorRekening,
|
||||||
lembarTerbeli: "" + data.lembarTerbeli,
|
|
||||||
totalTransfer: "" + data.totalTransfer,
|
|
||||||
investasiId: invesId,
|
investasiId: invesId,
|
||||||
authorId: authorId,
|
authorId: authorId,
|
||||||
|
gross_amount: "",
|
||||||
|
merchant_name:"",
|
||||||
|
price: "",
|
||||||
|
quantity: ""
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!res) return { status: 400, message: "Gagal disimpan" };
|
if (!res) return { status: 400, message: "Gagal disimpan" };
|
||||||
|
|||||||
@@ -3,24 +3,31 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import moment from "moment";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export default async function funGantiStatusInvestasi(id: string, val: string) {
|
export default async function funGantiStatusInvestasi(id: string, val: string) {
|
||||||
|
const publishCD = new Date
|
||||||
const data = await prisma.investasi.update({
|
const data = await prisma.investasi.update({
|
||||||
where: {
|
where: {
|
||||||
id: id,
|
id: id,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
masterStatusInvestasiId: val,
|
MasterStatusInvestasi: {
|
||||||
|
connect: {
|
||||||
|
id: val,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
countDown: publishCD,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!data) return {status: 400}
|
if (!data) return { status: 400 };
|
||||||
|
|
||||||
revalidatePath(RouterInvestasi.portofolio)
|
revalidatePath(RouterInvestasi.portofolio);
|
||||||
revalidatePath(RouterAdminInvestasi.main_investasi)
|
revalidatePath(RouterAdminInvestasi.main_investasi);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export default async function funGantiStatusTransaksi_Investasi(
|
|||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
namaBank: true,
|
namaBank: true,
|
||||||
totalTransfer: true,
|
|
||||||
Investasi: true,
|
Investasi: true,
|
||||||
MasterStatusTransaksiInvestasi: true
|
MasterStatusTransaksiInvestasi: true
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/app_modules/investasi/fun/fun_total_investor_by_id.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
|
export default async function funTotalInvestorByIdInvestasi(id: string) {
|
||||||
|
// console.log(id)
|
||||||
|
const data = await prisma.transaksiInvestasi.count({
|
||||||
|
where: {
|
||||||
|
investasiId: id,
|
||||||
|
status_code: "200"
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
// belum ke hitungg
|
||||||
23
src/app_modules/investasi/fun/fun_update_investasi.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { MODEL_Investasi } from "../model/model_investasi";
|
||||||
|
|
||||||
|
export default async function funUpdateInvestasi(data: MODEL_Investasi) {
|
||||||
|
// console.log(data)
|
||||||
|
const res = await prisma.investasi.update({
|
||||||
|
where: {
|
||||||
|
id: data.id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
sisaLembar: "" + data.sisaLembar,
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!res) return { status: 400, message: "Gagal update" };
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
|
message: "Update berhasil",
|
||||||
|
};
|
||||||
|
}
|
||||||