# feat :
## Deskripsi : - Notifikasi investasi ## Issue : Gerbang pembayaran
BIN
public/donasi/image/2a2aed6f-54a1-4e50-9bab-05b2950f071e.jpeg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/donasi/image/4be5bd92-75c3-434c-8875-68e0cae8b9d4.jpeg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/donasi/image/5a8864a2-e924-4553-b908-8b27c143897b.jpeg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/donasi/image/5f1a3a2d-b387-4923-9202-89422e4a5055.jpeg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
public/donasi/image/63727029-2d81-42b6-aa4c-29979ac57f07.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/donasi/image/694e5940-a5eb-4b68-900f-565d68250a2d.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 136 KiB |
BIN
public/donasi/invoice/c7cc699c-4bb0-4ce0-b24a-a49fdf1d7080.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
public/file/0cbfef55-042a-4554-a42c-4cd6e3e05a9f.pdf
Normal file
BIN
public/file/27f4023f-11db-4521-b707-dd300ba275e5.pdf
Normal file
BIN
public/file/33603b95-ab2c-495b-84aa-e14d1f41ed50.pdf
Normal file
BIN
public/file/3dd73ab3-6951-47be-b6f5-c24b5131887d.pdf
Normal file
BIN
public/file/4969c838-482b-41f2-b07a-55123bafe370.pdf
Normal file
BIN
public/file/4df07b6c-e80e-4aaa-8765-5ecb3706d840.pdf
Normal file
BIN
public/file/51ee2a38-715f-469d-a457-1ecb86a7efd3.pdf
Normal file
BIN
public/file/5cac5901-7bc5-4484-9464-2d7d46c5cc1a.pdf
Normal file
BIN
public/file/644b58c8-a9a9-4896-9a70-a582f10738be.pdf
Normal file
BIN
public/file/79947482-e01c-45ce-ac03-9ac66a8536ca.pdf
Normal file
BIN
public/file/9262d292-68cf-4cc6-a332-e3fa18ffb729.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/file/a3236be1-3a83-433b-8f92-df778b1bf467.pdf
Normal file
BIN
public/file/a5c5ea49-6036-4ef5-9fbd-071ce474cd29.pdf
Normal file
BIN
public/file/c9542a35-6970-43c9-9ff5-8a78b7c864dd.pdf
Normal file
BIN
public/file/cb5a14cf-7078-48fd-9166-5b96c186c376.pdf
Normal file
BIN
public/file/ce539db8-fd34-453a-aa75-25d7be692622.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/file/cf6817d8-1067-46af-8da2-44bd1ad1203d.pdf
Normal file
BIN
public/file/ebf630db-9269-453a-818a-a4707966f15a.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/investasi/01e7a1ff-b1cc-4fef-bb24-3b0747b4602b.jpeg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/investasi/0f26c0fc-a3d0-44b8-896c-ea0d750af313.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/investasi/18d79f6a-8b04-4b03-aa88-1f612708b15b.jpg
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
public/investasi/2ce5c1aa-106a-48ad-a484-433c06e50403.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/investasi/384c1993-26c5-45ed-ac96-dabce6428ba5.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/investasi/5c95f1a9-1d23-4461-bc72-b3e91a8c641c.jpg
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
public/investasi/974a98dc-6198-4e3e-b241-9562adc2fc62.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/investasi/9ec4a36e-702a-4d94-bffd-4e8d33090248.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/investasi/a18e390e-04fb-4913-942d-fb65c46b3ebd.jpg
Normal file
|
After Width: | Height: | Size: 609 KiB |
BIN
public/investasi/ae0ec403-d7ab-49b7-a14a-f9d1eef0ebe8.jpg
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
public/investasi/af17cca9-1878-493e-83b0-eb1ec7e2533d.jpg
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
public/investasi/b4c57c7b-bd74-487b-b711-f9557b227d84.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/investasi/e73819a0-1aff-45ea-8711-4a28c704e455.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
13
src/app/dev/admin/investasi/detail/publish/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { AdminInvestasi_DetailPublish } from "@/app_modules/admin/investasi";
|
||||||
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default async function Page({params}: {params: {id: string}}) {
|
||||||
|
const investasiId = params.id;
|
||||||
|
const dataInvestasi = await getOneInvestasiById(investasiId);
|
||||||
|
|
||||||
|
return<>
|
||||||
|
<AdminInvestasi_DetailPublish data={dataInvestasi as any}/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
13
src/app/dev/admin/investasi/detail/reject/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { AdminInvestasi_DetailReject } from "@/app_modules/admin/investasi";
|
||||||
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
const investasiId = params.id;
|
||||||
|
const dataInvestasi = await getOneInvestasiById(investasiId);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<AdminInvestasi_DetailReject data={dataInvestasi as any} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
14
src/app/dev/admin/investasi/detail/review/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
||||||
|
import { funGetUserProfile } from "@/app_modules/fun_global/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 investasiId = params.id;
|
||||||
|
const dataInvestasi = await getOneInvestasiById(investasiId);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -2,15 +2,14 @@ import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
|||||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||||
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);
|
||||||
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any)
|
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any);
|
||||||
// console.log(dataUser)
|
// console.log(dataUser)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} dataUser={dataUser as any} />
|
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Admin_TablePublishInvestasi } from "@/app_modules/admin/investasi";
|
import { Admin_TablePublishInvestasi } from "@/app_modules/admin/investasi";
|
||||||
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
import { adminInvestasi_funGetAllPublish } from "@/app_modules/admin/investasi/fun/get/get_all_publish";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listInvestasi = await Admin_funGetAllInvestasi();
|
const listInvestasi = await adminInvestasi_funGetAllPublish({page: 1});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Admin_TableRejectInvestasi } from "@/app_modules/admin/investasi";
|
import { Admin_TableRejectInvestasi } from "@/app_modules/admin/investasi";
|
||||||
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
import { adminInvestasi_funGetAllReject } from "@/app_modules/admin/investasi/fun/get/get_all_reject";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const dataInvestsi = await Admin_funGetAllInvestasi()
|
const dataInvestsi = await adminInvestasi_funGetAllReject({page: 1});
|
||||||
return <>
|
return (
|
||||||
<Admin_TableRejectInvestasi dataInvestsi={dataInvestsi as any}/>
|
<>
|
||||||
|
<Admin_TableRejectInvestasi dataInvestsi={dataInvestsi as any} />
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import { Admin_TableReviewInvestasi } from "@/app_modules/admin/investasi";
|
import { Admin_TableReviewInvestasi } from "@/app_modules/admin/investasi";
|
||||||
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
import { adminInvestasi_funGetAllReview } from "@/app_modules/admin/investasi/fun/get/get_all_review";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const dataInvestsi = await Admin_funGetAllInvestasi()
|
const dataInvestsi = await adminInvestasi_funGetAllReview({ page: 1 });
|
||||||
return <>
|
return (
|
||||||
<Admin_TableReviewInvestasi dataInvestsi={dataInvestsi as any}/>
|
<>
|
||||||
|
<Admin_TableReviewInvestasi dataInvestsi={dataInvestsi as any} />
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
import { DonaturDonasi } from "@/app_modules/donasi";
|
import { DonaturDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getListDonatur } from "@/app_modules/donasi/fun/get/get_list_donatur";
|
import { donasi_funGetListDonaturById } from "@/app_modules/donasi/fun/get/get_list_donatur";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const listDonatur = await Donasi_getListDonatur(params.id);
|
const donasiId = params.id;
|
||||||
|
const listDonatur = await donasi_funGetListDonaturById({
|
||||||
|
page: 1,
|
||||||
|
donasiId: donasiId,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DonaturDonasi listDonatur={listDonatur as any} />
|
<DonaturDonasi listDonatur={listDonatur as any} donasiId={donasiId} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { KabarDonasi } from "@/app_modules/donasi";
|
import { KabarDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getListKabar } from "@/app_modules/donasi/fun/get/get_list_kabar";
|
import { donasi_funGetListKabarById } from "@/app_modules/donasi/fun/get/get_list_kabar";
|
||||||
|
|
||||||
export default async function Page({params}: {params: {id: string}}) {
|
export default async function Page({params}: {params: {id: string}}) {
|
||||||
const donasiId = params.id
|
const donasiId = params.id
|
||||||
const listKabar = await Donasi_getListKabar(donasiId)
|
const listKabar = await donasi_funGetListKabarById({ page: 1, donasiId : donasiId});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<KabarDonasi listKabar={listKabar as any} />
|
<KabarDonasi listKabar={listKabar as any} donasiId={donasiId} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { ListKabarDonasi } from "@/app_modules/donasi";
|
import { ListKabarDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getListKabar } from "@/app_modules/donasi/fun/get/get_list_kabar";
|
import { donasi_funGetListKabarById } from "@/app_modules/donasi/fun/get/get_list_kabar";
|
||||||
|
|
||||||
export default async function Page({params}: {params: {id: string}}) {
|
export default async function Page({params}: {params: {id: string}}) {
|
||||||
const donasiId = params.id
|
const donasiId = params.id
|
||||||
const listKabar = await Donasi_getListKabar(donasiId)
|
const listKabar = await donasi_funGetListKabarById({page: 1, donasiId : donasiId});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { MainDonasi } from "@/app_modules/donasi";
|
import { MainDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getListBeranda } from "@/app_modules/donasi/fun/get/get_list_beranda";
|
import { donasi_funGetAllPublish } from "@/app_modules/donasi/fun/get/get_list_beranda";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listDonasi = await Donasi_getListBeranda()
|
const listDonasi = await donasi_funGetAllPublish({ page: 1 });
|
||||||
// console.log(listDonasi)
|
// console.log(listDonasi)
|
||||||
return <MainDonasi listDonasi={listDonasi as any}/>
|
return <MainDonasi listDonasi={listDonasi as any} />;
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
import { DonasiSayaDonasi } from "@/app_modules/donasi";
|
import { DonasiSayaDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_list_invoice_by_author_id";
|
import { donasi_funGetAllInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_all_invoice_by_author_id";
|
||||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const authorId = await user_getOneUserId();
|
const listInvoice = await donasi_funGetAllInvoiceByAuthorId({ page: 1 });
|
||||||
const listInvoice = await Donasi_getInvoiceByAuthorId(authorId);
|
|
||||||
|
|
||||||
return <DonasiSayaDonasi listInvoice={listInvoice as any} />;
|
return <DonasiSayaDonasi listInvoice={listInvoice as any} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
import { PostingDonasi } from "@/app_modules/donasi";
|
import { PostingDonasi } from "@/app_modules/donasi";
|
||||||
import Donasi_getByStatus from "@/app_modules/donasi/fun/get/get_donasi_by_status";
|
import Donasi_getByStatus from "@/app_modules/donasi/fun/get/get_donasi_by_status";
|
||||||
|
import { donasi_funGetAllStatusDraft } from "@/app_modules/donasi/fun/get/status/get_all_status_draft";
|
||||||
|
import { donasi_funGetAllStatusPublish } from "@/app_modules/donasi/fun/get/status/get_all_status_publish";
|
||||||
|
import { donasi_funGetAllStatusReject } from "@/app_modules/donasi/fun/get/status/get_all_status_reject";
|
||||||
|
import { donasi_funGetAllStatusReview } from "@/app_modules/donasi/fun/get/status/get_all_status_review";
|
||||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const authorId = await user_getOneUserId();
|
const authorId = await user_getOneUserId();
|
||||||
const listPublish = await Donasi_getByStatus(authorId, "1")
|
const listPublish = await donasi_funGetAllStatusPublish({page: 1});
|
||||||
const listReview = await Donasi_getByStatus(authorId, "2");
|
const listReview = await donasi_funGetAllStatusReview({page: 1});
|
||||||
const listDraft = await Donasi_getByStatus(authorId, "3");
|
const listDraft = await donasi_funGetAllStatusDraft({page: 1});
|
||||||
const listReject = await Donasi_getByStatus(authorId, "4")
|
const listReject = await donasi_funGetAllStatusReject({page: 1});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
import { PencairanDanaDonasi } from "@/app_modules/donasi";
|
import { PencairanDanaDonasi } from "@/app_modules/donasi";
|
||||||
import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
|
import { donasi_funGetListPencairanDanaById } from "@/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id";
|
||||||
import { Donasi_getListPencairanDanaById } from "@/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id";
|
|
||||||
import { Donasi_getTotalPencairanDanaById } from "@/app_modules/donasi/fun/get/get_pencairan_dana_by_id";
|
import { Donasi_getTotalPencairanDanaById } from "@/app_modules/donasi/fun/get/get_pencairan_dana_by_id";
|
||||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { Loader } from "@mantine/core";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let donasiId = params.id;
|
let donasiId = params.id;
|
||||||
const totalAkumulasi = await Donasi_getTotalPencairanDanaById(donasiId);
|
const totalAkumulasi = await Donasi_getTotalPencairanDanaById(donasiId);
|
||||||
const listPencairan = await Donasi_getListPencairanDanaById(donasiId);
|
const listPencairan = await donasi_funGetListPencairanDanaById({page: 1, donasiId: donasiId});
|
||||||
|
|
||||||
|
|
||||||
// if (authorId != totalAkumulasi?.authorId) return <><NotifPeringatan /></>
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PencairanDanaDonasi
|
<PencairanDanaDonasi
|
||||||
|
donasiId={donasiId}
|
||||||
totalAkumulasi={totalAkumulasi as any}
|
totalAkumulasi={totalAkumulasi as any}
|
||||||
listPencairan={listPencairan as any}
|
listPencairan={listPencairan as any}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { Event_StatusPage } from "@/app_modules/event";
|
import { Event_StatusPage } from "@/app_modules/event";
|
||||||
import { Event_getListByStatusId } from "@/app_modules/event/fun/get/get_list_event_by_status_id";
|
|
||||||
import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft";
|
import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft";
|
||||||
import { event_getAllReject } from "@/app_modules/event/fun/get/status/get_all_reject";
|
import { event_getAllReject } from "@/app_modules/event/fun/get/status/get_all_reject";
|
||||||
import { event_getAllReview } from "@/app_modules/event/fun/get/status/get_all_review";
|
import { event_getAllReview } from "@/app_modules/event/fun/get/status/get_all_review";
|
||||||
|
import { event_funGetAllStatusPublish } from "@/app_modules/event/fun/get/status/get_all_status_publish";
|
||||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const authorId = await user_getOneUserId();
|
const authorId = await user_getOneUserId();
|
||||||
const listPublish = await Event_getListByStatusId("1", authorId);
|
const listPublish = await event_funGetAllStatusPublish({ page: 1 });
|
||||||
const listReview = await event_getAllReview({page: 1});
|
const listReview = await event_getAllReview({ page: 1 });
|
||||||
const listDraft = await event_getAllDraft({ page: 1 });
|
const listDraft = await event_getAllDraft({ page: 1 });
|
||||||
const listReject = await event_getAllReject({page: 1});
|
const listReject = await event_getAllReject({ page: 1 });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Event_StatusPage
|
<Event_StatusPage
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ export default async function Page({params}: {params: {id: string}}) {
|
|||||||
const dataInvestasi = await getOneInvestasiById(params.id)
|
const dataInvestasi = await getOneInvestasiById(params.id)
|
||||||
|
|
||||||
return<>
|
return<>
|
||||||
<DetailDraftInvestasi dataInvestasi={dataInvestasi}/>
|
<DetailDraftInvestasi dataInvestasi={dataInvestasi as any}/>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
import { DetailPublishInvestasi } from "@/app_modules/investasi";
|
import { DetailPublishInvestasi } 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<>
|
<>
|
||||||
<DetailPublishInvestasi dataInvestasi={dataInvestasi as any}/>
|
<DetailPublishInvestasi dataInvestasi={dataInvestasi as any} />
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,45 +1,12 @@
|
|||||||
import { MainInvestasi } from "@/app_modules/investasi";
|
import { MainInvestasi } from "@/app_modules/investasi";
|
||||||
import funUpadteProgresPersenInvestasi from "@/app_modules/investasi/fun/fun_update_progres_persen";
|
import { investasi_funGetAllPublish } from "@/app_modules/investasi/fun/get_all_investasi";
|
||||||
import funUpadteProgresWaktuInvestasi from "@/app_modules/investasi/fun/fun_update_progres_waktu";
|
|
||||||
import getAllDataPublishInvestasi from "@/app_modules/investasi/fun/get_list_all_investasi";
|
|
||||||
import { getListAllPublish } from "@/app_modules/investasi/fun/get_list_all_publish";
|
|
||||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
|
||||||
|
|
||||||
import _ from "lodash";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const dataOnProgres = await getListAllPublish("1");
|
const allData = await investasi_funGetAllPublish();
|
||||||
const dataSelesai = await getListAllPublish("2");
|
|
||||||
const dataWaktuHabis = await getListAllPublish("3");
|
|
||||||
const allData = await getAllDataPublishInvestasi();
|
|
||||||
// console.log(allData)
|
|
||||||
|
|
||||||
// const dataInves: MODEL_Investasi[] = [];
|
|
||||||
|
|
||||||
// for (let i of allData as any) {
|
|
||||||
// await funUpadteProgresWaktuInvestasi(i).then(
|
|
||||||
// async () =>
|
|
||||||
// await funUpadteProgresPersenInvestasi(i).then(
|
|
||||||
// async () =>
|
|
||||||
// await getAllDataPublishInvestasi().then((val: any) =>
|
|
||||||
// dataInves.push(val)
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const realData = dataInves.map((e) => e)
|
|
||||||
// console.log(allData)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<MainInvestasi
|
<MainInvestasi listData={allData as any} />
|
||||||
listData={allData as any}
|
|
||||||
dataSelesai={dataSelesai as any}
|
|
||||||
dataWaktuHabis={dataWaktuHabis as any}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default async function Page() {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
const listTransaksi = await getListTransaksiBerhasilInvestasi(user.id)
|
const listTransaksi = await getListTransaksiBerhasilInvestasi(user.id)
|
||||||
// console.log(listTransaksi)
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<InvestasiSahamTerbeli listTransaksi={listTransaksi as any} />
|
<InvestasiSahamTerbeli listTransaksi={listTransaksi as any} />
|
||||||
|
|||||||
@@ -3,10 +3,15 @@ import React from "react";
|
|||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
children,
|
children,
|
||||||
|
params,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
params: {id: string}
|
||||||
}) {
|
}) {
|
||||||
|
const investasiId = params.id;
|
||||||
return (
|
return (
|
||||||
<LayoutProsesTransaksiInvestasi>{children}</LayoutProsesTransaksiInvestasi>
|
<LayoutProsesTransaksiInvestasi investasiId={investasiId}>
|
||||||
|
{children}
|
||||||
|
</LayoutProsesTransaksiInvestasi>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
useEmotionCache,
|
useEmotionCache,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { Notifications } from "@mantine/notifications";
|
import { Notifications } from "@mantine/notifications";
|
||||||
|
import { Provider } from "jotai";
|
||||||
import { useServerInsertedHTML } from "next/navigation";
|
import { useServerInsertedHTML } from "next/navigation";
|
||||||
import "react-toastify/dist/ReactToastify.css";
|
import "react-toastify/dist/ReactToastify.css";
|
||||||
|
|
||||||
@@ -39,25 +40,7 @@ export default function RootStyleRegistry({
|
|||||||
<CacheProvider value={cache}>
|
<CacheProvider value={cache}>
|
||||||
<MantineProvider withGlobalStyles withNormalizeCSS>
|
<MantineProvider withGlobalStyles withNormalizeCSS>
|
||||||
<Notifications position="top-center" containerWidth={300} />
|
<Notifications position="top-center" containerWidth={300} />
|
||||||
{children}
|
<Provider>{children}</Provider>
|
||||||
{/* <Box
|
|
||||||
bg={"#252A2F"}
|
|
||||||
pos={"fixed"}
|
|
||||||
w={"100%"}
|
|
||||||
h={"100%"}
|
|
||||||
style={{
|
|
||||||
overflowY: "auto",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Container
|
|
||||||
mih={"100vh"}
|
|
||||||
p={0}
|
|
||||||
size={rem(500)}
|
|
||||||
bg={MainColor.darkblue}
|
|
||||||
>
|
|
||||||
|
|
||||||
</Container>
|
|
||||||
</Box> */}
|
|
||||||
</MantineProvider>
|
</MantineProvider>
|
||||||
</CacheProvider>
|
</CacheProvider>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -3,4 +3,9 @@ export const RouterAdminInvestasi = {
|
|||||||
table_publish: "/dev/admin/investasi/sub-menu/publish",
|
table_publish: "/dev/admin/investasi/sub-menu/publish",
|
||||||
table_review: "/dev/admin/investasi/sub-menu/review",
|
table_review: "/dev/admin/investasi/sub-menu/review",
|
||||||
table_reject: "/dev/admin/investasi/sub-menu/reject",
|
table_reject: "/dev/admin/investasi/sub-menu/reject",
|
||||||
|
|
||||||
|
// detail
|
||||||
|
detail_publish: "/dev/admin/investasi/detail/publish/",
|
||||||
|
detail_review: "/dev/admin/investasi/detail/review/",
|
||||||
|
detail_reject: "/dev/admin/investasi/detail/reject/",
|
||||||
};
|
};
|
||||||
@@ -36,6 +36,7 @@ export const RouterDonasi = {
|
|||||||
detail_donasi_saya: "/dev/donasi/detail/detail_donasi_saya/",
|
detail_donasi_saya: "/dev/donasi/detail/detail_donasi_saya/",
|
||||||
detail_notif: "/dev/donasi/detail/detail_notif/",
|
detail_notif: "/dev/donasi/detail/detail_notif/",
|
||||||
|
|
||||||
|
|
||||||
//alur donasi
|
//alur donasi
|
||||||
donatur: "/dev/donasi/donatur/",
|
donatur: "/dev/donasi/donatur/",
|
||||||
kabar: "/dev/donasi/kabar/",
|
kabar: "/dev/donasi/kabar/",
|
||||||
@@ -44,6 +45,7 @@ export const RouterDonasi = {
|
|||||||
cerita_penggalang: "/dev/donasi/cerita_penggalang/",
|
cerita_penggalang: "/dev/donasi/cerita_penggalang/",
|
||||||
list_kabar: "/dev/donasi/list_kabar/",
|
list_kabar: "/dev/donasi/list_kabar/",
|
||||||
notif_page: "/dev/donasi/notif_page/",
|
notif_page: "/dev/donasi/notif_page/",
|
||||||
|
bukti_transfer: "/dev/donasi/bukti-transfer/",
|
||||||
|
|
||||||
// proses donasi
|
// proses donasi
|
||||||
masukan_donasi: "/dev/donasi/proses_donasi/masukan_donasi/",
|
masukan_donasi: "/dev/donasi/proses_donasi/masukan_donasi/",
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ import { IconChevronLeft } 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 ComponentAdminGlobal_BackButton({path}:{path?:string}) {
|
export default function ComponentAdminGlobal_BackButton({
|
||||||
|
path,
|
||||||
|
}: {
|
||||||
|
path?: string;
|
||||||
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
@@ -17,18 +21,21 @@ export default function ComponentAdminGlobal_BackButton({path}:{path?:string}) {
|
|||||||
// loading={isLoading ? true : false}
|
// loading={isLoading ? true : false}
|
||||||
c={"gray"}
|
c={"gray"}
|
||||||
leftIcon={
|
leftIcon={
|
||||||
isLoading ? <Loader size={"xs"} color={"gray"} /> : <IconChevronLeft />
|
isLoading ? (
|
||||||
|
<Loader size={"xs"} color={"gray"} />
|
||||||
|
) : (
|
||||||
|
<IconChevronLeft />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
variant="white"
|
variant="white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// setTimeout(() => , 3000);
|
// setTimeout(() => , 3000);
|
||||||
if(path==null){
|
if (path == null) {
|
||||||
router.back();
|
router.back();
|
||||||
}else{
|
} else {
|
||||||
router.push(path)
|
router.push(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Kembali
|
Kembali
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ function TablePublish({ listPublish }: { listPublish: any }) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
{isEmpty(data) ? (
|
{isEmpty(data) ? (
|
||||||
<ComponentAdminGlobal_IsEmptyData />
|
<ComponentAdminGlobal_IsEmptyData />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||||
|
import { Paper, Stack, Title, Grid, Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export function ComponentAdminInvestasi_DetailDataAuthor({
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
data: any;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<Paper withBorder p={"lg"}>
|
||||||
|
<Stack>
|
||||||
|
<Title order={3}>Data User</Title>
|
||||||
|
<Stack spacing={"xs"}>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text fw={"bold"}>Nama:</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text>{data?.Profile?.name}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text fw={"bold"}>Username:</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text>@{data?.username}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text fw={"bold"}>Nomor:</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text>+ {data?.nomor}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text fw={"bold"}>Alamat:</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text>{data?.Profile?.alamat}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import { Paper, Stack, Title, Grid, Box, Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export function ComponentAdminInvestasi_DetailData({ data }: { data: any }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper withBorder p={"lg"}>
|
||||||
|
<Stack>
|
||||||
|
<Title order={3}>Rincian Data Investasi</Title>
|
||||||
|
<Grid justify="center">
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
|
<Box>
|
||||||
|
<Text>Judul</Text>
|
||||||
|
<Text fw={"bold"}>{data?.title}</Text>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Text>Dana Dibutuhkan</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Text>Harga Per Lembar</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.hargaLembar)}{" "}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Text>Total Lembar</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.totalLembar)}{" "}
|
||||||
|
lembar
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
|
<Box>
|
||||||
|
<Text>ROI</Text>
|
||||||
|
<Text fw={"bold"}>{data.roi} %</Text>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Text>Pembagian Deviden</Text>
|
||||||
|
<Text fw={"bold"}>{data.MasterPeriodeDeviden.name}</Text>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Text>Jadwal Pembagian</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
{data.MasterPembagianDeviden.name} bulan{" "}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Text>Pencarian Investor</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
{data.MasterPencarianInvestor.name} hari{" "}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { Paper, Stack, Title, AspectRatio, Center, Image } from "@mantine/core";
|
||||||
|
|
||||||
|
export function ComponentAdminInvestasi_DetailGambar({imagesId}: {imagesId: any}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper withBorder p={"lg"}>
|
||||||
|
<Stack>
|
||||||
|
<Title align="center" order={3}>
|
||||||
|
Gambar Proyek
|
||||||
|
</Title>
|
||||||
|
|
||||||
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
|
<Center>
|
||||||
|
<Image
|
||||||
|
style={{ borderRadius: "10px" }}
|
||||||
|
radius={"md"}
|
||||||
|
width={200}
|
||||||
|
alt=""
|
||||||
|
src={RouterInvestasi.api_gambar + `${imagesId}`}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</AspectRatio>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import {
|
||||||
|
SimpleGrid,
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Title,
|
||||||
|
Grid,
|
||||||
|
Group,
|
||||||
|
Button,
|
||||||
|
Text,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { IconFileTypePdf } from "@tabler/icons-react";
|
||||||
|
import _ from "lodash";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
|
export function ComponentAdminInvestasi_UIDetailFile({
|
||||||
|
title,
|
||||||
|
dataProspektus,
|
||||||
|
listDokumen,
|
||||||
|
}: {
|
||||||
|
title: string;
|
||||||
|
dataProspektus: any;
|
||||||
|
listDokumen: any[];
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SimpleGrid
|
||||||
|
cols={1}
|
||||||
|
spacing="lg"
|
||||||
|
breakpoints={[
|
||||||
|
{ maxWidth: "62rem", cols: 1, spacing: "md" },
|
||||||
|
{ maxWidth: "48rem", cols: 1, spacing: "sm" },
|
||||||
|
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Paper withBorder p={"lg"}>
|
||||||
|
<Stack>
|
||||||
|
<Title order={3}>File & Dokumen</Title>
|
||||||
|
|
||||||
|
<Stack spacing={50}>
|
||||||
|
{/* File */}
|
||||||
|
<Grid align="center">
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<Text fw={"bold"}>File:</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={8}>
|
||||||
|
<Group>
|
||||||
|
<IconFileTypePdf />
|
||||||
|
<Text>Prospek {title}</Text>
|
||||||
|
<Link
|
||||||
|
target="_blank"
|
||||||
|
href={
|
||||||
|
RouterInvestasi.api_file_prospektus +
|
||||||
|
`${dataProspektus === null ? "" : dataProspektus.id}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button radius={50}>Lihat</Button>
|
||||||
|
</Link>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
{/* Dokumen */}
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<Text fw={"bold"}>Dokumen:</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={8}>
|
||||||
|
<Stack>
|
||||||
|
{_.isEmpty(listDokumen) ? (
|
||||||
|
<Text>-</Text>
|
||||||
|
) : (
|
||||||
|
listDokumen.map((e: any) => (
|
||||||
|
<Paper key={e.id}>
|
||||||
|
<Group>
|
||||||
|
<IconFileTypePdf />
|
||||||
|
<Text>{e.title}</Text>
|
||||||
|
<Link
|
||||||
|
target="_blank"
|
||||||
|
href={
|
||||||
|
RouterInvestasi.api_file_dokumen + `${e.id}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button radius={50}>Lihat</Button>
|
||||||
|
</Link>
|
||||||
|
</Group>
|
||||||
|
</Paper>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</SimpleGrid>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
159
src/app_modules/admin/investasi/detail/detail_publish.tsx
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
|
import {
|
||||||
|
AspectRatio,
|
||||||
|
Box,
|
||||||
|
Center,
|
||||||
|
Grid,
|
||||||
|
Image,
|
||||||
|
List,
|
||||||
|
Paper,
|
||||||
|
SimpleGrid,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
ThemeIcon,
|
||||||
|
Title,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import ComponentAdminGlobal_BackButton from "../../component_global/back_button";
|
||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { IconCircleCheck, IconHome } from "@tabler/icons-react";
|
||||||
|
import investasi from "../../notifikasi/route_setting/investasi";
|
||||||
|
|
||||||
|
export function AdminInvestasi_DetailPublish({
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
data: MODEL_Investasi;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
<ComponentAdminGlobal_BackButton />
|
||||||
|
<SimpleGrid cols={2}>
|
||||||
|
<InformasiAuthor data={data} />
|
||||||
|
<InformasiDataInvestasi data={data} />
|
||||||
|
</SimpleGrid>
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function InformasiAuthor({ data }: { data: MODEL_Investasi }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper withBorder>
|
||||||
|
<Stack p={"lg"} spacing={"xl"}>
|
||||||
|
<Title align="center" order={3}>
|
||||||
|
{data.title}
|
||||||
|
</Title>
|
||||||
|
|
||||||
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
|
<Center>
|
||||||
|
<Image
|
||||||
|
bg={"blue"}
|
||||||
|
style={{ borderRadius: "10px" }}
|
||||||
|
radius={"md"}
|
||||||
|
width={250}
|
||||||
|
alt=""
|
||||||
|
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</AspectRatio>
|
||||||
|
|
||||||
|
<Stack spacing={"sm"}>
|
||||||
|
<Title order={4}>Informasi pemilik</Title>
|
||||||
|
|
||||||
|
<List
|
||||||
|
spacing="xs"
|
||||||
|
size="sm"
|
||||||
|
center
|
||||||
|
icon={
|
||||||
|
<ThemeIcon color="teal" size={24} radius="xl">
|
||||||
|
<IconCircleCheck size="1rem" />
|
||||||
|
</ThemeIcon>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<List.Item>{data.author.username}</List.Item>
|
||||||
|
<List.Item>+{data.author.nomor}</List.Item>
|
||||||
|
<List.Item>{data.author.Profile.email}</List.Item>
|
||||||
|
</List>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function InformasiDataInvestasi({ data }: { data: MODEL_Investasi }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper withBorder p={"lg"}>
|
||||||
|
<Stack>
|
||||||
|
<Title order={3}>Rincian Data Investasi</Title>
|
||||||
|
<Grid justify="center">
|
||||||
|
<Grid.Col>
|
||||||
|
<Grid mt={"md"} justify="center">
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
|
<Box>
|
||||||
|
<Text>Dana Dibutuhkan</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Harga Per Lembar</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.hargaLembar)}{" "}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Jadwal Pembagian</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
{data.MasterPembagianDeviden.name} bulan{" "}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Pencarian Investor</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
{data.MasterPencarianInvestor.name} hari{" "}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
|
<Box>
|
||||||
|
<Text>ROI</Text>
|
||||||
|
<Text fw={"bold"}>{data.roi} %</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Total Lembar</Text>
|
||||||
|
<Text fw={"bold"}>
|
||||||
|
{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+data.totalLembar)}{" "}
|
||||||
|
lembar
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Pembagian Deviden</Text>
|
||||||
|
<Text fw={"bold"}>{data.MasterPeriodeDeviden.name}</Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
76
src/app_modules/admin/investasi/detail/detail_reject.tsx
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
|
import {
|
||||||
|
Paper,
|
||||||
|
SimpleGrid,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title
|
||||||
|
} from "@mantine/core";
|
||||||
|
import ComponentAdminGlobal_BackButton from "../../component_global/back_button";
|
||||||
|
import { ComponentAdminInvestasi_DetailDataAuthor } from "../_component/detail_data_author";
|
||||||
|
import { ComponentAdminInvestasi_DetailData } from "../_component/detail_data_investasi";
|
||||||
|
import { ComponentAdminInvestasi_DetailGambar } from "../_component/detail_gambar_investasi";
|
||||||
|
import { ComponentAdminInvestasi_UIDetailFile } from "../_component/ui_detail_file";
|
||||||
|
|
||||||
|
export function AdminInvestasi_DetailReject({
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
data: MODEL_Investasi;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack px={"lg"}>
|
||||||
|
<ComponentAdminGlobal_BackButton />
|
||||||
|
<SimpleGrid
|
||||||
|
cols={3}
|
||||||
|
spacing="lg"
|
||||||
|
breakpoints={[
|
||||||
|
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
||||||
|
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||||
|
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Paper withBorder p={"lg"}>
|
||||||
|
<Stack>
|
||||||
|
<Title order={3} c={"red"}>
|
||||||
|
#{" "}
|
||||||
|
<Text span inherit c={"black"}>
|
||||||
|
Alasan penolakan
|
||||||
|
</Text>
|
||||||
|
</Title>
|
||||||
|
<Text>{data.catatan}</Text>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</SimpleGrid>
|
||||||
|
|
||||||
|
<SimpleGrid
|
||||||
|
cols={3}
|
||||||
|
spacing="lg"
|
||||||
|
breakpoints={[
|
||||||
|
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
||||||
|
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||||
|
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{/* Data Author */}
|
||||||
|
<ComponentAdminInvestasi_DetailDataAuthor data={data.author} />
|
||||||
|
|
||||||
|
{/* Data Foto */}
|
||||||
|
<ComponentAdminInvestasi_DetailGambar imagesId={data.imagesId} />
|
||||||
|
|
||||||
|
{/* Data Detail */}
|
||||||
|
<ComponentAdminInvestasi_DetailData data={data} />
|
||||||
|
</SimpleGrid>
|
||||||
|
|
||||||
|
<ComponentAdminInvestasi_UIDetailFile
|
||||||
|
title={data.title}
|
||||||
|
dataProspektus={data.ProspektusInvestasi}
|
||||||
|
listDokumen={data.DokumenInvestasi}
|
||||||
|
/>
|
||||||
|
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,173 +1,224 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { BeritaInvestasi } from "@/app_modules/investasi";
|
||||||
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_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import {
|
import {
|
||||||
Group,
|
|
||||||
Flex,
|
|
||||||
Avatar,
|
|
||||||
Paper,
|
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Box,
|
Box,
|
||||||
Title,
|
|
||||||
Slider,
|
|
||||||
Grid,
|
|
||||||
Stack,
|
|
||||||
ActionIcon,
|
|
||||||
Center,
|
|
||||||
Button,
|
Button,
|
||||||
Text,
|
Center,
|
||||||
Image,
|
|
||||||
Collapse,
|
|
||||||
Textarea,
|
|
||||||
Divider,
|
Divider,
|
||||||
Mark,
|
Grid,
|
||||||
|
Group,
|
||||||
|
Image,
|
||||||
Modal,
|
Modal,
|
||||||
|
Paper,
|
||||||
|
SimpleGrid,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Textarea,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconAlertHexagonFilled,
|
IconAlertHexagonFilled,
|
||||||
IconBan,
|
|
||||||
IconBookDownload,
|
|
||||||
IconCheck,
|
IconCheck,
|
||||||
IconChevronDown,
|
|
||||||
IconChevronLeft,
|
|
||||||
IconChevronRight,
|
|
||||||
IconFile,
|
|
||||||
IconFileDescription,
|
|
||||||
IconFileTypePdf,
|
IconFileTypePdf,
|
||||||
IconPdf,
|
|
||||||
IconSpeakerphone,
|
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import _ from "lodash";
|
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, { toastConfig } from "react-simple-toasts";
|
|
||||||
import Admin_funRejectInvestasi from "../fun/fun_reject_investasi";
|
|
||||||
import { RouterAdminInvestasi_OLD } 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";
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../component_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiGagal } from "../../component_global/admin_notifikasi/notifikasi_gagal";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../component_global/admin_notifikasi/notifikasi_peringatan";
|
||||||
|
import ComponentAdminGlobal_BackButton from "../../component_global/back_button";
|
||||||
|
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
|
||||||
|
import { ComponentAdminInvestasi_DetailDataAuthor } from "../_component/detail_data_author";
|
||||||
|
import { ComponentAdminInvestasi_DetailData } from "../_component/detail_data_investasi";
|
||||||
|
import { ComponentAdminInvestasi_DetailGambar } from "../_component/detail_gambar_investasi";
|
||||||
|
import { ComponentAdminInvestasi_UIDetailFile } from "../_component/ui_detail_file";
|
||||||
|
import { adminInvestasi_funEditStatusPublishById } from "../fun/edit/fun_status_publish_by_id";
|
||||||
|
import Admin_funRejectInvestasi from "../fun/fun_reject_investasi";
|
||||||
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
toastConfig({ theme: "dark" });
|
export default function AdminInvestasi_DetailReview({
|
||||||
|
|
||||||
export default function Admin_KonfirmasiInvestasi({
|
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
dataUser,
|
|
||||||
}: {
|
}: {
|
||||||
dataInvestasi: MODEL_Investasi;
|
dataInvestasi: MODEL_Investasi;
|
||||||
dataUser: MODEL_PROFILE_OLD;
|
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [investasi, setInvestasi] = useState(dataInvestasi);
|
const [data, setData] = useState(dataInvestasi);
|
||||||
const [user, setUser] = useState(dataUser);
|
|
||||||
const [publish, setPublish] = useState(true);
|
const [publish, setPublish] = useState(true);
|
||||||
const [opened, { toggle }] = useDisclosure(false);
|
const [openModal, setOpenModal] = useState(false);
|
||||||
const [catatan, setCatatan] = useState<string | number>("");
|
const [isLoadingPublish, setIsLoadingPublish] = useState(false);
|
||||||
const [status, setStatus] = useAtom(gs_StatusPortoInvestasi);
|
const [isLoadingReject, setIsLoadingReject] = useState(false);
|
||||||
|
|
||||||
const listBox = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "Prospektus",
|
|
||||||
icon: <IconBookDownload size={70} />,
|
|
||||||
route: RouterInvestasi.detail_prospektus,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "Dokumen",
|
|
||||||
icon: <IconFileDescription size={70} />,
|
|
||||||
route: RouterInvestasi.detail_dokumen,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "Berita",
|
|
||||||
icon: <IconSpeakerphone size={70} />,
|
|
||||||
route: RouterInvestasi.berita,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
cekStatusPublish();
|
cekStatusPublish();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function cekStatusPublish() {
|
async function cekStatusPublish() {
|
||||||
if (investasi.MasterStatusInvestasi.id === "3") setPublish(false);
|
if (data.MasterStatusInvestasi.id === "3") setPublish(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onReject() {
|
async function onReject() {
|
||||||
const body = {
|
const body = {
|
||||||
id: investasi.id,
|
id: data.id,
|
||||||
catatan: investasi.catatan,
|
catatan: data.catatan,
|
||||||
status: "4",
|
status: "4",
|
||||||
};
|
};
|
||||||
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
if (_.isEmpty(body.catatan))
|
||||||
await Admin_funRejectInvestasi(body).then((res) => {
|
return ComponentAdminGlobal_NotifikasiPeringatan("Lengkapi alasan");
|
||||||
if (res.status === 200) {
|
const res = await Admin_funRejectInvestasi(body);
|
||||||
toast(res.message);
|
if (res.status === 200) {
|
||||||
router.back();
|
const dataNotif = {
|
||||||
toggle();
|
appId: res.data?.id,
|
||||||
} else {
|
userId: res.data?.authorId,
|
||||||
toast(res.message);
|
pesan: res.data?.title,
|
||||||
|
status: res.data?.MasterStatusInvestasi?.name,
|
||||||
|
kategoriApp: "INVESTASI",
|
||||||
|
title: "Investasi anda di tolak !",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: res?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
const loadData = await getOneInvestasiById(data.id);
|
||||||
|
setData(loadData as any);
|
||||||
|
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
router.back();
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onPublish() {
|
async function onPublish() {
|
||||||
await funGantiStatusInvestasi(investasi.id, "3", "1").then((res) => {
|
const res = await adminInvestasi_funEditStatusPublishById({
|
||||||
if (res.status === 200) {
|
investasiId: data.id,
|
||||||
setTimeout(() => setPublish(false), 1000);
|
statusId: "1",
|
||||||
router.push(RouterAdminInvestasi_OLD.table_status_review);
|
progesInvestasiId: "1",
|
||||||
toast("Proyek Investasi Di Publish");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
if (res.status === 200) {
|
||||||
|
const dataNotif = {
|
||||||
|
appId: res.data?.id,
|
||||||
|
userId: res.data?.authorId as any,
|
||||||
|
pesan: res.data?.title as any,
|
||||||
|
status: res.data?.MasterStatusInvestasi?.name as any,
|
||||||
|
kategoriApp: "INVESTASI",
|
||||||
|
title: "Investasi publish",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: res?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
|
|
||||||
|
mqtt_client.publish(
|
||||||
|
"Beranda_Investasi",
|
||||||
|
JSON.stringify({ update: true })
|
||||||
|
);
|
||||||
|
|
||||||
|
const loadData = await getOneInvestasiById(data.id);
|
||||||
|
setData(loadData as any);
|
||||||
|
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil("Proyek Investasi Di Publish");
|
||||||
|
router.back();
|
||||||
|
// router.push(RouterAdminInvestasi_OLD.table_status_review);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Group position="apart" px={"md"}>
|
<Stack px={"lg"}>
|
||||||
<Group>
|
<Group position="apart">
|
||||||
<ActionIcon onClick={() => router.back()}>
|
<ComponentAdminGlobal_BackButton />
|
||||||
<IconChevronLeft />
|
|
||||||
</ActionIcon>
|
{data.masterStatusInvestasiId === "2" ? (
|
||||||
<Flex align={"center"} gap={"xs"} pl={"lg"}>
|
<Group>
|
||||||
{/* <Avatar
|
<Button
|
||||||
radius={50}
|
loaderPosition="center"
|
||||||
size={"md"}
|
loading={isLoadingPublish}
|
||||||
src={
|
radius={"xl"}
|
||||||
RouterProfile.api_foto +
|
color="green"
|
||||||
`${user.Profile?.ImageProfile?.url}`
|
onClick={() => onPublish()}
|
||||||
}
|
>
|
||||||
/> */}
|
Publish
|
||||||
<Text>{user.username}</Text>
|
</Button>
|
||||||
</Flex>
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoadingReject}
|
||||||
|
radius={"xl"}
|
||||||
|
color="red"
|
||||||
|
onClick={() => onReject()}
|
||||||
|
>
|
||||||
|
Reject
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
<SimpleGrid
|
||||||
|
cols={3}
|
||||||
|
spacing="lg"
|
||||||
|
breakpoints={[
|
||||||
|
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
||||||
|
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
||||||
|
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{/* Data Author */}
|
||||||
|
<ComponentAdminInvestasi_DetailDataAuthor data={data.author} />
|
||||||
|
|
||||||
|
{/* Data Foto */}
|
||||||
|
<ComponentAdminInvestasi_DetailGambar imagesId={data.imagesId} />
|
||||||
|
|
||||||
|
{/* Data Detail */}
|
||||||
|
<ComponentAdminInvestasi_DetailData data={data} />
|
||||||
|
</SimpleGrid>
|
||||||
|
|
||||||
|
<ComponentAdminInvestasi_UIDetailFile
|
||||||
|
title={data.title}
|
||||||
|
dataProspektus={data.ProspektusInvestasi}
|
||||||
|
listDokumen={data.DokumenInvestasi}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Group position="apart" px={"md"}>
|
||||||
|
<ComponentAdminGlobal_BackButton
|
||||||
|
path={RouterAdminInvestasi.table_review}
|
||||||
|
/>
|
||||||
<Group>
|
<Group>
|
||||||
{" "}
|
|
||||||
<Center>
|
<Center>
|
||||||
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
{!publish || data.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"}
|
||||||
@@ -181,14 +232,14 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Center>
|
</Center>
|
||||||
{investasi.MasterStatusInvestasi.id === "3" ? (
|
{data.MasterStatusInvestasi.id === "3" ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={"red"}
|
bg={"red"}
|
||||||
color="red"
|
color="red"
|
||||||
onClick={toggle}
|
onClick={() => setOpenModal(true)}
|
||||||
rightIcon={<IconAlertHexagonFilled />}
|
rightIcon={<IconAlertHexagonFilled />}
|
||||||
>
|
>
|
||||||
Reject
|
Reject
|
||||||
@@ -205,14 +256,14 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
{/* Title */}
|
{/* Title */}
|
||||||
<Center my={"sm"}>
|
<Center my={"sm"}>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={4} mb={"xs"}>
|
||||||
{investasi.title}
|
{data.title}
|
||||||
</Title>
|
</Title>
|
||||||
</Center>
|
</Center>
|
||||||
<Paper withBorder mb={"md"} mah={300} maw={400} mx={"auto"} p={5}>
|
<Paper withBorder mb={"md"} mah={300} maw={400} mx={"auto"} p={5}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Image
|
<Image
|
||||||
alt=""
|
alt=""
|
||||||
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||||
/>
|
/>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</Paper>
|
</Paper>
|
||||||
@@ -229,7 +280,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
Rp.{" "}
|
Rp.{" "}
|
||||||
{new Intl.NumberFormat("id-ID", {
|
{new Intl.NumberFormat("id-ID", {
|
||||||
maximumFractionDigits: 10,
|
maximumFractionDigits: 10,
|
||||||
}).format(+investasi.targetDana)}
|
}).format(+data.targetDana)}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
@@ -238,16 +289,16 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
Rp.{" "}
|
Rp.{" "}
|
||||||
{new Intl.NumberFormat("id-ID", {
|
{new Intl.NumberFormat("id-ID", {
|
||||||
maximumFractionDigits: 10,
|
maximumFractionDigits: 10,
|
||||||
}).format(+investasi.hargaLembar)}{" "}
|
}).format(+data.hargaLembar)}{" "}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
<Text>{investasi.MasterPembagianDeviden.name} bulan </Text>
|
<Text>{data.MasterPembagianDeviden.name} bulan </Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pencarian Investor</Text>
|
<Text>Pencarian Investor</Text>
|
||||||
<Text>{investasi.MasterPencarianInvestor.name} hari </Text>
|
<Text>{data.MasterPencarianInvestor.name} hari </Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -255,7 +306,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>ROI</Text>
|
<Text>ROI</Text>
|
||||||
<Text>{investasi.roi} %</Text>
|
<Text>{data.roi} %</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
@@ -263,13 +314,13 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
{" "}
|
{" "}
|
||||||
{new Intl.NumberFormat("id-ID", {
|
{new Intl.NumberFormat("id-ID", {
|
||||||
maximumFractionDigits: 10,
|
maximumFractionDigits: 10,
|
||||||
}).format(+investasi.totalLembar)}{" "}
|
}).format(+data.totalLembar)}{" "}
|
||||||
lembar
|
lembar
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Pembagian Deviden</Text>
|
||||||
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
<Text>{data.MasterPeriodeDeviden.name}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -280,7 +331,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
{/* Note */}
|
{/* Note */}
|
||||||
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
{!publish || data.MasterStatusInvestasi.id === "4" ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
@@ -294,9 +345,9 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{publish &&
|
{publish &&
|
||||||
investasi.MasterStatusInvestasi.id === "3" &&
|
data.MasterStatusInvestasi.id === "3" &&
|
||||||
_.isEmpty(investasi.BeritaInvestasi) ? (
|
_.isEmpty(data.BeritaInvestasi) ? (
|
||||||
<BeritaInvestasi dataInvestasi={investasi} />
|
<BeritaInvestasi dataInvestasi={data} />
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
@@ -309,21 +360,21 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
{/* Prospektus */}
|
{/* Prospektus */}
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Title order={6}>Prospektus :</Title>
|
<Title order={6}>Prospektus :</Title>
|
||||||
{investasi.ProspektusInvestasi === null ? (
|
{data.ProspektusInvestasi === null ? (
|
||||||
<Text>Tidak ada file</Text>
|
<Text>Tidak ada file</Text>
|
||||||
) : (
|
) : (
|
||||||
<Paper p={"xs"}>
|
<Paper p={"xs"}>
|
||||||
<Group>
|
<Group>
|
||||||
<IconFileTypePdf />
|
<IconFileTypePdf />
|
||||||
<Text>Prospektus_{investasi.title}</Text>
|
<Text>Prospektus_{data.title}</Text>
|
||||||
<Link
|
<Link
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href={
|
href={
|
||||||
RouterInvestasi.api_file_prospektus +
|
RouterInvestasi.api_file_prospektus +
|
||||||
`${
|
`${
|
||||||
investasi.ProspektusInvestasi === null
|
data.ProspektusInvestasi === null
|
||||||
? ""
|
? ""
|
||||||
: investasi.ProspektusInvestasi.id
|
: data.ProspektusInvestasi.id
|
||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -339,10 +390,10 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
{/* Dokumen */}
|
{/* Dokumen */}
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Title order={6}>Dokumen :</Title>
|
<Title order={6}>Dokumen :</Title>
|
||||||
{_.isEmpty(investasi.DokumenInvestasi) ? (
|
{_.isEmpty(data.DokumenInvestasi) ? (
|
||||||
<Text>Tidak ada dokumen</Text>
|
<Text>Tidak ada dokumen</Text>
|
||||||
) : (
|
) : (
|
||||||
investasi.DokumenInvestasi.map((e) => (
|
data.DokumenInvestasi.map((e) => (
|
||||||
<Paper p={"xs"} key={e.id}>
|
<Paper p={"xs"} key={e.id}>
|
||||||
<Group>
|
<Group>
|
||||||
<IconFileTypePdf />
|
<IconFileTypePdf />
|
||||||
@@ -367,8 +418,8 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
centered
|
centered
|
||||||
opened={opened}
|
opened={openModal}
|
||||||
onClose={toggle}
|
onClose={() => setOpenModal(false)}
|
||||||
// withCloseButton={false}
|
// withCloseButton={false}
|
||||||
title="Masukan alasan penolakan"
|
title="Masukan alasan penolakan"
|
||||||
>
|
>
|
||||||
@@ -377,10 +428,10 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
autosize
|
autosize
|
||||||
minRows={2}
|
minRows={2}
|
||||||
maxRows={4}
|
maxRows={4}
|
||||||
value={investasi.catatan === null ? [] : investasi.catatan}
|
value={data.catatan === null ? [] : data.catatan}
|
||||||
onChange={(val) =>
|
onChange={(val) =>
|
||||||
setInvestasi({
|
setData({
|
||||||
...investasi,
|
...data,
|
||||||
catatan: val.target.value,
|
catatan: val.target.value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funEditStatusPublishById({
|
||||||
|
investasiId,
|
||||||
|
statusId,
|
||||||
|
progesInvestasiId,
|
||||||
|
}: {
|
||||||
|
investasiId: string;
|
||||||
|
statusId: string;
|
||||||
|
progesInvestasiId: string;
|
||||||
|
}) {
|
||||||
|
const publishTime = new Date();
|
||||||
|
const res = await prisma.investasi.update({
|
||||||
|
where: {
|
||||||
|
id: investasiId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
countDown: publishTime,
|
||||||
|
masterStatusInvestasiId: statusId,
|
||||||
|
masterProgresInvestasiId: progesInvestasiId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!res) return { status: 400, message: "Gagal Update" };
|
||||||
|
revalidatePath(RouterInvestasi.portofolio);
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
status: 200,
|
||||||
|
message: "Publish Berhasil",
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,26 +1,36 @@
|
|||||||
"use server"
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma"
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin"
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi"
|
import { revalidatePath } from "next/cache";
|
||||||
import { revalidatePath } from "next/cache"
|
|
||||||
|
|
||||||
export default async function Admin_funRejectInvestasi(data: any) {
|
export default async function Admin_funRejectInvestasi(data: any) {
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
|
|
||||||
const res = await prisma.investasi.update({
|
const res = await prisma.investasi.update({
|
||||||
where: { id: data.id },
|
where: { id: data.id },
|
||||||
data: {
|
data: {
|
||||||
masterStatusInvestasiId: data.status,
|
masterStatusInvestasiId: data.status,
|
||||||
catatan: data.catatan
|
catatan: data.catatan,
|
||||||
}
|
},
|
||||||
})
|
select: {
|
||||||
if(!res) return {status: 400, message: "Gagal reject"}
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!res) return { status: 400, message: "Gagal reject" };
|
||||||
|
|
||||||
revalidatePath(RouterAdminInvestasi_OLD.main_investasi)
|
revalidatePath(RouterAdminInvestasi.detail_review);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
data: res,
|
||||||
message: "Reject berhasil"
|
status: 200,
|
||||||
}
|
message: "Reject berhasil",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
71
src/app_modules/admin/investasi/fun/get/get_all_publish.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funGetAllPublish({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.investasi.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
countDown: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
masterStatusInvestasiId: "1",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
hargaLembar: true,
|
||||||
|
targetDana: true,
|
||||||
|
totalLembar: true,
|
||||||
|
roi: true,
|
||||||
|
active: true,
|
||||||
|
imagesId: true,
|
||||||
|
catatan: true,
|
||||||
|
MasterStatusInvestasi: true,
|
||||||
|
BeritaInvestasi: true,
|
||||||
|
DokumenInvestasi: true,
|
||||||
|
ProspektusInvestasi: true,
|
||||||
|
MasterPembagianDeviden: true,
|
||||||
|
MasterPencarianInvestor: true,
|
||||||
|
MasterPeriodeDeviden: true,
|
||||||
|
author: true,
|
||||||
|
progress: true,
|
||||||
|
sisaLembar: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.investasi.count({
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
masterStatusInvestasiId: "1",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
61
src/app_modules/admin/investasi/fun/get/get_all_reject.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funGetAllReject({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.investasi.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
masterStatusInvestasiId: "4",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
hargaLembar: true,
|
||||||
|
targetDana: true,
|
||||||
|
totalLembar: true,
|
||||||
|
roi: true,
|
||||||
|
active: true,
|
||||||
|
author: true,
|
||||||
|
catatan: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.investasi.count({
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
masterStatusInvestasiId: "4",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
60
src/app_modules/admin/investasi/fun/get/get_all_review.ts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funGetAllReview({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.investasi.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
masterStatusInvestasiId: "2",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
hargaLembar: true,
|
||||||
|
targetDana: true,
|
||||||
|
totalLembar: true,
|
||||||
|
roi: true,
|
||||||
|
active: true,
|
||||||
|
author: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.investasi.count({
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
masterStatusInvestasiId: "2",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import Admin_Investasi from "./main/view";
|
import Admin_Investasi from "./main/view";
|
||||||
import Admin_HalamanAksi from "./halaman_aksi/view";
|
import Admin_HalamanAksi from "./halaman_aksi/view";
|
||||||
import Admin_LayoutHalamanAksi from "./halaman_aksi/layout";
|
import Admin_LayoutHalamanAksi from "./halaman_aksi/layout";
|
||||||
import Admin_KonfirmasiInvestasi from "./konfirmasi/view";
|
import AdminInvestasi_DetailReview from "./detail/detail_review";
|
||||||
import Admin_LayoutKonfirmasiInvestasi from "./konfirmasi/layout";
|
import Admin_LayoutKonfirmasiInvestasi from "./konfirmasi/layout";
|
||||||
import Admin_BuktiTransferInvestasi from "./bukti_transfer/view";
|
import Admin_BuktiTransferInvestasi from "./bukti_transfer/view";
|
||||||
import Admin_LayoutBuktiTransferInvestasi from "./bukti_transfer/layout";
|
import Admin_LayoutBuktiTransferInvestasi from "./bukti_transfer/layout";
|
||||||
@@ -10,12 +10,15 @@ import Admin_LayoutStatusTransferInvesatasi from "./status_transfer/layout";
|
|||||||
import Admin_TableReviewInvestasi from "./main/table_review";
|
import Admin_TableReviewInvestasi from "./main/table_review";
|
||||||
import Admin_TablePublishInvestasi from "./main/table_publish";
|
import Admin_TablePublishInvestasi from "./main/table_publish";
|
||||||
import Admin_TableRejectInvestasi from "./main/table_reject";
|
import Admin_TableRejectInvestasi from "./main/table_reject";
|
||||||
|
import { AdminInvestasi_DetailPublish } from "./detail/detail_publish";
|
||||||
|
import { AdminInvestasi_DetailReject } from "./detail/detail_reject";
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Admin_Investasi,
|
Admin_Investasi,
|
||||||
Admin_HalamanAksi,
|
Admin_HalamanAksi,
|
||||||
Admin_LayoutHalamanAksi,
|
Admin_LayoutHalamanAksi,
|
||||||
Admin_KonfirmasiInvestasi,
|
AdminInvestasi_DetailReview as Admin_KonfirmasiInvestasi,
|
||||||
Admin_LayoutKonfirmasiInvestasi,
|
Admin_LayoutKonfirmasiInvestasi,
|
||||||
Admin_BuktiTransferInvestasi,
|
Admin_BuktiTransferInvestasi,
|
||||||
Admin_LayoutBuktiTransferInvestasi,
|
Admin_LayoutBuktiTransferInvestasi,
|
||||||
@@ -24,4 +27,6 @@ export {
|
|||||||
Admin_TablePublishInvestasi,
|
Admin_TablePublishInvestasi,
|
||||||
Admin_TableReviewInvestasi,
|
Admin_TableReviewInvestasi,
|
||||||
Admin_TableRejectInvestasi,
|
Admin_TableRejectInvestasi,
|
||||||
|
AdminInvestasi_DetailPublish,
|
||||||
|
AdminInvestasi_DetailReject,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ export default function Admin_LayoutKonfirmasiInvestasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell header={<ComponentGlobal_HeaderTamplate title="Konfimasi Investasi" />}>
|
<AppShell
|
||||||
|
header={<ComponentGlobal_HeaderTamplate title="Konfimasi Investasi" />}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppShell>
|
</AppShell>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -2,116 +2,189 @@
|
|||||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminInvestasi_OLD } 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 {
|
||||||
Badge,
|
Button,
|
||||||
ActionIcon,
|
|
||||||
Box,
|
|
||||||
ScrollArea,
|
|
||||||
Table,
|
|
||||||
Tooltip,
|
|
||||||
Stack,
|
|
||||||
Avatar,
|
|
||||||
Group,
|
|
||||||
Text,
|
|
||||||
Center,
|
Center,
|
||||||
|
Group,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
|
ScrollArea,
|
||||||
|
Stack,
|
||||||
|
Table,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconChevronLeft, IconEyeCheck } from "@tabler/icons-react";
|
import { IconSearch } from "@tabler/icons-react";
|
||||||
import { IconEdit, IconEye } 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";
|
||||||
|
import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate";
|
||||||
|
import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data";
|
||||||
|
import { adminInvestasi_funGetAllPublish } from "../fun/get/get_all_publish";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
|
||||||
export default function Admin_TablePublishInvestasi({
|
export default function Admin_TablePublishInvestasi({
|
||||||
dataInvestsi,
|
dataInvestsi,
|
||||||
}: {
|
}: {
|
||||||
dataInvestsi: MODEL_Investasi[];
|
dataInvestsi: MODEL_Investasi[];
|
||||||
}) {
|
}) {
|
||||||
const [investasi, setInvestasi] = useState(dataInvestsi);
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
// console.log(investasi);
|
|
||||||
|
|
||||||
const tableBody = investasi.map((e) =>
|
|
||||||
e.MasterStatusInvestasi.id === "3" ? (
|
|
||||||
<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>
|
|
||||||
<Center> {e.progress} %</Center>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<Center> {new Intl.NumberFormat("id-ID", {maximumFractionDigits: 10}).format(+e.sisaLembar)}</Center>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<Center> {new Intl.NumberFormat("id-ID", {maximumFractionDigits: 10}).format(+e.totalLembar)}</Center>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<Center>
|
|
||||||
<Tooltip label="Detail" withArrow position="bottom">
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() =>
|
|
||||||
router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<IconEyeCheck color="green" />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
</Center>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi_OLD.main_investasi)}>
|
<ComponentAdminGlobal_HeaderTamplate name="Investasi" />
|
||||||
|
<TableView listData={dataInvestsi} />
|
||||||
<IconChevronLeft />
|
{/* <pre>{JSON.stringify(listPublish, null, 2)}</pre> */}
|
||||||
</ActionIcon>
|
</Stack>
|
||||||
<Box>
|
</>
|
||||||
<ScrollArea w={"100%"}>
|
);
|
||||||
{/* <Title order={5} mb={5}>
|
}
|
||||||
List Publish
|
|
||||||
</Title> */}
|
function TableView({ listData }: { listData: any }) {
|
||||||
<Badge color="green" variant="light" radius={0} size={"xl"}>
|
const router = useRouter();
|
||||||
Publish
|
const [data, setData] = useState<MODEL_Investasi[]>(listData.data);
|
||||||
</Badge>
|
const [nPage, setNPage] = useState(listData.nPage);
|
||||||
<Table
|
const [activePage, setActivePage] = useState(1);
|
||||||
withBorder
|
const [isSearch, setSearch] = useState("");
|
||||||
highlightOnHover
|
|
||||||
verticalSpacing={"md"}
|
async function onSearch(s: string) {
|
||||||
horizontalSpacing={"md"}
|
setSearch(s);
|
||||||
>
|
setActivePage(1);
|
||||||
<thead>
|
const loadData = await adminInvestasi_funGetAllPublish({
|
||||||
<tr>
|
page: 1,
|
||||||
<th>Username</th>
|
search: s,
|
||||||
<th>Nama Proyek Investasi</th>
|
});
|
||||||
<th>
|
setData(loadData.data as any);
|
||||||
<Center>Progres</Center>
|
setNPage(loadData.nPage);
|
||||||
</th>
|
}
|
||||||
<th>
|
|
||||||
<Center>Sisa Saham</Center>
|
async function onPageClick(p: any) {
|
||||||
</th>
|
setActivePage(p);
|
||||||
<th>
|
const loadData = await adminInvestasi_funGetAllPublish({
|
||||||
<Center>Total Saham</Center>
|
search: isSearch,
|
||||||
</th>
|
page: p,
|
||||||
<th>
|
});
|
||||||
<Center>Aksi</Center>
|
setData(loadData.data as any);
|
||||||
</th>
|
setNPage(loadData.nPage);
|
||||||
</tr>
|
}
|
||||||
</thead>
|
|
||||||
<tbody>{tableBody}</tbody>
|
const tableBody = data.map((e) => (
|
||||||
</Table>
|
<tr key={e.id}>
|
||||||
</ScrollArea>
|
<td>
|
||||||
</Box>
|
<Center w={200}>
|
||||||
|
<Text lineClamp={1}>{e.author.username}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
|
<Text lineClamp={1}>{e.title}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>{_.toNumber(e.progress).toFixed(2)} %</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+e.sisaLembar)}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumFractionDigits: 10,
|
||||||
|
}).format(+e.totalLembar)}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Button
|
||||||
|
bg={"green"}
|
||||||
|
color="green"
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi.detail_publish +`${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Detail
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"green.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4} c={"black"}>
|
||||||
|
Publish
|
||||||
|
</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Cari nama proyek"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
{_.isEmpty(data) ? (
|
||||||
|
<ComponentAdminGlobal_IsEmptyData />
|
||||||
|
) : (
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={"100%"}
|
||||||
|
h={"100%"}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={400}>Nama Proyek</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Progres</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Sisa Saham</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Total Saham</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={activePage}
|
||||||
|
total={nPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,11 +13,21 @@ import {
|
|||||||
Avatar,
|
Avatar,
|
||||||
Group,
|
Group,
|
||||||
Text,
|
Text,
|
||||||
|
Button,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
|
TextInput,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconChevronLeft, IconEdit } from "@tabler/icons-react";
|
import { IconChevronLeft, IconEdit, IconSearch } from "@tabler/icons-react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate";
|
||||||
|
import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data";
|
||||||
|
import { adminInvestasi_funGetAllReview } from "../fun/get/get_all_review";
|
||||||
|
import { adminInvestasi_funGetAllReject } from "../fun/get/get_all_reject";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
|
||||||
export default function Admin_TableRejectInvestasi({
|
export default function Admin_TableRejectInvestasi({
|
||||||
dataInvestsi,
|
dataInvestsi,
|
||||||
@@ -27,6 +37,15 @@ export default function Admin_TableRejectInvestasi({
|
|||||||
const [investasi, setInvestasi] = useState(dataInvestsi);
|
const [investasi, setInvestasi] = useState(dataInvestsi);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
<ComponentAdminGlobal_HeaderTamplate name="Investasi" />
|
||||||
|
<TableView listData={dataInvestsi} />
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
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}>
|
||||||
@@ -61,8 +80,10 @@ export default function Admin_TableRejectInvestasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi_OLD.main_investasi)}>
|
<ActionIcon
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => router.push(RouterAdminInvestasi_OLD.main_investasi)}
|
||||||
|
>
|
||||||
<IconChevronLeft />
|
<IconChevronLeft />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Box>
|
<Box>
|
||||||
@@ -94,3 +115,136 @@ export default function Admin_TableRejectInvestasi({
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TableView({ listData }: { listData: any }) {
|
||||||
|
const router = useRouter();
|
||||||
|
const [data, setData] = useState<MODEL_Investasi[]>(listData.data);
|
||||||
|
const [nPage, setNPage] = useState(listData.nPage);
|
||||||
|
const [activePage, setActivePage] = useState(1);
|
||||||
|
const [isSearch, setSearch] = useState("");
|
||||||
|
|
||||||
|
async function onSearch(s: string) {
|
||||||
|
setSearch(s);
|
||||||
|
setActivePage(1);
|
||||||
|
const loadData = await adminInvestasi_funGetAllReject({
|
||||||
|
page: 1,
|
||||||
|
search: s,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminInvestasi_funGetAllReject({
|
||||||
|
search: isSearch,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableBody = data.map((e) => (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text lineClamp={1}>{e.author.username}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
|
<Text lineClamp={1}>{e.title}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
|
<Text lineClamp={1}>{e.catatan}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Button
|
||||||
|
color="orange"
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi.detail_reject + `${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Detail
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"red.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4} c={"black"}>
|
||||||
|
Reject
|
||||||
|
</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Cari nama proyek"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
{_.isEmpty(data) ? (
|
||||||
|
<ComponentAdminGlobal_IsEmptyData />
|
||||||
|
) : (
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={"100%"}
|
||||||
|
h={"100%"}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={400}>Nama Proyek</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={400}>Catatan Penolakan</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={activePage}
|
||||||
|
total={nPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminInvestasi_OLD } 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 {
|
||||||
@@ -13,85 +14,184 @@ import {
|
|||||||
Avatar,
|
Avatar,
|
||||||
Text,
|
Text,
|
||||||
Center,
|
Center,
|
||||||
|
Button,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
|
TextInput,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconChevronLeft, IconEdit } from "@tabler/icons-react";
|
import { IconChevronLeft, IconEdit, IconSearch } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate";
|
||||||
|
import { adminInvestasi_funGetAllReview } from "../fun/get/get_all_review";
|
||||||
|
import _ from "lodash";
|
||||||
|
import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data";
|
||||||
|
import ComponentAdminGlobal_TampilanRupiahDonasi from "../../component_global/tampilan_rupiah";
|
||||||
|
|
||||||
export default function Admin_TableReviewInvestasi({
|
export default function Admin_TableReviewInvestasi({
|
||||||
dataInvestsi,
|
dataInvestsi,
|
||||||
}: {
|
}: {
|
||||||
dataInvestsi: MODEL_Investasi[];
|
dataInvestsi: MODEL_Investasi[];
|
||||||
}) {
|
}) {
|
||||||
const [investasi, setInvestasi] = useState(dataInvestsi);
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const tableBody = investasi.map((e) =>
|
|
||||||
e.MasterStatusInvestasi.id === "2" ? (
|
|
||||||
<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>
|
|
||||||
<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">
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() =>
|
|
||||||
router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<IconEdit color="green" />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
</Center>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ActionIcon variant="outline" onClick={() => router.push(RouterAdminInvestasi_OLD.main_investasi)}>
|
<ComponentAdminGlobal_HeaderTamplate name="Investasi" />
|
||||||
<IconChevronLeft />
|
<TableView listData={dataInvestsi} />
|
||||||
</ActionIcon>
|
</Stack>
|
||||||
<Box>
|
</>
|
||||||
<ScrollArea w={"100%"}>
|
);
|
||||||
<Badge color="orange" variant="light" radius={0} size={"xl"}>
|
}
|
||||||
Review
|
|
||||||
</Badge>
|
function TableView({ listData }: { listData: any }) {
|
||||||
<Table withBorder highlightOnHover verticalSpacing={"md"} horizontalSpacing={"md"}>
|
const router = useRouter();
|
||||||
<thead>
|
const [data, setData] = useState<MODEL_Investasi[]>(listData.data);
|
||||||
<tr>
|
const [nPage, setNPage] = useState(listData.nPage);
|
||||||
<th>Username</th>
|
const [activePage, setActivePage] = useState(1);
|
||||||
<th>Nama Proyek Investasi</th>
|
const [isSearch, setSearch] = useState("");
|
||||||
<th><Center>File Prospektus</Center></th>
|
|
||||||
<th><Center>Aksi</Center></th>
|
async function onSearch(s: string) {
|
||||||
</tr>
|
setSearch(s);
|
||||||
</thead>
|
setActivePage(1);
|
||||||
<tbody>{tableBody}</tbody>
|
const loadData = await adminInvestasi_funGetAllReview({
|
||||||
</Table>
|
page: 1,
|
||||||
</ScrollArea>
|
search: s,
|
||||||
</Box>
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminInvestasi_funGetAllReview({
|
||||||
|
search: isSearch,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableBody = data.map((e) => (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text lineClamp={1}>{e.author.username}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
|
<Text lineClamp={1}>{e.title}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text lineClamp={1}>{e.roi} %</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<ComponentAdminGlobal_TampilanRupiahDonasi
|
||||||
|
nominal={_.toNumber(e.targetDana)}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<ComponentAdminGlobal_TampilanRupiahDonasi
|
||||||
|
nominal={_.toNumber(e.hargaLembar)}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Button
|
||||||
|
color="orange"
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Detail
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"orange.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4} c={"black"}>
|
||||||
|
Review
|
||||||
|
</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Cari nama proyek"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
{_.isEmpty(data) ? (
|
||||||
|
<ComponentAdminGlobal_IsEmptyData />
|
||||||
|
) : (
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={"100%"}
|
||||||
|
h={"100%"}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={400}>Nama Proyek</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>ROI</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Target Dana</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Harga Perlembar</Center>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th>
|
||||||
|
<Center w={200}>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={activePage}
|
||||||
|
total={nPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -61,12 +61,13 @@ export default function Admin_Investasi({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const listBox = [
|
const listBox = [
|
||||||
|
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: "Draft",
|
name: "Publish",
|
||||||
jumlah: countDraft,
|
jumlah: countPublish,
|
||||||
link: "",
|
link: RouterAdminInvestasi_OLD.table_status_publish,
|
||||||
color: "yellow",
|
color: "green",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
@@ -77,13 +78,6 @@ export default function Admin_Investasi({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: "Publish",
|
|
||||||
jumlah: countPublish,
|
|
||||||
link: RouterAdminInvestasi_OLD.table_status_publish,
|
|
||||||
color: "green",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "Reject",
|
name: "Reject",
|
||||||
jumlah: countReject,
|
jumlah: countReject,
|
||||||
link: RouterAdminInvestasi_OLD.table_status_reject,
|
link: RouterAdminInvestasi_OLD.table_status_reject,
|
||||||
@@ -97,7 +91,7 @@ export default function Admin_Investasi({
|
|||||||
<ComponentAdminGlobal_HeaderTamplate name="Investasi" />
|
<ComponentAdminGlobal_HeaderTamplate name="Investasi" />
|
||||||
|
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
cols={4}
|
cols={3}
|
||||||
spacing="lg"
|
spacing="lg"
|
||||||
breakpoints={[
|
breakpoints={[
|
||||||
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import adminNotifikasi_findRouterForum from "./notifikasi/route_setting/forum";
|
|||||||
import { adminNotifikasi_findRouterVoting } from "./notifikasi/route_setting/voting";
|
import { adminNotifikasi_findRouterVoting } from "./notifikasi/route_setting/voting";
|
||||||
import { adminNotifikasi_findRouterEvent } from "./notifikasi/route_setting/event";
|
import { adminNotifikasi_findRouterEvent } from "./notifikasi/route_setting/event";
|
||||||
import adminNotifikasi_findRouterDonasi from "./notifikasi/route_setting/donasi";
|
import adminNotifikasi_findRouterDonasi from "./notifikasi/route_setting/donasi";
|
||||||
|
import { ComponentAdmin_UIDrawerNotifikasi } from "./notifikasi/ui_drawer_notifikasi";
|
||||||
|
|
||||||
export default function AdminLayout({
|
export default function AdminLayout({
|
||||||
children,
|
children,
|
||||||
@@ -326,7 +327,7 @@ export default function AdminLayout({
|
|||||||
position="right"
|
position="right"
|
||||||
size={"xs"}
|
size={"xs"}
|
||||||
>
|
>
|
||||||
<DrawerNotifikasi
|
<ComponentAdmin_UIDrawerNotifikasi
|
||||||
data={dataNotif}
|
data={dataNotif}
|
||||||
onLoadReadNotif={(val: any) => {
|
onLoadReadNotif={(val: any) => {
|
||||||
setDataNotif(val);
|
setDataNotif(val);
|
||||||
@@ -345,194 +346,4 @@ export default function AdminLayout({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DrawerNotifikasi({
|
|
||||||
data,
|
|
||||||
onLoadReadNotif,
|
|
||||||
onChangeNavbar,
|
|
||||||
onToggleNavbar,
|
|
||||||
onLoadCountNotif,
|
|
||||||
}: {
|
|
||||||
data: MODEL_NOTIFIKASI[];
|
|
||||||
onLoadReadNotif: (val: any) => void;
|
|
||||||
onChangeNavbar: (val: any) => void;
|
|
||||||
onToggleNavbar: (val: any) => void;
|
|
||||||
onLoadCountNotif: (val: any) => void;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
if (_.isEmpty(data)) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Center>
|
|
||||||
<Text c={"gray"} fz={"xs"}>
|
|
||||||
Tidak ada notifikasi
|
|
||||||
</Text>
|
|
||||||
</Center>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Paper h={"100%"}>
|
|
||||||
<Stack>
|
|
||||||
{data.map((e, i) => (
|
|
||||||
<Card
|
|
||||||
style={{
|
|
||||||
transition: "0.5s",
|
|
||||||
}}
|
|
||||||
key={e?.id}
|
|
||||||
// withBorder
|
|
||||||
bg={e?.isRead ? "gray.1" : "gray.4"}
|
|
||||||
sx={{
|
|
||||||
borderColor: "gray",
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderWidth: "0.5px",
|
|
||||||
":hover": {
|
|
||||||
backgroundColor: "#C1C2C5",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onClick={async () => {
|
|
||||||
// JOB
|
|
||||||
e?.kategoriApp === "JOB" &&
|
|
||||||
adminNotifikasi_findRouterJob({
|
|
||||||
data: e,
|
|
||||||
router: router,
|
|
||||||
onChangeNavbar: (val: any) => {
|
|
||||||
onChangeNavbar(val);
|
|
||||||
},
|
|
||||||
onToggleNavbar: onToggleNavbar,
|
|
||||||
});
|
|
||||||
|
|
||||||
// FORUM
|
|
||||||
e?.kategoriApp === "FORUM" &&
|
|
||||||
adminNotifikasi_findRouterForum({
|
|
||||||
data: e,
|
|
||||||
router: router,
|
|
||||||
onChangeNavbar(val) {
|
|
||||||
onChangeNavbar(val);
|
|
||||||
},
|
|
||||||
onToggleNavbar(val) {
|
|
||||||
onToggleNavbar(val);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// VOTE
|
|
||||||
e?.kategoriApp === "VOTING" &&
|
|
||||||
adminNotifikasi_findRouterVoting({
|
|
||||||
data: e,
|
|
||||||
router: router,
|
|
||||||
onChangeNavbar(val) {
|
|
||||||
onChangeNavbar(val);
|
|
||||||
},
|
|
||||||
onToggleNavbar(val) {
|
|
||||||
onToggleNavbar(val);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
e?.kategoriApp === "EVENT" &&
|
|
||||||
adminNotifikasi_findRouterEvent({
|
|
||||||
data: e,
|
|
||||||
router: router,
|
|
||||||
onChangeNavbar(val) {
|
|
||||||
onChangeNavbar(val);
|
|
||||||
},
|
|
||||||
onToggleNavbar(val) {
|
|
||||||
onToggleNavbar(val);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
e.kategoriApp === "DONASI" && adminNotifikasi_findRouterDonasi({
|
|
||||||
data: e,
|
|
||||||
router: router,
|
|
||||||
onChangeNavbar(val) {
|
|
||||||
onChangeNavbar(val);
|
|
||||||
},
|
|
||||||
onToggleNavbar(val) {
|
|
||||||
onToggleNavbar(val);
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const updateIsRead = await adminNotifikasi_funUpdateIsReadById({
|
|
||||||
notifId: e?.id,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (updateIsRead) {
|
|
||||||
const loadCountNotif =
|
|
||||||
await adminNotifikasi_countNotifikasi();
|
|
||||||
onLoadCountNotif(loadCountNotif);
|
|
||||||
|
|
||||||
const loadDataNotif = await adminNotifikasi_getByUserId();
|
|
||||||
onLoadReadNotif(loadDataNotif);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// callBackIsNotifikasi(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Card.Section p={"sm"}>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Group position="apart">
|
|
||||||
<Text fw={"bold"} fz={10}>
|
|
||||||
# {e?.kategoriApp}
|
|
||||||
</Text>
|
|
||||||
{e?.status ? (
|
|
||||||
<Badge fz={10} size="sm">
|
|
||||||
{e?.status}
|
|
||||||
</Badge>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Group>
|
|
||||||
<Divider color="gray.3" />
|
|
||||||
</Stack>
|
|
||||||
</Card.Section>
|
|
||||||
<Card.Section px={"sm"} pb={"sm"}>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text lineClamp={2} fw={"bold"} fz={"xs"}>
|
|
||||||
{e?.title}
|
|
||||||
</Text>
|
|
||||||
<Text lineClamp={2} fz={"xs"}>
|
|
||||||
{e?.pesan}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Card.Section>
|
|
||||||
<Card.Section p={"sm"}>
|
|
||||||
<Group position="apart">
|
|
||||||
<Text fz={10} color="gray">
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
dateStyle: "long",
|
|
||||||
}).format(e?.createdAt)}
|
|
||||||
|
|
||||||
<Text span inherit fz={10} color="gray">
|
|
||||||
{", "}
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
timeStyle: "short",
|
|
||||||
}).format(e?.createdAt)}
|
|
||||||
</Text>
|
|
||||||
</Text>
|
|
||||||
{e?.isRead ? (
|
|
||||||
<Group spacing={5}>
|
|
||||||
<IconChecks color="gray" size={10} />
|
|
||||||
<Text fz={10} color="gray">
|
|
||||||
Sudah dilihat
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
) : (
|
|
||||||
<Group spacing={5}>
|
|
||||||
<IconCheck color="gray" size={10} />
|
|
||||||
<Text fz={10} color="gray">
|
|
||||||
Belum dilihat
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
)}
|
|
||||||
</Group>
|
|
||||||
</Card.Section>
|
|
||||||
</Card>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
// test notif
|
|
||||||
|
|
||||||
43
src/app_modules/admin/notifikasi/route_setting/investasi.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||||
|
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||||
|
|
||||||
|
export default async function adminNotifikasi_findRouterInvestasi({
|
||||||
|
data,
|
||||||
|
router,
|
||||||
|
onChangeNavbar,
|
||||||
|
onToggleNavbar,
|
||||||
|
}: {
|
||||||
|
data: MODEL_NOTIFIKASI;
|
||||||
|
router: AppRouterInstance;
|
||||||
|
onChangeNavbar: (val: any) => void;
|
||||||
|
onToggleNavbar: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
if (data.status === "Review") {
|
||||||
|
const path = RouterAdminInvestasi.table_review;
|
||||||
|
router.push(path);
|
||||||
|
onChangeNavbar({
|
||||||
|
id: 2,
|
||||||
|
childId: 23,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (
|
||||||
|
// data.status === "Menunggu" ||
|
||||||
|
// data.status === "Berhasil" ||
|
||||||
|
// data.status === "Proses" ||
|
||||||
|
// data.status === "Gagal"
|
||||||
|
// ) {
|
||||||
|
// const path = RouterAdminDonasi_OLD.detail_publish + data.appId;
|
||||||
|
// router.push(path, { scroll: false });
|
||||||
|
// onChangeNavbar({
|
||||||
|
// id: 3,
|
||||||
|
// childId: 32,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
onToggleNavbar(true);
|
||||||
|
}
|
||||||
231
src/app_modules/admin/notifikasi/ui_drawer_notifikasi.tsx
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||||
|
import {
|
||||||
|
Center,
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Card,
|
||||||
|
Group,
|
||||||
|
Badge,
|
||||||
|
Divider,
|
||||||
|
Text,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { IconChecks, IconCheck } from "@tabler/icons-react";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import adminNotifikasi_countNotifikasi from "./fun/count/count_is_read";
|
||||||
|
import adminNotifikasi_getByUserId from "./fun/get/get_notifikasi_by_user_id";
|
||||||
|
import adminNotifikasi_funUpdateIsReadById from "./fun/update/fun_update_is_read_by_id";
|
||||||
|
import adminNotifikasi_findRouterDonasi from "./route_setting/donasi";
|
||||||
|
import { adminNotifikasi_findRouterEvent } from "./route_setting/event";
|
||||||
|
import adminNotifikasi_findRouterForum from "./route_setting/forum";
|
||||||
|
import adminNotifikasi_findRouterJob from "./route_setting/job";
|
||||||
|
import { adminNotifikasi_findRouterVoting } from "./route_setting/voting";
|
||||||
|
import adminNotifikasi_findRouterInvestasi from "./route_setting/investasi";
|
||||||
|
|
||||||
|
export function ComponentAdmin_UIDrawerNotifikasi({
|
||||||
|
data,
|
||||||
|
onLoadReadNotif,
|
||||||
|
onChangeNavbar,
|
||||||
|
onToggleNavbar,
|
||||||
|
onLoadCountNotif,
|
||||||
|
}: {
|
||||||
|
data: MODEL_NOTIFIKASI[];
|
||||||
|
onLoadReadNotif: (val: any) => void;
|
||||||
|
onChangeNavbar: (val: any) => void;
|
||||||
|
onToggleNavbar: (val: any) => void;
|
||||||
|
onLoadCountNotif: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
if (_.isEmpty(data)) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Center>
|
||||||
|
<Text c={"gray"} fz={"xs"}>
|
||||||
|
Tidak ada notifikasi
|
||||||
|
</Text>
|
||||||
|
</Center>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper h={"100%"}>
|
||||||
|
<Stack>
|
||||||
|
{data.map((e, i) => (
|
||||||
|
<Card
|
||||||
|
style={{
|
||||||
|
transition: "0.5s",
|
||||||
|
}}
|
||||||
|
key={e?.id}
|
||||||
|
// withBorder
|
||||||
|
bg={e?.isRead ? "gray.1" : "gray.4"}
|
||||||
|
sx={{
|
||||||
|
borderColor: "gray",
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderWidth: "0.5px",
|
||||||
|
":hover": {
|
||||||
|
backgroundColor: "#C1C2C5",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
onClick={async () => {
|
||||||
|
// JOB
|
||||||
|
e?.kategoriApp === "JOB" &&
|
||||||
|
adminNotifikasi_findRouterJob({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar: (val: any) => {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar: onToggleNavbar,
|
||||||
|
});
|
||||||
|
|
||||||
|
// FORUM
|
||||||
|
e?.kategoriApp === "FORUM" &&
|
||||||
|
adminNotifikasi_findRouterForum({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// VOTE
|
||||||
|
e?.kategoriApp === "VOTING" &&
|
||||||
|
adminNotifikasi_findRouterVoting({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// EVENT
|
||||||
|
e?.kategoriApp === "EVENT" &&
|
||||||
|
adminNotifikasi_findRouterEvent({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// DONASI
|
||||||
|
e.kategoriApp === "DONASI" &&
|
||||||
|
adminNotifikasi_findRouterDonasi({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// INVESTASI
|
||||||
|
e.kategoriApp === "INVESTASI" &&
|
||||||
|
adminNotifikasi_findRouterInvestasi({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateIsRead = await adminNotifikasi_funUpdateIsReadById({
|
||||||
|
notifId: e?.id,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (updateIsRead) {
|
||||||
|
const loadCountNotif =
|
||||||
|
await adminNotifikasi_countNotifikasi();
|
||||||
|
onLoadCountNotif(loadCountNotif);
|
||||||
|
|
||||||
|
const loadDataNotif = await adminNotifikasi_getByUserId();
|
||||||
|
onLoadReadNotif(loadDataNotif);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// callBackIsNotifikasi(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Card.Section p={"sm"}>
|
||||||
|
<Stack spacing={"xs"}>
|
||||||
|
<Group position="apart">
|
||||||
|
<Text fw={"bold"} fz={10}>
|
||||||
|
# {e?.kategoriApp}
|
||||||
|
</Text>
|
||||||
|
{e?.status ? (
|
||||||
|
<Badge fz={10} size="sm">
|
||||||
|
{e?.status}
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</Group>
|
||||||
|
<Divider color="gray.3" />
|
||||||
|
</Stack>
|
||||||
|
</Card.Section>
|
||||||
|
<Card.Section px={"sm"} pb={"sm"}>
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text lineClamp={2} fw={"bold"} fz={"xs"}>
|
||||||
|
{e?.title}
|
||||||
|
</Text>
|
||||||
|
<Text lineClamp={2} fz={"xs"}>
|
||||||
|
{e?.pesan}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Card.Section>
|
||||||
|
<Card.Section p={"sm"}>
|
||||||
|
<Group position="apart">
|
||||||
|
<Text fz={10} color="gray">
|
||||||
|
{new Intl.DateTimeFormat("id-ID", {
|
||||||
|
dateStyle: "long",
|
||||||
|
}).format(e?.createdAt)}
|
||||||
|
|
||||||
|
<Text span inherit fz={10} color="gray">
|
||||||
|
{", "}
|
||||||
|
{new Intl.DateTimeFormat("id-ID", {
|
||||||
|
timeStyle: "short",
|
||||||
|
}).format(e?.createdAt)}
|
||||||
|
</Text>
|
||||||
|
</Text>
|
||||||
|
{e?.isRead ? (
|
||||||
|
<Group spacing={5}>
|
||||||
|
<IconChecks color="gray" size={10} />
|
||||||
|
<Text fz={10} color="gray">
|
||||||
|
Sudah dilihat
|
||||||
|
</Text>
|
||||||
|
</Group>
|
||||||
|
) : (
|
||||||
|
<Group spacing={5}>
|
||||||
|
<IconCheck color="gray" size={10} />
|
||||||
|
<Text fz={10} color="gray">
|
||||||
|
Belum dilihat
|
||||||
|
</Text>
|
||||||
|
</Group>
|
||||||
|
)}
|
||||||
|
</Group>
|
||||||
|
</Card.Section>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ export async function auth_funLogin(nomor: string) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`https://wa.wibudev.com/code?nom=${nomor}&text=Masukan Kode OTP:${codeOtp}`
|
`https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Masukan kode OTP sesuai dengan nomor yang anda daftarkan, kode ini bersifat rahasia & jangan di bagikan pada siapapun termasuk anggota ataupun pengurus HIPMI lainnya. Kode OTP anda: ${codeOtp}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const sendWa = await res.json();
|
const sendWa = await res.json();
|
||||||
|
|||||||
@@ -2,7 +2,14 @@
|
|||||||
|
|
||||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
|
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
|
||||||
import { BackgroundImage, Center, Image, Paper, Stack } from "@mantine/core";
|
import {
|
||||||
|
Avatar,
|
||||||
|
BackgroundImage,
|
||||||
|
Center,
|
||||||
|
Image,
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
@@ -31,14 +38,9 @@ export default function SplashScreen({ data }: { data: any }) {
|
|||||||
<Center h={"100vh"}>
|
<Center h={"100vh"}>
|
||||||
<Stack align="center" justify="center" p={"md"}>
|
<Stack align="center" justify="center" p={"md"}>
|
||||||
{/* <Title c={"#002e59"}>Welcome to</Title> */}
|
{/* <Title c={"#002e59"}>Welcome to</Title> */}
|
||||||
<Paper
|
<Avatar size={300} radius={"100%"} >
|
||||||
p={{ base: 20, md: 30, lg: 40 }}
|
<Image height={250} width={250} alt="Logo" src={"/aset/logo/logo-hipmi.png"} />
|
||||||
bg={"gray.1"}
|
</Avatar>
|
||||||
radius={"100%"}
|
|
||||||
shadow="xl"
|
|
||||||
>
|
|
||||||
<Image height={200} alt="" src={"/aset/logo/logo-hipmi.png"} />
|
|
||||||
</Paper>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Center>
|
</Center>
|
||||||
</BackgroundImage>
|
</BackgroundImage>
|
||||||
|
|||||||
@@ -8,17 +8,8 @@ import {
|
|||||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
|
import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
|
||||||
import { gs_investasiFooter } from "@/app_modules/investasi/g_state";
|
import { gs_investas_menu } from "@/app_modules/investasi/g_state";
|
||||||
import {
|
import { Grid, Image, Paper, Stack, Text, Title } from "@mantine/core";
|
||||||
AspectRatio,
|
|
||||||
Grid,
|
|
||||||
Image,
|
|
||||||
Loader,
|
|
||||||
Paper,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconChevronRight } from "@tabler/icons-react";
|
import { IconChevronRight } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@@ -26,7 +17,7 @@ import { useState } from "react";
|
|||||||
|
|
||||||
export default function MainCrowd() {
|
export default function MainCrowd() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [changeColor, setChangeColor] = useAtom(gs_investasiFooter);
|
const [changeColor, setChangeColor] = useAtom(gs_investas_menu);
|
||||||
const [donasiHotMenu, setDonasiHotMenu] = useAtom(gs_donasi_hot_menu);
|
const [donasiHotMenu, setDonasiHotMenu] = useAtom(gs_donasi_hot_menu);
|
||||||
const [loadingInv, setLoadingInv] = useState(false);
|
const [loadingInv, setLoadingInv] = useState(false);
|
||||||
const [loadingDon, setLoadingDon] = useState(false);
|
const [loadingDon, setLoadingDon] = useState(false);
|
||||||
@@ -60,17 +51,17 @@ export default function MainCrowd() {
|
|||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
borderRadius: "10px",
|
borderRadius: "10px",
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
// color: "white",
|
color: "white",
|
||||||
color: "gray",
|
// color: "gray",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// setLoadingInv(true);
|
setLoadingInv(true);
|
||||||
// router.push(RouterCrowd.investasi);
|
router.push(RouterCrowd.investasi);
|
||||||
// setChangeColor(0);
|
setChangeColor(0);
|
||||||
ComponentGlobal_NotifikasiPeringatan(
|
// ComponentGlobal_NotifikasiPeringatan(
|
||||||
"Sedang Perbaikan",
|
// "Sedang Perbaikan",
|
||||||
3000
|
// 3000
|
||||||
);
|
// );
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
|
import { Box, Center } from "@mantine/core";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
|
import { ScrollOnly } from "next-scroll-loader";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { donasi_funGetListPencairanDanaById } from "../../fun/get/get_list_pencairan_dana_by_id";
|
||||||
|
import { MODEL_DONASI_PENCAIRAN_DANA } from "../../model/interface";
|
||||||
|
import { ComponentDonasi_CardDonatur } from "./ui_card_donatur";
|
||||||
|
import { ComponentDonasi_CardPencairanDana } from "./card_pencairan_dana";
|
||||||
|
|
||||||
|
export function ComponentDonasi_InformasiPencairanDana({
|
||||||
|
donasiId,
|
||||||
|
listPD,
|
||||||
|
}: {
|
||||||
|
donasiId: string;
|
||||||
|
listPD: MODEL_DONASI_PENCAIRAN_DANA[];
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
const [data, setData] = useState(listPD);
|
||||||
|
const [activePage, setActivePage] = useState(1);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{_.isEmpty(listPD) ? (
|
||||||
|
<ComponentGlobal_IsEmptyData height={20} />
|
||||||
|
) : (
|
||||||
|
<Box>
|
||||||
|
<ScrollOnly
|
||||||
|
height="62vh"
|
||||||
|
renderLoading={() => (
|
||||||
|
<Center>
|
||||||
|
<ComponentGlobal_Loader size={25} />
|
||||||
|
</Center>
|
||||||
|
)}
|
||||||
|
data={data}
|
||||||
|
setData={setData}
|
||||||
|
moreData={async () => {
|
||||||
|
const loadData = await donasi_funGetListPencairanDanaById({
|
||||||
|
page: activePage + 1,
|
||||||
|
donasiId: donasiId,
|
||||||
|
});
|
||||||
|
|
||||||
|
setActivePage((val) => val + 1);
|
||||||
|
|
||||||
|
return loadData;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{(item) => <ComponentDonasi_CardPencairanDana data={item} />}
|
||||||
|
</ScrollOnly>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||