Progres dan Bursa Investasi
# fix: - Bar progres berfungsi - Urutan bursa investasi # No issue
This commit is contained in:
@@ -20,7 +20,7 @@ export async function POST(req: Request) {
|
||||
} else {
|
||||
try {
|
||||
await fetch(
|
||||
`https://wa.wibudev.com/code?nom=${body.nomor}&text=${body.otp}`
|
||||
`https://wa.wibudev.com/code?nom=${body.nomor}&text=Masukan Kode OTP:${body.otp}`
|
||||
);
|
||||
return NextResponse.json({
|
||||
body,
|
||||
|
||||
@@ -6,6 +6,7 @@ export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
) {
|
||||
|
||||
const data = await prisma.images.findUnique({
|
||||
where: {
|
||||
id: params.id,
|
||||
|
||||
9
src/app/api/investasi/midtrans/[id]/route.ts
Normal file
9
src/app/api/investasi/midtrans/[id]/route.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: NextRequest, {params}: {params: {id: any}}) {
|
||||
|
||||
const body = await req.json()
|
||||
console.log(body)
|
||||
|
||||
return NextResponse.json({ status: 200, message: "OK", data: body });
|
||||
}
|
||||
@@ -6,7 +6,7 @@ export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
) {
|
||||
console.log(params.id)
|
||||
// console.log(params.id)
|
||||
const data = await prisma.prospektusInvestasi.findUnique({
|
||||
where: { id: params.id },
|
||||
select: {
|
||||
|
||||
@@ -8,6 +8,8 @@ import pembagianDeviden from "./../../../bin/seeder/investasi/pembagian_deviden.
|
||||
import statusInvestasi from "./../../../bin/seeder/investasi/status_investasi.json";
|
||||
import namaBank from "./../../../bin/seeder/investasi/nama_bank.json";
|
||||
import statusTransaksiInvestasi from "./../../../bin/seeder/investasi/status_transaksi_investasi.json";
|
||||
import jenisProgres from "../../../bin/seeder/investasi/master_progres.json";
|
||||
import userSeeder from "../../../bin/seeder/user_seeder.json";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const dev = new URL(req.url).searchParams.get("dev");
|
||||
@@ -28,6 +30,24 @@ export async function GET(req: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
for (let i of userSeeder) {
|
||||
await prisma.user.upsert({
|
||||
where: {
|
||||
nomor: i.nomor,
|
||||
},
|
||||
create: {
|
||||
nomor: i.nomor,
|
||||
username: i.name,
|
||||
masterUserRoleId: i.masterUserRoleId,
|
||||
},
|
||||
update: {
|
||||
nomor: i.nomor,
|
||||
username: i.name,
|
||||
masterUserRoleId: i.masterUserRoleId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let i of bidangBisnis) {
|
||||
await prisma.masterBidangBisnis.upsert({
|
||||
where: {
|
||||
@@ -146,6 +166,21 @@ export async function GET(req: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
for (let i of jenisProgres) {
|
||||
await prisma.masterProgresInvestasi.upsert({
|
||||
where: {
|
||||
id: i.id,
|
||||
},
|
||||
create: {
|
||||
id: i.id,
|
||||
name: i.name,
|
||||
},
|
||||
update: {
|
||||
name: i.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
|
||||
const totalInvestor = await funTotalInvestorByIdInvestasi(dataInvestasi?.id)
|
||||
|
||||
// console.log(dataInvestasi?.MasterProgresInvestasi?.name)
|
||||
|
||||
return (
|
||||
<>
|
||||
<DetailInvestasi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DetailSahamTerbeli } from "@/app_modules/investasi";
|
||||
import funTotalInvestorByIdInvestasi from "@/app_modules/investasi/fun/fun_total_investor_by_id";
|
||||
import getOneTransaksiBerhasilByIdInvestasi from "@/app_modules/investasi/fun/get_one_transaksi_berhasil_by_id";
|
||||
import getOneTransaksiBerhasilByIdInvestasi from "@/app_modules/investasi/fun/get_one_transaksi_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataTransaksi = await getOneTransaksiBerhasilByIdInvestasi(params.id);
|
||||
|
||||
@@ -1,24 +1,44 @@
|
||||
import { MainInvestasi } from "@/app_modules/investasi";
|
||||
import funTotalInvestorByIdInvestasi from "@/app_modules/investasi/fun/fun_total_investor_by_id";
|
||||
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 getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
||||
import getPencarianInvestor from "@/app_modules/investasi/fun/master/get_pencarian_investor";
|
||||
import getPeriodeDeviden from "@/app_modules/investasi/fun/master/get_periode_deviden";
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function Page() {
|
||||
const data = await getListAllPublish();
|
||||
const pencarianInvestor = await getPencarianInvestor();
|
||||
const periodeDeviden = await getPeriodeDeviden();
|
||||
const pembagianDeviden = await getPembagianDeviden();
|
||||
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)
|
||||
|
||||
|
||||
|
||||
// console.log(data)
|
||||
return (
|
||||
<>
|
||||
<MainInvestasi
|
||||
listData={data as any}
|
||||
pencarianInvestor={pencarianInvestor as any}
|
||||
periodeDeviden={periodeDeviden as any}
|
||||
pembagianDeviden={pembagianDeviden as any}
|
||||
listData={allData as any}
|
||||
dataSelesai={dataSelesai as any}
|
||||
dataWaktuHabis={dataWaktuHabis as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -17,7 +17,8 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
|
||||
const userLogin = await funGetUserProfile(user.id);
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
// console.log(userLogin);
|
||||
|
||||
// console.log(dataInvestasi);
|
||||
return (
|
||||
<>
|
||||
<ProsesTransaksiInvestasi
|
||||
|
||||
8
src/app/dev/investasi/status_pesanan/[id]/layout.tsx
Normal file
8
src/app/dev/investasi/status_pesanan/[id]/layout.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { LayoutStatusPesananInvestasi } from "@/app_modules/investasi";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
||||
return <>
|
||||
<LayoutStatusPesananInvestasi>{children}</LayoutStatusPesananInvestasi>
|
||||
</>
|
||||
}
|
||||
14
src/app/dev/investasi/status_pesanan/[id]/page.tsx
Normal file
14
src/app/dev/investasi/status_pesanan/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { StatusPesananInvetsatsi } from "@/app_modules/investasi";
|
||||
import getOneTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_one_transaksi_by_id";
|
||||
import getTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_transaksi_investasi";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataTransaksi = await getOneTransaksiByIdInvestasi(params.id);
|
||||
|
||||
return (
|
||||
<>
|
||||
<StatusPesananInvetsatsi dataTransaksi={dataTransaksi as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ export const RouterInvestasi = {
|
||||
api_gambar: "/api/investasi/gambar/",
|
||||
api_file_prospektus: "/api/investasi/prospektus/",
|
||||
api_file_dokumen: "/api/investasi/dokumen/",
|
||||
api_get_notif_midtrans: "/api/investasi/midtrans",
|
||||
|
||||
//INVESTASI
|
||||
main: "/dev/investasi/main",
|
||||
@@ -20,6 +21,7 @@ export const RouterInvestasi = {
|
||||
proses_investasi: "/dev/investasi/proses_investasi/",
|
||||
proses_transaksi: "/dev/investasi/proses_transaksi/",
|
||||
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
||||
status_pesanan:"/dev/investasi/status_pesanan/",
|
||||
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
||||
metode_transfer: "/dev/investasi/metode_transfer/",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user