3
.env
@@ -1,4 +1,5 @@
|
||||
DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public"
|
||||
PWD="QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb"
|
||||
Client_KEY="SB-Mid-client-9NDTxltqdZrEB9m-"
|
||||
Server_KEY="SB-Mid-server-NyltU-U7fLVQd1nv1LWBKylr"
|
||||
Server_KEY="SB-Mid-server-NyltU-U7fLVQd1nv1LWBKylr"
|
||||
MAPBOX_TOKEN="pk.eyJ1IjoibWFsaWtrdXJvc2FraSIsImEiOiJjbHppZHh2enYwZnQ3MmlyMWc2Y2RlMzZoIn0.XssvJvq_iniclf8UhvXaIg"
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"@tiptap/react": "^2.2.3",
|
||||
"@tiptap/starter-kit": "^2.2.3",
|
||||
"@types/lodash": "^4.17.4",
|
||||
"@types/mapbox-gl": "^3.4.0",
|
||||
"@types/node": "20.4.5",
|
||||
"@types/react": "18.2.17",
|
||||
"@types/react-dom": "18.2.7",
|
||||
@@ -51,6 +52,7 @@
|
||||
"iron-session": "^6.3.1",
|
||||
"jotai": "^2.4.3",
|
||||
"lodash": "^4.17.21",
|
||||
"mapbox-gl": "^3.5.2",
|
||||
"midtrans-client": "^1.3.1",
|
||||
"moment": "^2.29.4",
|
||||
"mqtt": "^5.5.0",
|
||||
@@ -66,6 +68,7 @@
|
||||
"react-icons": "^5.0.1",
|
||||
"react-infinite-scroll-component": "^6.1.0",
|
||||
"react-international-phone": "^4.2.6",
|
||||
"react-map-gl": "^7.1.7",
|
||||
"react-quill": "^2.0.0",
|
||||
"react-responsive-carousel": "^3.2.23",
|
||||
"react-simple-toasts": "^5.10.0",
|
||||
|
||||
@@ -45,6 +45,7 @@ model User {
|
||||
UserProjectCollaboration_Notifikasi ProjectCollaboration_Notifikasi[] @relation("UserNotifProjectToUser")
|
||||
Admin_Notifikasi Notifikasi[] @relation("AdminNotifikasi")
|
||||
User_Notifikasi Notifikasi[] @relation("UserNotifikasi")
|
||||
BusinessMaps BusinessMaps[]
|
||||
}
|
||||
|
||||
model MasterUserRole {
|
||||
@@ -865,9 +866,20 @@ model Notifikasi {
|
||||
Role MasterUserRole? @relation(fields: [userRoleId], references: [id])
|
||||
userRoleId String
|
||||
|
||||
User User? @relation("UserNotifikasi", fields: [userId], references: [id], map: "NotifikasiUser")
|
||||
User User? @relation("UserNotifikasi", fields: [userId], references: [id], map: "NotifikasiUser")
|
||||
userId String?
|
||||
Admin User? @relation("AdminNotifikasi", fields: [adminId], references: [id], map: "NotifikasiAdmin")
|
||||
adminId String?
|
||||
|
||||
}
|
||||
|
||||
model BusinessMaps {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
namePin String
|
||||
latitude Float
|
||||
longitude Float
|
||||
Author User? @relation(fields: [authorId], references: [id])
|
||||
authorId String?
|
||||
}
|
||||
|
||||
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/donasi/pencairan/ba62da22-8973-4789-88a3-b20acd726dc9.jpg
Normal file
|
After Width: | Height: | Size: 6.1 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 |
BIN
public/profile/foto/02fd0df2-337e-474f-972f-cd3748ac19a7.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
public/profile/foto/f29acfca-8c7d-4613-9c4c-51eba880a979.jpg
Normal file
|
After Width: | Height: | Size: 6.7 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 getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataInvestasi = await getOneInvestasiById(params.id)
|
||||
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any)
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any);
|
||||
// console.log(dataUser)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} dataUser={dataUser as any} />
|
||||
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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() {
|
||||
const listInvestasi = await Admin_funGetAllInvestasi();
|
||||
const listInvestasi = await adminInvestasi_funGetAllPublish({page: 1});
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
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() {
|
||||
const dataInvestsi = await Admin_funGetAllInvestasi()
|
||||
return <>
|
||||
<Admin_TableRejectInvestasi dataInvestsi={dataInvestsi as any}/>
|
||||
|
||||
const dataInvestsi = await adminInvestasi_funGetAllReject({page: 1});
|
||||
return (
|
||||
<>
|
||||
<Admin_TableRejectInvestasi dataInvestsi={dataInvestsi as any} />
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
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() {
|
||||
const dataInvestsi = await Admin_funGetAllInvestasi()
|
||||
return <>
|
||||
<Admin_TableReviewInvestasi dataInvestsi={dataInvestsi as any}/>
|
||||
const dataInvestsi = await adminInvestasi_funGetAllReview({ page: 1 });
|
||||
return (
|
||||
<>
|
||||
<Admin_TableReviewInvestasi dataInvestsi={dataInvestsi as any} />
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
11
src/app/dev/donasi/bukti-transfer/[id]/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { LayoutDonasi_BuktiTransfer } from "@/app_modules/donasi";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let imageId = params.id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<LayoutDonasi_BuktiTransfer imageId={imageId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -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,12 +1,16 @@
|
||||
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 } }) {
|
||||
const listDonatur = await Donasi_getListDonatur(params.id);
|
||||
const donasiId = params.id;
|
||||
const listDonatur = await donasi_funGetListDonaturById({
|
||||
page: 1,
|
||||
donasiId: donasiId,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<DonaturDonasi listDonatur={listDonatur as any} />
|
||||
<DonaturDonasi listDonatur={listDonatur as any} donasiId={donasiId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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}}) {
|
||||
const donasiId = params.id
|
||||
const listKabar = await Donasi_getListKabar(donasiId)
|
||||
const listKabar = await donasi_funGetListKabarById({ page: 1, donasiId : donasiId});
|
||||
|
||||
return (
|
||||
<>
|
||||
<KabarDonasi listKabar={listKabar as any} />
|
||||
<KabarDonasi listKabar={listKabar as any} donasiId={donasiId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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}}) {
|
||||
const donasiId = params.id
|
||||
const listKabar = await Donasi_getListKabar(donasiId)
|
||||
const listKabar = await donasi_funGetListKabarById({page: 1, donasiId : donasiId});
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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() {
|
||||
const listDonasi = await Donasi_getListBeranda()
|
||||
// console.log(listDonasi)
|
||||
return <MainDonasi listDonasi={listDonasi as any}/>
|
||||
}
|
||||
const listDonasi = await donasi_funGetAllPublish({ page: 1 });
|
||||
// console.log(listDonasi)
|
||||
return <MainDonasi listDonasi={listDonasi as any} />;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { DonasiSayaDonasi } from "@/app_modules/donasi";
|
||||
import { Donasi_getInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_list_invoice_by_author_id";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { donasi_funGetAllInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_all_invoice_by_author_id";
|
||||
|
||||
export default async function Page() {
|
||||
const authorId = await user_getOneUserId();
|
||||
const listInvoice = await Donasi_getInvoiceByAuthorId(authorId);
|
||||
const listInvoice = await donasi_funGetAllInvoiceByAuthorId({ page: 1 });
|
||||
|
||||
return <DonasiSayaDonasi listInvoice={listInvoice as any} />;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { PostingDonasi } from "@/app_modules/donasi";
|
||||
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";
|
||||
|
||||
export default async function Page() {
|
||||
const authorId = await user_getOneUserId();
|
||||
const listPublish = await Donasi_getByStatus(authorId, "1")
|
||||
const listReview = await Donasi_getByStatus(authorId, "2");
|
||||
const listDraft = await Donasi_getByStatus(authorId, "3");
|
||||
const listReject = await Donasi_getByStatus(authorId, "4")
|
||||
const listPublish = await donasi_funGetAllStatusPublish({page: 1});
|
||||
const listReview = await donasi_funGetAllStatusReview({page: 1});
|
||||
const listDraft = await donasi_funGetAllStatusDraft({page: 1});
|
||||
const listReject = await donasi_funGetAllStatusReject({page: 1});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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,21 +1,16 @@
|
||||
import { PencairanDanaDonasi } from "@/app_modules/donasi";
|
||||
import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
|
||||
import { Donasi_getListPencairanDanaById } from "@/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id";
|
||||
import { donasi_funGetListPencairanDanaById } 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 { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { Loader } from "@mantine/core";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let donasiId = params.id;
|
||||
const totalAkumulasi = await Donasi_getTotalPencairanDanaById(donasiId);
|
||||
const listPencairan = await Donasi_getListPencairanDanaById(donasiId);
|
||||
|
||||
|
||||
// if (authorId != totalAkumulasi?.authorId) return <><NotifPeringatan /></>
|
||||
const listPencairan = await donasi_funGetListPencairanDanaById({page: 1, donasiId: donasiId});
|
||||
|
||||
return (
|
||||
<>
|
||||
<PencairanDanaDonasi
|
||||
donasiId={donasiId}
|
||||
totalAkumulasi={totalAkumulasi as any}
|
||||
listPencairan={listPencairan 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,16 +1,16 @@
|
||||
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_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_funGetAllStatusPublish } from "@/app_modules/event/fun/get/status/get_all_status_publish";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const authorId = await user_getOneUserId();
|
||||
const listPublish = await Event_getListByStatusId("1", authorId);
|
||||
const listReview = await event_getAllReview({page: 1});
|
||||
const listPublish = await event_funGetAllStatusPublish({ page: 1 });
|
||||
const listReview = await event_getAllReview({ page: 1 });
|
||||
const listDraft = await event_getAllDraft({ page: 1 });
|
||||
const listReject = await event_getAllReject({page: 1});
|
||||
const listReject = await event_getAllReject({ page: 1 });
|
||||
|
||||
return (
|
||||
<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)
|
||||
|
||||
return<>
|
||||
<DetailDraftInvestasi dataInvestasi={dataInvestasi}/>
|
||||
<DetailDraftInvestasi dataInvestasi={dataInvestasi as any}/>
|
||||
|
||||
</>
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import { DetailPublishInvestasi } from "@/app_modules/investasi";
|
||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
|
||||
const dataInvestasi = await getOneInvestasiById(params.id)
|
||||
return<>
|
||||
<DetailPublishInvestasi dataInvestasi={dataInvestasi as any}/>
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
return (
|
||||
<>
|
||||
<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 funUpadteProgresPersenInvestasi from "@/app_modules/investasi/fun/fun_update_progres_persen";
|
||||
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";
|
||||
import { investasi_funGetAllPublish } from "@/app_modules/investasi/fun/get_all_investasi";
|
||||
|
||||
export default async function Page() {
|
||||
const dataOnProgres = await getListAllPublish("1");
|
||||
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)
|
||||
|
||||
|
||||
const allData = await investasi_funGetAllPublish();
|
||||
|
||||
return (
|
||||
<>
|
||||
<MainInvestasi
|
||||
listData={allData as any}
|
||||
dataSelesai={dataSelesai as any}
|
||||
dataWaktuHabis={dataWaktuHabis as any}
|
||||
/>
|
||||
<MainInvestasi listData={allData as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export default async function Page() {
|
||||
})
|
||||
);
|
||||
const listTransaksi = await getListTransaksiBerhasilInvestasi(user.id)
|
||||
// console.log(listTransaksi)
|
||||
|
||||
return (
|
||||
<>
|
||||
<InvestasiSahamTerbeli listTransaksi={listTransaksi as any} />
|
||||
|
||||
@@ -3,10 +3,15 @@ import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: {id: string}
|
||||
}) {
|
||||
const investasiId = params.id;
|
||||
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/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
9
src/app/dev/map/create/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Map_CreateNewPin } from "@/app_modules/map/view";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Map_CreateNewPin />
|
||||
</>
|
||||
);
|
||||
}
|
||||
14
src/app/dev/map/main/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { Map_View } from "@/app_modules/map/view";
|
||||
|
||||
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
||||
export default async function Page() {
|
||||
if (!mapboxToken)
|
||||
return <ComponentGlobal_IsEmptyData text="Mapbox token not found" />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Map_View mapboxToken={mapboxToken} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
10
src/app/dev/map/splash/page.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Map_Splash } from "@/app_modules/map/view";
|
||||
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Map_Splash />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
useEmotionCache,
|
||||
} from "@mantine/core";
|
||||
import { Notifications } from "@mantine/notifications";
|
||||
import { Provider } from "jotai";
|
||||
import { useServerInsertedHTML } from "next/navigation";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
|
||||
@@ -39,25 +40,7 @@ export default function RootStyleRegistry({
|
||||
<CacheProvider value={cache}>
|
||||
<MantineProvider withGlobalStyles withNormalizeCSS>
|
||||
<Notifications position="top-center" containerWidth={300} />
|
||||
{children}
|
||||
{/* <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> */}
|
||||
<Provider>{children}</Provider>
|
||||
</MantineProvider>
|
||||
</CacheProvider>
|
||||
</body>
|
||||
|
||||
@@ -3,4 +3,9 @@ export const RouterAdminInvestasi = {
|
||||
table_publish: "/dev/admin/investasi/sub-menu/publish",
|
||||
table_review: "/dev/admin/investasi/sub-menu/review",
|
||||
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_notif: "/dev/donasi/detail/detail_notif/",
|
||||
|
||||
|
||||
//alur donasi
|
||||
donatur: "/dev/donasi/donatur/",
|
||||
kabar: "/dev/donasi/kabar/",
|
||||
@@ -44,6 +45,7 @@ export const RouterDonasi = {
|
||||
cerita_penggalang: "/dev/donasi/cerita_penggalang/",
|
||||
list_kabar: "/dev/donasi/list_kabar/",
|
||||
notif_page: "/dev/donasi/notif_page/",
|
||||
bukti_transfer: "/dev/donasi/bukti-transfer/",
|
||||
|
||||
// proses donasi
|
||||
masukan_donasi: "/dev/donasi/proses_donasi/masukan_donasi/",
|
||||
|
||||
5
src/app/lib/router_hipmi/router_map.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const RouterMap = {
|
||||
splash: "/dev/map/splash",
|
||||
main_view: "/dev/map/main",
|
||||
create: "/dev/map/create",
|
||||
};
|
||||
@@ -82,7 +82,7 @@ export default function UIGlobal_Drawer({
|
||||
onClick={() => {
|
||||
setPageId(e?.id);
|
||||
setIsLoading(true);
|
||||
router.push(e?.path);
|
||||
router.push(e?.path, {scroll: false});
|
||||
}}
|
||||
>
|
||||
{isLoading && e?.id === pageId ? (
|
||||
|
||||
@@ -5,7 +5,11 @@ import { IconChevronLeft } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function ComponentAdminGlobal_BackButton({path}:{path?:string}) {
|
||||
export default function ComponentAdminGlobal_BackButton({
|
||||
path,
|
||||
}: {
|
||||
path?: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
@@ -17,18 +21,21 @@ export default function ComponentAdminGlobal_BackButton({path}:{path?:string}) {
|
||||
// loading={isLoading ? true : false}
|
||||
c={"gray"}
|
||||
leftIcon={
|
||||
isLoading ? <Loader size={"xs"} color={"gray"} /> : <IconChevronLeft />
|
||||
isLoading ? (
|
||||
<Loader size={"xs"} color={"gray"} />
|
||||
) : (
|
||||
<IconChevronLeft />
|
||||
)
|
||||
}
|
||||
variant="white"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
// setTimeout(() => , 3000);
|
||||
if(path==null){
|
||||
if (path == null) {
|
||||
router.back();
|
||||
}else{
|
||||
router.push(path)
|
||||
} else {
|
||||
router.push(path);
|
||||
}
|
||||
|
||||
}}
|
||||
>
|
||||
Kembali
|
||||
|
||||
@@ -88,7 +88,7 @@ export default function AdminDonasi_DetailPublish({
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(pencairan, null, 2)}</pre> */}
|
||||
<Stack>
|
||||
<ComponentAdminGlobal_BackButton />
|
||||
<ComponentAdminGlobal_BackButton path={RouterAdminDonasi.table_publish} />
|
||||
<TampilanDetailDonasi donasi={dataDonasi} countDonatur={countDonatur} />
|
||||
<TampilanListDonatur
|
||||
donatur={listDonatur}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil";
|
||||
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import ComponentAdminGlobal_TampilanRupiahDonasi from "@/app_modules/admin/component_global/tampilan_rupiah";
|
||||
import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
|
||||
import ComponentDonasi_NotedBox from "@/app_modules/donasi/component/noted_box";
|
||||
import { NotifBerhasil } from "@/app_modules/donasi/component/notifikasi/notif_berhasil";
|
||||
import { NotifGagal } from "@/app_modules/donasi/component/notifikasi/notif_gagal";
|
||||
import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
@@ -25,12 +28,8 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentAdminDonasi_TombolKembali from "../../component/tombol_kembali";
|
||||
import { AdminDonasi_funCreatePencairanDana } from "../../fun/create/fun_create_pencairan_dana";
|
||||
import { AdminDonasi_AkumulasiPencairanById } from "../../fun/update/fun_update_akumulasi_pencairan";
|
||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan";
|
||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil";
|
||||
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal";
|
||||
import { AdminDonasi_getOneById } from "../../fun/get/get_one_by_id";
|
||||
import { AdminDonasi_AkumulasiPencairanById } from "../../fun/update/fun_update_akumulasi_pencairan";
|
||||
|
||||
export default function AdminDonasi_PencairanDana({
|
||||
donasiId,
|
||||
@@ -56,7 +55,7 @@ export default function AdminDonasi_PencairanDana({
|
||||
onSuccess={(val) => {
|
||||
setTerkumpul(val.terkumpul);
|
||||
setTotal(val.totalPencairan);
|
||||
console.log(val)
|
||||
console.log(val);
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
@@ -148,15 +147,6 @@ function FormView({
|
||||
}
|
||||
value={value.nilai}
|
||||
onChange={(val) => {
|
||||
// const nilai = val.currentTarget.value;
|
||||
// const nilaiTypeNumber = toNumber(val.currentTarget.value);
|
||||
|
||||
// if (nilaiTypeNumber > sisaDana) {
|
||||
// console.log("lebih");
|
||||
// } else {
|
||||
// console.log("kurang");
|
||||
// }
|
||||
|
||||
const match = val.currentTarget.value
|
||||
.replace(/\./g, "")
|
||||
.match(/^[0-9]+$/);
|
||||
@@ -314,24 +304,41 @@ async function onSave({
|
||||
const gambar = new FormData();
|
||||
gambar.append("file", file as any);
|
||||
|
||||
await AdminDonasi_funCreatePencairanDana(body as any, gambar).then(
|
||||
async (res) => {
|
||||
if (res.status === 200) {
|
||||
await AdminDonasi_AkumulasiPencairanById(
|
||||
body.donasiId as any,
|
||||
body.nominalCair as any
|
||||
).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
const loadData = await AdminDonasi_getOneById(donasiId);
|
||||
onSuccess1(loadData);
|
||||
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
NotifGagal(res.message);
|
||||
const res = await AdminDonasi_funCreatePencairanDana(body as any, gambar);
|
||||
if (res.status === 200) {
|
||||
const res2 = await AdminDonasi_AkumulasiPencairanById(
|
||||
body.donasiId as any,
|
||||
body.nominalCair as any
|
||||
);
|
||||
if (res2.status === 200) {
|
||||
const loadData = await AdminDonasi_getOneById(donasiId);
|
||||
onSuccess1(loadData);
|
||||
|
||||
const dataNotif = {
|
||||
appId: loadData?.id,
|
||||
userId: loadData?.authorId,
|
||||
pesan: loadData?.title as any,
|
||||
status: "Pencairan Dana",
|
||||
kategoriApp: "DONASI",
|
||||
title: "Dana donasi berhasil dicairkan",
|
||||
};
|
||||
|
||||
const notif = await adminNotifikasi_funCreateToUser({
|
||||
data: dataNotif as any,
|
||||
});
|
||||
|
||||
if (notif.status === 201) {
|
||||
mqtt_client.publish(
|
||||
"USER",
|
||||
JSON.stringify({ userId: loadData?.authorId, count: 1 })
|
||||
);
|
||||
}
|
||||
|
||||
ComponentAdminGlobal_NotifikasiBerhasil(res2.message);
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiGagal(res2.message);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +186,7 @@ function TablePublish({ listPublish }: { listPublish: any }) {
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
{isEmpty(data) ? (
|
||||
<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";
|
||||
|
||||
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 { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
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 { BeritaInvestasi } from "@/app_modules/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 {
|
||||
Group,
|
||||
Flex,
|
||||
Avatar,
|
||||
Paper,
|
||||
AspectRatio,
|
||||
Box,
|
||||
Title,
|
||||
Slider,
|
||||
Grid,
|
||||
Stack,
|
||||
ActionIcon,
|
||||
Center,
|
||||
Button,
|
||||
Text,
|
||||
Image,
|
||||
Collapse,
|
||||
Textarea,
|
||||
Center,
|
||||
Divider,
|
||||
Mark,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
Paper,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
Textarea,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import {
|
||||
IconAlertHexagonFilled,
|
||||
IconBan,
|
||||
IconBookDownload,
|
||||
IconCheck,
|
||||
IconChevronDown,
|
||||
IconChevronLeft,
|
||||
IconChevronRight,
|
||||
IconFile,
|
||||
IconFileDescription,
|
||||
IconFileTypePdf,
|
||||
IconPdf,
|
||||
IconSpeakerphone,
|
||||
} from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
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 { 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 Admin_KonfirmasiInvestasi({
|
||||
export default function AdminInvestasi_DetailReview({
|
||||
dataInvestasi,
|
||||
dataUser,
|
||||
}: {
|
||||
dataInvestasi: MODEL_Investasi;
|
||||
dataUser: MODEL_PROFILE_OLD;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [investasi, setInvestasi] = useState(dataInvestasi);
|
||||
const [user, setUser] = useState(dataUser);
|
||||
const [data, setData] = useState(dataInvestasi);
|
||||
const [publish, setPublish] = useState(true);
|
||||
const [opened, { toggle }] = useDisclosure(false);
|
||||
const [catatan, setCatatan] = useState<string | number>("");
|
||||
const [status, setStatus] = useAtom(gs_StatusPortoInvestasi);
|
||||
|
||||
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,
|
||||
},
|
||||
];
|
||||
const [openModal, setOpenModal] = useState(false);
|
||||
const [isLoadingPublish, setIsLoadingPublish] = useState(false);
|
||||
const [isLoadingReject, setIsLoadingReject] = useState(false);
|
||||
|
||||
useShallowEffect(() => {
|
||||
cekStatusPublish();
|
||||
}, []);
|
||||
|
||||
async function cekStatusPublish() {
|
||||
if (investasi.MasterStatusInvestasi.id === "3") setPublish(false);
|
||||
if (data.MasterStatusInvestasi.id === "3") setPublish(false);
|
||||
}
|
||||
|
||||
async function onReject() {
|
||||
const body = {
|
||||
id: investasi.id,
|
||||
catatan: investasi.catatan,
|
||||
id: data.id,
|
||||
catatan: data.catatan,
|
||||
status: "4",
|
||||
};
|
||||
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
||||
await Admin_funRejectInvestasi(body).then((res) => {
|
||||
if (res.status === 200) {
|
||||
toast(res.message);
|
||||
router.back();
|
||||
toggle();
|
||||
} else {
|
||||
toast(res.message);
|
||||
if (_.isEmpty(body.catatan))
|
||||
return ComponentAdminGlobal_NotifikasiPeringatan("Lengkapi alasan");
|
||||
const res = await Admin_funRejectInvestasi(body);
|
||||
if (res.status === 200) {
|
||||
const dataNotif = {
|
||||
appId: res.data?.id,
|
||||
userId: res.data?.authorId,
|
||||
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() {
|
||||
await funGantiStatusInvestasi(investasi.id, "3", "1").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTimeout(() => setPublish(false), 1000);
|
||||
router.push(RouterAdminInvestasi_OLD.table_status_review);
|
||||
toast("Proyek Investasi Di Publish");
|
||||
}
|
||||
const res = await adminInvestasi_funEditStatusPublishById({
|
||||
investasiId: data.id,
|
||||
statusId: "1",
|
||||
progesInvestasiId: "1",
|
||||
});
|
||||
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 (
|
||||
<>
|
||||
<Group position="apart" px={"md"}>
|
||||
<Group>
|
||||
<ActionIcon onClick={() => router.back()}>
|
||||
<IconChevronLeft />
|
||||
</ActionIcon>
|
||||
<Flex align={"center"} gap={"xs"} pl={"lg"}>
|
||||
{/* <Avatar
|
||||
radius={50}
|
||||
size={"md"}
|
||||
src={
|
||||
RouterProfile.api_foto +
|
||||
`${user.Profile?.ImageProfile?.url}`
|
||||
}
|
||||
/> */}
|
||||
<Text>{user.username}</Text>
|
||||
</Flex>
|
||||
<Stack px={"lg"}>
|
||||
<Group position="apart">
|
||||
<ComponentAdminGlobal_BackButton />
|
||||
|
||||
{data.masterStatusInvestasiId === "2" ? (
|
||||
<Group>
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={isLoadingPublish}
|
||||
radius={"xl"}
|
||||
color="green"
|
||||
onClick={() => onPublish()}
|
||||
>
|
||||
Publish
|
||||
</Button>
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={isLoadingReject}
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => onReject()}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
</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>
|
||||
{" "}
|
||||
<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
|
||||
radius={50}
|
||||
bg={"green"}
|
||||
@@ -181,14 +232,14 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
</Button>
|
||||
)}
|
||||
</Center>
|
||||
{investasi.MasterStatusInvestasi.id === "3" ? (
|
||||
{data.MasterStatusInvestasi.id === "3" ? (
|
||||
""
|
||||
) : (
|
||||
<Button
|
||||
radius={50}
|
||||
bg={"red"}
|
||||
color="red"
|
||||
onClick={toggle}
|
||||
onClick={() => setOpenModal(true)}
|
||||
rightIcon={<IconAlertHexagonFilled />}
|
||||
>
|
||||
Reject
|
||||
@@ -205,14 +256,14 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
{/* Title */}
|
||||
<Center my={"sm"}>
|
||||
<Title order={4} mb={"xs"}>
|
||||
{investasi.title}
|
||||
{data.title}
|
||||
</Title>
|
||||
</Center>
|
||||
<Paper withBorder mb={"md"} mah={300} maw={400} mx={"auto"} p={5}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
||||
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||
/>
|
||||
</AspectRatio>
|
||||
</Paper>
|
||||
@@ -229,7 +280,7 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.targetDana)}
|
||||
}).format(+data.targetDana)}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
@@ -238,16 +289,16 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.hargaLembar)}{" "}
|
||||
}).format(+data.hargaLembar)}{" "}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Jadwal Pembagian</Text>
|
||||
<Text>{investasi.MasterPembagianDeviden.name} bulan </Text>
|
||||
<Text>{data.MasterPembagianDeviden.name} bulan </Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pencarian Investor</Text>
|
||||
<Text>{investasi.MasterPencarianInvestor.name} hari </Text>
|
||||
<Text>{data.MasterPencarianInvestor.name} hari </Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
@@ -255,7 +306,7 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>ROI</Text>
|
||||
<Text>{investasi.roi} %</Text>
|
||||
<Text>{data.roi} %</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
@@ -263,13 +314,13 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.totalLembar)}{" "}
|
||||
}).format(+data.totalLembar)}{" "}
|
||||
lembar
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pembagian Deviden</Text>
|
||||
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
||||
<Text>{data.MasterPeriodeDeviden.name}</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
@@ -280,7 +331,7 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
{/* Note */}
|
||||
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
||||
{!publish || data.MasterStatusInvestasi.id === "4" ? (
|
||||
""
|
||||
) : (
|
||||
<Stack spacing={0}>
|
||||
@@ -294,9 +345,9 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
</Stack>
|
||||
)}
|
||||
{publish &&
|
||||
investasi.MasterStatusInvestasi.id === "3" &&
|
||||
_.isEmpty(investasi.BeritaInvestasi) ? (
|
||||
<BeritaInvestasi dataInvestasi={investasi} />
|
||||
data.MasterStatusInvestasi.id === "3" &&
|
||||
_.isEmpty(data.BeritaInvestasi) ? (
|
||||
<BeritaInvestasi dataInvestasi={data} />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
@@ -309,21 +360,21 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
{/* Prospektus */}
|
||||
<Stack spacing={0}>
|
||||
<Title order={6}>Prospektus :</Title>
|
||||
{investasi.ProspektusInvestasi === null ? (
|
||||
{data.ProspektusInvestasi === null ? (
|
||||
<Text>Tidak ada file</Text>
|
||||
) : (
|
||||
<Paper p={"xs"}>
|
||||
<Group>
|
||||
<IconFileTypePdf />
|
||||
<Text>Prospektus_{investasi.title}</Text>
|
||||
<Text>Prospektus_{data.title}</Text>
|
||||
<Link
|
||||
target="_blank"
|
||||
href={
|
||||
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 */}
|
||||
<Stack spacing={0}>
|
||||
<Title order={6}>Dokumen :</Title>
|
||||
{_.isEmpty(investasi.DokumenInvestasi) ? (
|
||||
{_.isEmpty(data.DokumenInvestasi) ? (
|
||||
<Text>Tidak ada dokumen</Text>
|
||||
) : (
|
||||
investasi.DokumenInvestasi.map((e) => (
|
||||
data.DokumenInvestasi.map((e) => (
|
||||
<Paper p={"xs"} key={e.id}>
|
||||
<Group>
|
||||
<IconFileTypePdf />
|
||||
@@ -367,8 +418,8 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
|
||||
<Modal
|
||||
centered
|
||||
opened={opened}
|
||||
onClose={toggle}
|
||||
opened={openModal}
|
||||
onClose={() => setOpenModal(false)}
|
||||
// withCloseButton={false}
|
||||
title="Masukan alasan penolakan"
|
||||
>
|
||||
@@ -377,10 +428,10 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
autosize
|
||||
minRows={2}
|
||||
maxRows={4}
|
||||
value={investasi.catatan === null ? [] : investasi.catatan}
|
||||
value={data.catatan === null ? [] : data.catatan}
|
||||
onChange={(val) =>
|
||||
setInvestasi({
|
||||
...investasi,
|
||||
setData({
|
||||
...data,
|
||||
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 { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin"
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi"
|
||||
import { revalidatePath } from "next/cache"
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export default async function Admin_funRejectInvestasi(data: any) {
|
||||
// console.log(data)
|
||||
// console.log(data)
|
||||
|
||||
const res = await prisma.investasi.update({
|
||||
where: { id: data.id },
|
||||
data: {
|
||||
masterStatusInvestasiId: data.status,
|
||||
catatan: data.catatan
|
||||
}
|
||||
})
|
||||
if(!res) return {status: 400, message: "Gagal reject"}
|
||||
const res = await prisma.investasi.update({
|
||||
where: { id: data.id },
|
||||
data: {
|
||||
masterStatusInvestasiId: data.status,
|
||||
catatan: data.catatan,
|
||||
},
|
||||
select: {
|
||||
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 {
|
||||
status: 200,
|
||||
message: "Reject berhasil"
|
||||
}
|
||||
}
|
||||
return {
|
||||
data: res,
|
||||
status: 200,
|
||||
message: "Reject berhasil",
|
||||
};
|
||||
}
|
||||
|
||||