Admin
# feat: - Admin ganti status review ke publish
This commit is contained in:
@@ -110,6 +110,7 @@ model Investasi {
|
|||||||
updatedAt DateTime @default(now()) @updatedAt
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
author User? @relation(fields: [authorId], references: [id])
|
author User? @relation(fields: [authorId], references: [id])
|
||||||
authorId String?
|
authorId String?
|
||||||
|
catatan String?
|
||||||
|
|
||||||
MasterPeriodeDeviden MasterPeriodeDeviden? @relation(fields: [masterPeriodeDevidenId], references: [id])
|
MasterPeriodeDeviden MasterPeriodeDeviden? @relation(fields: [masterPeriodeDevidenId], references: [id])
|
||||||
masterPeriodeDevidenId String?
|
masterPeriodeDevidenId String?
|
||||||
|
|||||||
BIN
public/file/57017e7b-bd18-4822-bea6-18e4f17823ac.pdf
Normal file
BIN
public/file/57017e7b-bd18-4822-bea6-18e4f17823ac.pdf
Normal file
Binary file not shown.
BIN
public/file/ad7680d8-8ccd-4ae5-99e9-08f292f26e65.pdf
Normal file
BIN
public/file/ad7680d8-8ccd-4ae5-99e9-08f292f26e65.pdf
Normal file
Binary file not shown.
BIN
public/investasi/21cb9f77-be9e-4f10-b7d5-b7d6935d445a.png
Normal file
BIN
public/investasi/21cb9f77-be9e-4f10-b7d5-b7d6935d445a.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 263 KiB |
BIN
public/investasi/90a63208-8257-4de8-8138-7fce204c2a76.png
Normal file
BIN
public/investasi/90a63208-8257-4de8-8138-7fce204c2a76.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
22
src/app/api/investasi/dokumen/[id]/route.ts
Normal file
22
src/app/api/investasi/dokumen/[id]/route.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
|
export async function GET(
|
||||||
|
req: NextRequest,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
const data = await prisma.dokumenInvestasi.findUnique({
|
||||||
|
where: { id: params.id },
|
||||||
|
select: {
|
||||||
|
url: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const file = fs.readFileSync(`./public/file/${data?.url}`);
|
||||||
|
return new NextResponse(file, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/pdf",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
import { Admin_HalamanAksi } from "@/app_modules/admin/investasi";
|
import { Admin_HalamanAksi } from "@/app_modules/admin/investasi";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page({params}:{params: {id: string}}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Admin_HalamanAksi />
|
<Admin_HalamanAksi idInves={params.id} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/app/dev/admin/investasi/konfirmasi/[id]/page.tsx
Normal file
16
src/app/dev/admin/investasi/konfirmasi/[id]/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
||||||
|
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||||
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
const dataInvestasi = await getOneInvestasiById(params.id)
|
||||||
|
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any)
|
||||||
|
// console.log(dataUser)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} dataUser={dataUser as any} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
|
||||||
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Admin_KonfirmasiInvestasi id={params.id} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@ export const RouterAdminDashboard = {
|
|||||||
export const RouterAdminInvestasi = {
|
export const RouterAdminInvestasi = {
|
||||||
main_investasi: "/dev/admin/main/investasi",
|
main_investasi: "/dev/admin/main/investasi",
|
||||||
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"
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
export const RouterInvestasi = {
|
export const RouterInvestasi = {
|
||||||
api_gambar: "/api/investasi/gambar/",
|
api_gambar: "/api/investasi/gambar/",
|
||||||
api_file_prospektus: "/api/investasi/prospektus/",
|
api_file_prospektus: "/api/investasi/prospektus/",
|
||||||
|
api_file_dokumen: "/api/investasi/dokumen/",
|
||||||
|
|
||||||
//INVESTASI
|
//INVESTASI
|
||||||
main: "/dev/investasi/main",
|
main: "/dev/investasi/main",
|
||||||
main_porto: "/dev/investasi/main/portofolio",
|
main_porto: "/dev/investasi/main/portofolio",
|
||||||
|
|||||||
3
src/app/lib/router_hipmi/router_user_profile.ts
Normal file
3
src/app/lib/router_hipmi/router_user_profile.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const RouterUserProfile = {
|
||||||
|
api_foto: "/api/profile/foto/",
|
||||||
|
};
|
||||||
@@ -11,8 +11,8 @@ export default function Admin_LayoutHalamanAksi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* {children} */}
|
{/* {children} */}
|
||||||
<AppShell header={<HeaderTamplate title="Pilih Aksi" />}>
|
<AppShell padding={"md"} header={<HeaderTamplate title="Pilih Aksi" />}>
|
||||||
{children}
|
{children}
|
||||||
</AppShell>
|
</AppShell>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
import { IconChevronRight } from "@tabler/icons-react";
|
import { IconChevronRight } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export default function Admin_HalamanAksi() {
|
export default function Admin_HalamanAksi({idInves}: {idInves: string}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const listHalamanAksi = [
|
const listHalamanAksi = [
|
||||||
{
|
{
|
||||||
@@ -58,7 +58,7 @@ export default function Admin_HalamanAksi() {
|
|||||||
compact
|
compact
|
||||||
radius={50}
|
radius={50}
|
||||||
w={100}
|
w={100}
|
||||||
onClick={() => router.push(e.route)}
|
onClick={() => router.push(e.route + `${idInves}`)}
|
||||||
>
|
>
|
||||||
Lihat
|
Lihat
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { RouterUserProfile } from "@/app/lib/router_hipmi/router_user_profile";
|
||||||
import { Warna } from "@/app/lib/warna";
|
import { Warna } from "@/app/lib/warna";
|
||||||
|
import funEditInvestasi from "@/app_modules/investasi/fun/fun_edit_investasi";
|
||||||
|
import funGantiStatusInvestasi from "@/app_modules/investasi/fun/fun_ganti_status";
|
||||||
|
import { gs_StatusPortoInvestasi } from "@/app_modules/investasi/g_state";
|
||||||
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
|
import { MODEL_User_profile } from "@/app_modules/models/user_profile";
|
||||||
import {
|
import {
|
||||||
Group,
|
Group,
|
||||||
Flex,
|
Flex,
|
||||||
@@ -20,24 +27,46 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Collapse,
|
Collapse,
|
||||||
Textarea,
|
Textarea,
|
||||||
|
Divider,
|
||||||
|
Mark,
|
||||||
|
Modal,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
|
IconAlertHexagonFilled,
|
||||||
|
IconBan,
|
||||||
IconBookDownload,
|
IconBookDownload,
|
||||||
|
IconCheck,
|
||||||
IconChevronDown,
|
IconChevronDown,
|
||||||
IconChevronLeft,
|
IconChevronLeft,
|
||||||
IconChevronRight,
|
IconChevronRight,
|
||||||
|
IconFile,
|
||||||
IconFileDescription,
|
IconFileDescription,
|
||||||
|
IconFileTypePdf,
|
||||||
|
IconPdf,
|
||||||
IconSpeakerphone,
|
IconSpeakerphone,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import _ from "lodash";
|
||||||
|
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 from "react-simple-toasts";
|
||||||
|
|
||||||
export default function Admin_KonfirmasiInvestasi({ id }: { id: string }) {
|
export default function Admin_KonfirmasiInvestasi({
|
||||||
|
dataInvestasi,
|
||||||
|
dataUser,
|
||||||
|
}: {
|
||||||
|
dataInvestasi: MODEL_Investasi;
|
||||||
|
dataUser: MODEL_User_profile;
|
||||||
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [investasi, setInvestasi] = useState(dataInvestasi);
|
||||||
|
const [user, setUser] = useState(dataUser);
|
||||||
const [publish, setPublish] = useState(true);
|
const [publish, setPublish] = useState(true);
|
||||||
const [opened, { toggle }] = useDisclosure(false);
|
const [opened, { toggle }] = useDisclosure(false);
|
||||||
|
const [catatan, setCatatan] = useState<string | number>("");
|
||||||
|
const [status, setStatus] = useAtom(gs_StatusPortoInvestasi);
|
||||||
|
|
||||||
const listBox = [
|
const listBox = [
|
||||||
{
|
{
|
||||||
@@ -59,178 +88,244 @@ export default function Admin_KonfirmasiInvestasi({ id }: { id: string }) {
|
|||||||
route: RouterInvestasi.berita,
|
route: RouterInvestasi.berita,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// useShallowEffect(() => {
|
||||||
|
// cekStatusPublish()
|
||||||
|
// },[])
|
||||||
|
|
||||||
|
// async function cekStatusPublish() {
|
||||||
|
// if(investasi.MasterStatusInvestasi.id === "3")
|
||||||
|
// setPublish(false)
|
||||||
|
// }
|
||||||
|
|
||||||
|
async function onCatatan() {
|
||||||
|
if (_.isEmpty(catatan)) return toast("Lengkapi alasan");
|
||||||
|
console.log(catatan);
|
||||||
|
toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onPublish() {
|
||||||
|
// const res = await funGantiStatusInvestasi(investasi.id, "3")
|
||||||
|
setTimeout(() => setPublish(false), 1000);
|
||||||
|
toast("Proyek Investasi Di Publish");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Group position="left" mb={"md"}>
|
<Group position="apart" px={"md"}>
|
||||||
<Flex align={"center"} gap={"xs"}>
|
<Flex align={"center"} gap={"xs"}>
|
||||||
<Avatar src={"/aset/avatar.png"} />
|
<Avatar
|
||||||
<Text>Username</Text>
|
radius={50}
|
||||||
|
size={"lg"}
|
||||||
|
src={
|
||||||
|
RouterUserProfile.api_foto + `${user.Profile?.ImageProfile?.url}`
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Text>{user.username}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
{/* <Text>Sisa waktu : 20 Hari</Text> */}
|
<Group>
|
||||||
|
{" "}
|
||||||
|
<Center>
|
||||||
|
{publish ? (
|
||||||
|
<Button
|
||||||
|
radius={50}
|
||||||
|
bg={"green"}
|
||||||
|
color="green"
|
||||||
|
leftIcon={<IconCheck />}
|
||||||
|
onClick={() => {
|
||||||
|
onPublish();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Publish
|
||||||
|
</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>
|
||||||
|
<Button
|
||||||
|
radius={50}
|
||||||
|
bg={"red"}
|
||||||
|
color="red"
|
||||||
|
onClick={toggle}
|
||||||
|
rightIcon={<IconAlertHexagonFilled />}
|
||||||
|
>
|
||||||
|
Reject
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Paper withBorder mb={"md"}>
|
<Divider my={"md"} />
|
||||||
<AspectRatio ratio={16 / 9}>
|
|
||||||
<Image alt="" src={"/aset/no-img.png"} />
|
|
||||||
</AspectRatio>
|
|
||||||
</Paper>
|
|
||||||
|
|
||||||
{/* Title dan Persentase */}
|
<Stack spacing={"lg"}>
|
||||||
<Box mb={"md"}>
|
<Grid>
|
||||||
<Title order={4} mb={"xs"}>
|
<Grid.Col span={4}>
|
||||||
Judul Proyek
|
{/* Title */}
|
||||||
</Title>
|
<Center my={"sm"}>
|
||||||
<Slider
|
<Title order={4} mb={"xs"}>
|
||||||
disabled
|
{investasi.title}
|
||||||
size={10}
|
</Title>
|
||||||
value={60}
|
</Center>
|
||||||
marks={[{ value: 60, label: "60%" }]}
|
<Paper withBorder mb={"md"} mah={300} maw={400} mx={"auto"} p={5}>
|
||||||
/>
|
<AspectRatio ratio={16 / 9}>
|
||||||
</Box>
|
<Image
|
||||||
|
alt=""
|
||||||
{/* Rincian Data */}
|
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
||||||
<Grid p={"md"} mb={"md"}>
|
/>
|
||||||
<Grid.Col span={6}>
|
</AspectRatio>
|
||||||
<Stack>
|
|
||||||
<Box>
|
|
||||||
<Text>Terkumpul</Text>
|
|
||||||
<Text>Rp. </Text>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
<Text>Dana Dibutuhkan</Text>
|
|
||||||
<Text>Rp. </Text>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
<Text>Harga Per Lembar</Text>
|
|
||||||
<Text>Rp. </Text>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
<Text>Jadwal Pembagian</Text>
|
|
||||||
<Text>3 Bulan </Text>
|
|
||||||
</Box>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<Stack>
|
|
||||||
<Box>
|
|
||||||
<Text>Investor</Text>
|
|
||||||
<Text>4657</Text>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
<Text>ROI</Text>
|
|
||||||
<Text>%</Text>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
<Text>Total Lembar</Text>
|
|
||||||
<Text>0</Text>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
<Text>Pembagian Deviden</Text>
|
|
||||||
<Text>Selamanya</Text>
|
|
||||||
</Box>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
{/* List Box */}
|
|
||||||
<Grid mb={"xl"}>
|
|
||||||
{listBox.map((e) => (
|
|
||||||
<Grid.Col
|
|
||||||
span={"auto"}
|
|
||||||
key={e.id}
|
|
||||||
onClick={() => router.push(e.route + `${id}`)}
|
|
||||||
>
|
|
||||||
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
|
||||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
|
||||||
<Text fz={12}>{e.name}</Text>
|
|
||||||
<ActionIcon variant="transparent" size={60}>
|
|
||||||
{e.icon}
|
|
||||||
</ActionIcon>
|
|
||||||
</Flex>
|
|
||||||
</Paper>
|
</Paper>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
))}
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Stack mb={40}>
|
{/* Rincian Data */}
|
||||||
{/* Button publish dan reject */}
|
<Grid.Col span={4}>
|
||||||
<Grid>
|
<Grid p={"md"} mb={"md"}>
|
||||||
{/* Publish */}
|
<Grid.Col span={6}>
|
||||||
<Grid.Col span={6}>
|
<Stack>
|
||||||
<Center>
|
<Box>
|
||||||
{publish ? (
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Button
|
<Text>Rp. {investasi.targetDana}</Text>
|
||||||
radius={50}
|
</Box>
|
||||||
w={200}
|
<Box>
|
||||||
bg={"green"}
|
<Text>Harga Per Lembar</Text>
|
||||||
color="green"
|
<Text>Rp.{investasi.hargaLembar} </Text>
|
||||||
onClick={() => {
|
</Box>
|
||||||
setTimeout(() => setPublish(false), 1000);
|
<Box>
|
||||||
toast("Proyek Investasi Di Publish");
|
<Text>Jadwal Pembagian</Text>
|
||||||
}}
|
<Text>{investasi.MasterPembagianDeviden.name} bulan </Text>
|
||||||
>
|
</Box>
|
||||||
Publish
|
<Box>
|
||||||
</Button>
|
<Text>Pencarian Investor</Text>
|
||||||
) : (
|
<Text>{investasi.MasterPencarianInvestor.name} hari </Text>
|
||||||
<Button
|
</Box>
|
||||||
radius={50}
|
</Stack>
|
||||||
w={200}
|
</Grid.Col>
|
||||||
bg={"orange"}
|
<Grid.Col span={6}>
|
||||||
color="orange"
|
<Stack>
|
||||||
onClick={() => {
|
<Box>
|
||||||
setTimeout(() => setPublish(true), 1000);
|
<Text>ROI</Text>
|
||||||
toast("Proyek Investasi Di Non-Aktifkan");
|
<Text>{investasi.roi} %</Text>
|
||||||
}}
|
</Box>
|
||||||
>
|
<Box>
|
||||||
Non - aktif
|
<Text>Total Lembar</Text>
|
||||||
</Button>
|
<Text> {investasi.totalLembar} lembar</Text>
|
||||||
)}
|
</Box>
|
||||||
</Center>
|
<Box>
|
||||||
|
<Text>Pembagian Deviden</Text>
|
||||||
|
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
{/* Reject */}
|
|
||||||
<Grid.Col span={6}>
|
{/* Note dan dokumen */}
|
||||||
<Center>
|
<Grid.Col span={4}>
|
||||||
<Button
|
<Stack>
|
||||||
w={200}
|
{/* Note */}
|
||||||
radius={50}
|
<Stack spacing={0}>
|
||||||
bg={"red"}
|
<Text fw={"bold"}>Note :</Text>
|
||||||
color="red"
|
<Text fw={"lighter"} fs={"italic"}>
|
||||||
onClick={toggle}
|
Cek kembali kelengkapan file prospektus & semua dokumen
|
||||||
rightIcon={!opened ? <IconChevronLeft /> : <IconChevronDown />}
|
terkait investasi sebelum mem-publish. Jika kelengkapan file
|
||||||
>
|
kurang lengkap maka reject dan berikan pesan terkait
|
||||||
Reject
|
kekurangnya.
|
||||||
</Button>
|
</Text>
|
||||||
</Center>
|
</Stack>
|
||||||
|
{/* File file */}
|
||||||
|
<Stack>
|
||||||
|
{/* Prospektus */}
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Title order={6}>Prospektus :</Title>
|
||||||
|
{investasi.ProspektusInvestasi === null ? (
|
||||||
|
<Text>Tidak ada file</Text>
|
||||||
|
) : (
|
||||||
|
<Paper p={"xs"}>
|
||||||
|
<Group>
|
||||||
|
<IconFileTypePdf />
|
||||||
|
<Text>Prospektus_{investasi.title}</Text>
|
||||||
|
<Link
|
||||||
|
target="_blank"
|
||||||
|
href={
|
||||||
|
RouterInvestasi.api_file_prospektus +
|
||||||
|
`${
|
||||||
|
investasi.ProspektusInvestasi === null
|
||||||
|
? ""
|
||||||
|
: investasi.ProspektusInvestasi.id
|
||||||
|
}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button compact radius={50}>
|
||||||
|
Buka
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</Group>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* Dokumen */}
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Title order={6}>Dokumen :</Title>
|
||||||
|
{_.isEmpty(investasi.DokumenInvestasi) ? (
|
||||||
|
<Text>Tidak ada dokumen</Text>
|
||||||
|
) : (
|
||||||
|
investasi.DokumenInvestasi.map((e) => (
|
||||||
|
<Paper p={"xs"} key={e.id}>
|
||||||
|
<Group>
|
||||||
|
<IconFileTypePdf />
|
||||||
|
<Text>{e.title}</Text>
|
||||||
|
<Link
|
||||||
|
target="_blank"
|
||||||
|
href={
|
||||||
|
RouterInvestasi.api_file_dokumen + `${e.id}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button compact radius={50}>
|
||||||
|
Buka
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</Group>
|
||||||
|
</Paper>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* Text area reject */}
|
<Modal
|
||||||
<Collapse in={opened}>
|
centered
|
||||||
<Paper bg={"gray.4"} p={"xs"}>
|
opened={opened}
|
||||||
<Stack>
|
onClose={toggle}
|
||||||
<Textarea
|
// withCloseButton={false}
|
||||||
withAsterisk
|
title="Masukan alasan penolakan"
|
||||||
label="Alasan:"
|
>
|
||||||
placeholder="Masukan alasan penolakan"
|
<Textarea
|
||||||
autosize
|
mb={"md"}
|
||||||
minRows={2}
|
autosize
|
||||||
maxRows={4}
|
minRows={2}
|
||||||
/>
|
maxRows={4}
|
||||||
<Group position="right">
|
onChange={(val) => setCatatan(val.target.value)}
|
||||||
<Button
|
/>
|
||||||
w={100}
|
<Group position="right">
|
||||||
radius={50}
|
<Button radius={50} compact onClick={() => onCatatan()}>
|
||||||
bg={Warna.biru}
|
Simpan
|
||||||
compact
|
</Button>
|
||||||
onClick={toggle}
|
</Group>
|
||||||
>
|
</Modal>
|
||||||
Kirim
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
</Collapse>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
|
{/* <pre>{JSON.stringify(investasi, null, 2)}</pre> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default function Admin_Investasi({
|
|||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
router.push(RouterAdminInvestasi.halaman_aksi + `${e.id}`)
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<IconEdit />
|
<IconEdit />
|
||||||
|
|||||||
@@ -2,34 +2,35 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function funGetUserProfile(userId: string) {
|
export async function funGetUserProfile( userId: string ) {
|
||||||
|
|
||||||
const user = await prisma.user.findUnique({
|
const user = await prisma.user.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: userId
|
id: userId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
username: true,
|
username: true,
|
||||||
nomor: true,
|
nomor: true,
|
||||||
Profile: {
|
Profile: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
alamat: true,
|
alamat: true,
|
||||||
email: true,
|
email: true,
|
||||||
jenisKelamin: true,
|
jenisKelamin: true,
|
||||||
name: true,
|
name: true,
|
||||||
ImageProfile: {
|
ImageProfile: {
|
||||||
select: {
|
select: {
|
||||||
url: true,
|
url: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
revalidatePath("/dev/home");
|
revalidatePath("/dev/home");
|
||||||
revalidatePath("/dev/katalog/view")
|
revalidatePath("/dev/katalog/view");
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,13 +44,13 @@ import { gs_ListPortofolio } from "../katalog/portofolio/state/global_state";
|
|||||||
import { myConsole } from "@/app/fun/my_console";
|
import { myConsole } from "@/app/fun/my_console";
|
||||||
import { getFotoProfile } from "../katalog/profile/api/get-foto-profile";
|
import { getFotoProfile } from "../katalog/profile/api/get-foto-profile";
|
||||||
import { funGetUserProfile } from "../fun/get_user_profile";
|
import { funGetUserProfile } from "../fun/get_user_profile";
|
||||||
import { USER_PROFILE } from "../models/user_profile";
|
import { MODEL_User_profile } from "../models/user_profile";
|
||||||
import AppNotif from "../notif";
|
import AppNotif from "../notif";
|
||||||
|
|
||||||
// export const dynamic = "force-dynamic"
|
// export const dynamic = "force-dynamic"
|
||||||
// export const revalidate = 0
|
// export const revalidate = 0
|
||||||
|
|
||||||
export default function HomeView({ user }: { user: USER_PROFILE }) {
|
export default function HomeView({ user }: { user: MODEL_User_profile }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [stateUser, setStateUser] = useState(user);
|
const [stateUser, setStateUser] = useState(user);
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { funCreateInvestasi } from "../fun/fun_create_investasi";
|
|||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_TabPortoInvestasi, gs_investasiFooter } from "../g_state";
|
import { gs_StatusPortoInvestasi, gs_investasiFooter } from "../g_state";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
|
||||||
export default function InvestasiCreate({
|
export default function InvestasiCreate({
|
||||||
@@ -44,7 +44,7 @@ export default function InvestasiCreate({
|
|||||||
const [fl, setFl] = useState<File | null>(null);
|
const [fl, setFl] = useState<File | null>(null);
|
||||||
const [img, setImg] = useState<any | null>();
|
const [img, setImg] = useState<any | null>();
|
||||||
const [changeColor, setChangeColor] = useAtom(gs_investasiFooter);
|
const [changeColor, setChangeColor] = useAtom(gs_investasiFooter);
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_TabPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
const [totalLembar, setTotalLembar] = useState(0);
|
const [totalLembar, setTotalLembar] = useState(0);
|
||||||
|
|
||||||
const [value, setValue] = useState({
|
const [value, setValue] = useState({
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_TabPortoInvestasi } from "../../g_state";
|
import { gs_StatusPortoInvestasi } from "../../g_state";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import { MODEL_Investasi } from "../../model/model_investasi";
|
import { MODEL_Investasi } from "../../model/model_investasi";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -39,7 +39,7 @@ export default function DetailDraftInvestasi({
|
|||||||
dataInvestasi: any;
|
dataInvestasi: any;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_TabPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
const [investasi, setInvestasi] = useState<MODEL_Investasi>(dataInvestasi);
|
const [investasi, setInvestasi] = useState<MODEL_Investasi>(dataInvestasi);
|
||||||
|
|
||||||
const listBox = [
|
const listBox = [
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ import {
|
|||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_TabPortoInvestasi } from "../../g_state";
|
import { gs_StatusPortoInvestasi } from "../../g_state";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
|
|
||||||
export default function DetailRejectInvestasi() {
|
export default function DetailRejectInvestasi() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_TabPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
|
|
||||||
const listBox = [
|
const listBox = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_TabPortoInvestasi } from "../../g_state";
|
import { gs_StatusPortoInvestasi } from "../../g_state";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import { MODEL_Investasi } from "../../model/model_investasi";
|
import { MODEL_Investasi } from "../../model/model_investasi";
|
||||||
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
||||||
@@ -34,7 +34,7 @@ import { useState } from "react";
|
|||||||
|
|
||||||
export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MODEL_Investasi}) {
|
export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MODEL_Investasi}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_TabPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
const [investasi,setInvestasi] = useState<MODEL_Investasi>(dataInvestasi)
|
const [investasi,setInvestasi] = useState<MODEL_Investasi>(dataInvestasi)
|
||||||
|
|
||||||
const listBox = [
|
const listBox = [
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function DetailPropektus({
|
|||||||
}) {
|
}) {
|
||||||
const [prospek, setProspek] = useState(dataInvestasi);
|
const [prospek, setProspek] = useState(dataInvestasi);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{prospek.ProspektusInvestasi !== null ? (
|
{prospek.ProspektusInvestasi !== null ? (
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { atomWithStorage } from "jotai/utils";
|
import { atomWithStorage } from "jotai/utils";
|
||||||
|
|
||||||
export const gs_investasiFooter = atomWithStorage<number>("changeColor", 0)
|
export const gs_investasiFooter = atomWithStorage<number>("changeColor", 0)
|
||||||
export const gs_TabPortoInvestasi = atomWithStorage<any | string>("gs_TabPortoInvestasi" , "Draft")
|
export const gs_StatusPortoInvestasi = atomWithStorage<any | string>("gs_TabPortoInvestasi" , "Draft")
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import {
|
|||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { atomWithStorage } from "jotai/utils";
|
import { atomWithStorage } from "jotai/utils";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_TabPortoInvestasi } from "../g_state";
|
import { gs_StatusPortoInvestasi } from "../g_state";
|
||||||
import {
|
import {
|
||||||
MODEL_Investasi,
|
MODEL_Investasi,
|
||||||
MODEL_Status_investasi,
|
MODEL_Status_investasi,
|
||||||
@@ -56,7 +56,7 @@ export default function PortofolioInvestasi({
|
|||||||
listStatusInvestasi: any;
|
listStatusInvestasi: any;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_TabPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
|
|
||||||
const [investasi, setInvestasi] = useState<MODEL_Investasi[]>(dataInvestasi);
|
const [investasi, setInvestasi] = useState<MODEL_Investasi[]>(dataInvestasi);
|
||||||
const [status_inves, setStatus_inves] =
|
const [status_inves, setStatus_inves] =
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ import { getFotoProfile } from "../profile/api/get-foto-profile";
|
|||||||
import { ApiHipmi } from "@/app/lib/api";
|
import { ApiHipmi } from "@/app/lib/api";
|
||||||
import { ListPortofolioView } from "../portofolio";
|
import { ListPortofolioView } from "../portofolio";
|
||||||
import { User } from "@prisma/client";
|
import { User } from "@prisma/client";
|
||||||
import { USER_PROFILE } from "@/app_modules/models/user_profile";
|
import { MODEL_User_profile } from "@/app_modules/models/user_profile";
|
||||||
import { LIST_PORTOFOLIO } from "@/app_modules/models/portofolio";
|
import { LIST_PORTOFOLIO } from "@/app_modules/models/portofolio";
|
||||||
|
|
||||||
export default function KatalogView({ user, listPorto }: { user: USER_PROFILE, listPorto: LIST_PORTOFOLIO }) {
|
export default function KatalogView({ user, listPorto }: { user: MODEL_User_profile, listPorto: LIST_PORTOFOLIO }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProfileView user={user} />
|
<ProfileView user={user} />
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import { useState } from "react";
|
|||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import { gs_profile } from "../state/global_state";
|
import { gs_profile } from "../state/global_state";
|
||||||
import { loadDataProfile } from "../fun/fun_get_profile";
|
import { loadDataProfile } from "../fun/fun_get_profile";
|
||||||
import { USER_PROFILE } from "@/app_modules/models/user_profile";
|
import { MODEL_User_profile } from "@/app_modules/models/user_profile";
|
||||||
import funEditProfile from "../fun/fun_edit_profile";
|
import funEditProfile from "../fun/fun_edit_profile";
|
||||||
|
|
||||||
export default function EditProfile({ data }: { data: USER_PROFILE }) {
|
export default function EditProfile({ data }: { data: MODEL_User_profile }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
//Get data profile
|
//Get data profile
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { USER_PROFILE } from "@/app_modules/models/user_profile";
|
import { MODEL_User_profile } from "@/app_modules/models/user_profile";
|
||||||
|
|
||||||
export default async function funEditProfile(data: USER_PROFILE) {
|
export default async function funEditProfile(data: MODEL_User_profile) {
|
||||||
const res = await prisma.profile.update({
|
const res = await prisma.profile.update({
|
||||||
where: {
|
where: {
|
||||||
id: data.Profile?.id,
|
id: data.Profile?.id,
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import { loadDataProfile } from "../fun/fun_get_profile";
|
|||||||
import { getFotoProfile } from "../api/get-foto-profile";
|
import { getFotoProfile } from "../api/get-foto-profile";
|
||||||
import { gs_fotoProfile, gs_profile } from "../state/global_state";
|
import { gs_fotoProfile, gs_profile } from "../state/global_state";
|
||||||
import { getProfile } from "..";
|
import { getProfile } from "..";
|
||||||
import { USER_PROFILE } from "@/app_modules/models/user_profile";
|
import { MODEL_User_profile } from "@/app_modules/models/user_profile";
|
||||||
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||||
|
|
||||||
export default function ProfileView({ user }: { user: USER_PROFILE }) {
|
export default function ProfileView({ user }: { user: MODEL_User_profile }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [stateUser, setStateUser] = useState(user);
|
const [stateUser, setStateUser] = useState(user);
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export interface USER_PROFILE {
|
export interface MODEL_User_profile {
|
||||||
id: string;
|
id: string;
|
||||||
username: string;
|
username: string;
|
||||||
nomor: string;
|
nomor: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user