Progres dan Bursa Investasi
# fix: - Bar progres berfungsi - Urutan bursa investasi # No issue
28
coba.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
curl -X POST
|
||||
http://localhost:3000/api/investasi/midtrans/ \
|
||||
-H 'User-Agent: Veritrans' \
|
||||
-H 'Accept: application/json'\
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"transaction_time": "2020-01-09 18:27:19",
|
||||
"transaction_status": "capture",
|
||||
"transaction_id":
|
||||
"57d5293c-e65f-4a29-95e4-5959c3fa335b",
|
||||
"status_message": "midtrans payment notification",
|
||||
"status_code": "200",
|
||||
"signature_key":
|
||||
"16d6f84b2fb0468e2a9cf99a8ac4e5d803d42180347aaa70cb2a7abb13b5c6130458ca9c71956a962c0827637cd3bc7d40b21a8ae9fab12c7c3efe351b18d00a",
|
||||
"payment_type": "credit_card",
|
||||
"order_id": "Postman-1578568851",
|
||||
"merchant_id": "G141532850",
|
||||
"masked_card": "48111111-1114",
|
||||
"gross_amount": "10000.00",
|
||||
"fraud_status": "accept",
|
||||
"eci": "05",
|
||||
"currency": "IDR",
|
||||
"channel_response_message": "Approved",
|
||||
"channel_response_code": "00",
|
||||
"card_type": "credit",
|
||||
"bank": "bni",
|
||||
"approval_code": "1578569243927"
|
||||
}'
|
||||
257
prisma/migrations/20231219030550_transaksi_sukses/migration.sql
Normal file
@@ -0,0 +1,257 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Katalog" (
|
||||
"id" TEXT NOT NULL,
|
||||
"namaBisnis" TEXT NOT NULL,
|
||||
"alamatKantor" TEXT NOT NULL,
|
||||
"tlpn" TEXT NOT NULL,
|
||||
"deskripsi" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"profileId" TEXT,
|
||||
"masterBidangBisnisId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Katalog_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterBidangBisnis" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "MasterBidangBisnis_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Investasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"targetDana" TEXT NOT NULL,
|
||||
"hargaLembar" TEXT NOT NULL,
|
||||
"totalLembar" TEXT NOT NULL,
|
||||
"roi" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"countDown" TIMESTAMP(3),
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"authorId" TEXT,
|
||||
"catatan" TEXT,
|
||||
"sisaLembar" TEXT NOT NULL,
|
||||
"lembarTerbeli" TEXT DEFAULT '0',
|
||||
"progress" TEXT DEFAULT '0',
|
||||
"masterPeriodeDevidenId" TEXT,
|
||||
"masterPembagianDevidenId" TEXT,
|
||||
"masterPencarianInvestorId" TEXT,
|
||||
"imagesId" TEXT,
|
||||
"masterStatusInvestasiId" TEXT DEFAULT '2',
|
||||
"masterProgresInvestasiId" TEXT,
|
||||
|
||||
CONSTRAINT "Investasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterPencarianInvestor" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "MasterPencarianInvestor_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterPeriodeDeviden" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "MasterPeriodeDeviden_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterPembagianDeviden" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "MasterPembagianDeviden_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterStatusInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"color" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "MasterStatusInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "ProspektusInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"url" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"investasiId" TEXT,
|
||||
|
||||
CONSTRAINT "ProspektusInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "DokumenInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"url" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"investasiId" TEXT,
|
||||
|
||||
CONSTRAINT "DokumenInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "BeritaInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"deskripsi" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"imagesId" TEXT,
|
||||
"investasiId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "BeritaInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterBank" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"norek" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "MasterBank_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterProgresInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "MasterProgresInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "TransaksiInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"investasiId" TEXT NOT NULL,
|
||||
"authorId" TEXT NOT NULL,
|
||||
"namaBank" TEXT,
|
||||
"nomorRekening" TEXT,
|
||||
"token" TEXT,
|
||||
"redirect_url" TEXT,
|
||||
"quantity" TEXT NOT NULL,
|
||||
"price" TEXT NOT NULL,
|
||||
"gross_amount" TEXT NOT NULL,
|
||||
"merchant_name" TEXT NOT NULL,
|
||||
"status_code" TEXT,
|
||||
"status_message" TEXT,
|
||||
"transaction_id" TEXT,
|
||||
"order_id" TEXT,
|
||||
"payment_type" TEXT,
|
||||
"transaction_time" TEXT,
|
||||
"transaction_status" TEXT,
|
||||
"fraud_status" TEXT,
|
||||
"pdf_url" TEXT,
|
||||
"finish_redirect_url" TEXT,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"masterStatusTransaksiInvestasiId" TEXT DEFAULT '1',
|
||||
|
||||
CONSTRAINT "TransaksiInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MasterStatusTransaksiInvestasi" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"color" TEXT,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "MasterStatusTransaksiInvestasi_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Investasi_imagesId_key" ON "Investasi"("imagesId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ProspektusInvestasi_investasiId_key" ON "ProspektusInvestasi"("investasiId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Katalog" ADD CONSTRAINT "Katalog_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "Profile"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Katalog" ADD CONSTRAINT "Katalog_masterBidangBisnisId_fkey" FOREIGN KEY ("masterBidangBisnisId") REFERENCES "MasterBidangBisnis"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_masterPeriodeDevidenId_fkey" FOREIGN KEY ("masterPeriodeDevidenId") REFERENCES "MasterPeriodeDeviden"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_masterPembagianDevidenId_fkey" FOREIGN KEY ("masterPembagianDevidenId") REFERENCES "MasterPembagianDeviden"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_masterPencarianInvestorId_fkey" FOREIGN KEY ("masterPencarianInvestorId") REFERENCES "MasterPencarianInvestor"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES "Images"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_masterStatusInvestasiId_fkey" FOREIGN KEY ("masterStatusInvestasiId") REFERENCES "MasterStatusInvestasi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Investasi" ADD CONSTRAINT "Investasi_masterProgresInvestasiId_fkey" FOREIGN KEY ("masterProgresInvestasiId") REFERENCES "MasterProgresInvestasi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ProspektusInvestasi" ADD CONSTRAINT "ProspektusInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES "Investasi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "DokumenInvestasi" ADD CONSTRAINT "DokumenInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES "Investasi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "BeritaInvestasi" ADD CONSTRAINT "BeritaInvestasi_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES "Images"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "BeritaInvestasi" ADD CONSTRAINT "BeritaInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES "Investasi"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "TransaksiInvestasi" ADD CONSTRAINT "TransaksiInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES "Investasi"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "TransaksiInvestasi" ADD CONSTRAINT "TransaksiInvestasi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "TransaksiInvestasi" ADD CONSTRAINT "TransaksiInvestasi_masterStatusTransaksiInvestasiId_fkey" FOREIGN KEY ("masterStatusTransaksiInvestasiId") REFERENCES "MasterStatusTransaksiInvestasi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -22,7 +22,6 @@ model User {
|
||||
UserSession UserSession?
|
||||
Profile Profile?
|
||||
Investasi Investasi[]
|
||||
// Investor Investor[]
|
||||
TransaksiInvestasi TransaksiInvestasi[]
|
||||
}
|
||||
|
||||
@@ -124,19 +123,17 @@ model Investasi {
|
||||
masterPembagianDevidenId String?
|
||||
MasterPencarianInvestor MasterPencarianInvestor? @relation(fields: [masterPencarianInvestorId], references: [id])
|
||||
masterPencarianInvestorId String?
|
||||
|
||||
ImageInvestasi Images? @relation(fields: [imagesId], references: [id])
|
||||
imagesId String? @unique
|
||||
|
||||
ProspektusInvestasi ProspektusInvestasi?
|
||||
|
||||
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
|
||||
masterStatusInvestasiId String? @default("2")
|
||||
ProspektusInvestasi ProspektusInvestasi?
|
||||
BeritaInvestasi BeritaInvestasi[]
|
||||
DokumenInvestasi DokumenInvestasi[]
|
||||
|
||||
// Investor Investor[]
|
||||
TransaksiInvestasi TransaksiInvestasi[]
|
||||
TransaksiInvestasi TransaksiInvestasi[]
|
||||
MasterProgresInvestasi MasterProgresInvestasi? @relation(fields: [masterProgresInvestasiId], references: [id])
|
||||
masterProgresInvestasiId String?
|
||||
}
|
||||
|
||||
model MasterPencarianInvestor {
|
||||
@@ -219,6 +216,15 @@ model MasterBank {
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model MasterProgresInvestasi {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
Investasi Investasi[]
|
||||
}
|
||||
|
||||
model TransaksiInvestasi {
|
||||
id String @id @default(cuid())
|
||||
Investasi Investasi @relation(fields: [investasiId], references: [id])
|
||||
@@ -262,16 +268,3 @@ model MasterStatusTransaksiInvestasi {
|
||||
TransaksiInvestasi TransaksiInvestasi[]
|
||||
}
|
||||
|
||||
// model Investor {
|
||||
// id String @id @default(cuid())
|
||||
// totalBeli String
|
||||
// jumlahLembar String
|
||||
// active Boolean @default(true)
|
||||
// createdAt DateTime @default(now())
|
||||
// updatedAt DateTime @updatedAt
|
||||
|
||||
// Investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||
// investasiId String?
|
||||
// User User? @relation(fields: [userId], references: [id])
|
||||
// userId String?
|
||||
// }
|
||||
|
||||
BIN
public/file/06714b9b-5ed3-44df-b512-36110c5b91dd.pdf
Normal file
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 268 KiB |
BIN
public/file/c8904500-c9fd-40e4-a500-7ccb9fb48eb5.pdf
Normal file
|
Before Width: | Height: | Size: 156 KiB |
BIN
public/file/e1366e3c-26c3-4939-8503-0ac3e2e68f03.pdf
Normal file
|
Before Width: | Height: | Size: 816 KiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 816 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 94 KiB |
BIN
public/investasi/4297c21c-529d-4f71-bb52-b2fcb60a2bac.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 816 KiB |
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 156 KiB |
BIN
public/investasi/ddf1e9c2-92f0-4885-b467-01cc35d1bf46.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 94 KiB |
BIN
public/investasi/f3e7698b-44de-4dc5-9238-65196abc4fe7.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
|
Before Width: | Height: | Size: 156 KiB |
@@ -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
@@ -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
@@ -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
@@ -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/",
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
}
|
||||
|
||||
async function onPublish() {
|
||||
await funGantiStatusInvestasi(investasi.id, "3").then((res) => {
|
||||
await funGantiStatusInvestasi(investasi.id, "3", "1").then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTimeout(() => setPublish(false), 1000);
|
||||
router.push(RouterAdminInvestasi.table_status_review);
|
||||
|
||||
15
src/app_modules/fun/midtrans/fun_get_notif.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
"use server";
|
||||
|
||||
export default async function funGetNotif({
|
||||
params,
|
||||
}: {
|
||||
params: { data: any };
|
||||
}) {
|
||||
const body = params.data;
|
||||
console.log(body);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
message: "OK",
|
||||
};
|
||||
}
|
||||
@@ -75,26 +75,26 @@ export default function InvestasiCreate({
|
||||
};
|
||||
// toast("Berhasil disimpan")
|
||||
|
||||
// if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||
if (!fl) return toast("Gambar Kosong");
|
||||
if (!pdf) return toast("File Kosong");
|
||||
// if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||
if (!fl) return toast("Gambar Kosong");
|
||||
if (!pdf) return toast("File Kosong");
|
||||
|
||||
const gmbr = new FormData();
|
||||
gmbr.append("file", fl);
|
||||
const gmbr = new FormData();
|
||||
gmbr.append("file", fl);
|
||||
|
||||
const flPdf = new FormData();
|
||||
flPdf.append("file", pdf);
|
||||
const flPdf = new FormData();
|
||||
flPdf.append("file", pdf as any);
|
||||
|
||||
await funCreateInvestasi(gmbr, flPdf, body as any).then((res) => {
|
||||
if (res.status === 201) {
|
||||
// toast(res.message);
|
||||
setChangeColor(1);
|
||||
setActiveTab("Review");
|
||||
router.push(RouterInvestasi.dialog_create);
|
||||
} else {
|
||||
toast(res.message);
|
||||
}
|
||||
});
|
||||
await funCreateInvestasi(gmbr, flPdf, body as any).then((res) => {
|
||||
if (res.status === 201) {
|
||||
// toast(res.message);
|
||||
setChangeColor(1);
|
||||
setActiveTab("Review");
|
||||
router.push(RouterInvestasi.dialog_create);
|
||||
} else {
|
||||
toast(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onTotalLembar(target: any, harga: any) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
IconCircleCheck,
|
||||
IconFileDescription,
|
||||
IconSpeakerphone,
|
||||
IconXboxX,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -41,13 +42,13 @@ export default function DetailInvestasi({
|
||||
dataUser,
|
||||
loginUserId,
|
||||
progress,
|
||||
totalInvestor
|
||||
totalInvestor,
|
||||
}: {
|
||||
dataInvestasi: MODEL_Investasi;
|
||||
dataUser: MODEL_User_profile;
|
||||
loginUserId: string;
|
||||
progress: number;
|
||||
totalInvestor: number
|
||||
totalInvestor: number;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [investasi, setInvestasi] = useState(dataInvestasi);
|
||||
@@ -102,22 +103,54 @@ export default function DetailInvestasi({
|
||||
</Avatar>
|
||||
<Text>{user.username}</Text>
|
||||
</Flex>
|
||||
{Number(investasi.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(new Date(investasi.countDown), "days") <=
|
||||
0 ? (
|
||||
<Group position="right">
|
||||
<IconCircleCheck color="green" />
|
||||
<Text c={"green"}>Selesai</Text>
|
||||
</Group>
|
||||
{investasi.MasterProgresInvestasi.id === "1" ? (
|
||||
<Box>
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<Text>Sisa waktu:</Text>
|
||||
<Text>
|
||||
{Number(investasi.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(
|
||||
new Date(investasi.countDown),
|
||||
"days"
|
||||
)}
|
||||
</Text>
|
||||
<Text>Hari</Text>
|
||||
</Group>
|
||||
</Box>
|
||||
) : (
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<Text>Sisa waktu:</Text>
|
||||
<Text>
|
||||
{Number(investasi.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(new Date(investasi.countDown), "days")}
|
||||
</Text>
|
||||
<Text>Hari</Text>
|
||||
</Group>
|
||||
<Box>
|
||||
{investasi.MasterProgresInvestasi.id === "2" ? (
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<IconCircleCheck color="green" />
|
||||
<Text
|
||||
truncate
|
||||
variant="text"
|
||||
c={Warna.hijau_tua}
|
||||
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
||||
ta="center"
|
||||
fz="md"
|
||||
fw={700}
|
||||
>
|
||||
Selesai
|
||||
</Text>
|
||||
</Group>
|
||||
) : (
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<IconXboxX color="red" />
|
||||
<Text
|
||||
truncate
|
||||
variant="text"
|
||||
c={Warna.merah}
|
||||
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
||||
ta="center"
|
||||
fz="md"
|
||||
fw={700}
|
||||
>
|
||||
Waktu Habis
|
||||
</Text>
|
||||
</Group>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</Group>
|
||||
|
||||
@@ -192,9 +225,13 @@ export default function DetailInvestasi({
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Stack>
|
||||
<Box>
|
||||
<Box>
|
||||
<Text>Investor</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID", {maximumSignificantDigits: 10}).format(totalInvestor)}</Text>
|
||||
<Text>
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(totalInvestor)}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>ROI</Text>
|
||||
@@ -242,25 +279,38 @@ export default function DetailInvestasi({
|
||||
))}
|
||||
</Grid>
|
||||
|
||||
{loginUserId === investasi.authorId ? (
|
||||
{investasi.sisaLembar === "0" ||
|
||||
Number(investasi.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(new Date(investasi.countDown), "days") <=
|
||||
0 ? (
|
||||
<Center mb={"md"}>
|
||||
<Button disabled radius={50} w={350}>
|
||||
Investasi Ini Milik Anda
|
||||
<Button disabled radius={50} w={350} variant="transparent">
|
||||
Investasi Telah Ditutup
|
||||
</Button>
|
||||
</Center>
|
||||
) : (
|
||||
<Center mb={"md"}>
|
||||
<Button
|
||||
radius={50}
|
||||
w={350}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
onSubmit();
|
||||
}}
|
||||
>
|
||||
Beli Saham
|
||||
</Button>
|
||||
</Center>
|
||||
<Box>
|
||||
{loginUserId === investasi.authorId ? (
|
||||
<Center mb={"md"}>
|
||||
<Button disabled radius={50} w={350}>
|
||||
Investasi Ini Milik Anda
|
||||
</Button>
|
||||
</Center>
|
||||
) : (
|
||||
<Center mb={"md"}>
|
||||
<Button
|
||||
radius={50}
|
||||
w={350}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
onSubmit();
|
||||
}}
|
||||
>
|
||||
Beli Saham
|
||||
</Button>
|
||||
</Center>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -20,19 +20,20 @@ export default function LayoutDialogPageCreateInvestasi({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
useShallowEffect(() => {
|
||||
setTimeout(() => router.push(RouterInvestasi.portofolio), 3000)
|
||||
},[])
|
||||
setTimeout(() => router.push(RouterInvestasi.portofolio), 3000);
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
footer={
|
||||
<Footer height={70} sx={{ borderStyle: "none" }}>
|
||||
<Footer height={80} sx={{ borderStyle: "none" }}>
|
||||
<Group spacing={4} position="center">
|
||||
<IconAlertTriangle color="orange" size={20} />
|
||||
<Text fz={"sm"}>Proyek Investasi anda akan berstatus DRAFT</Text>
|
||||
<Text fz={"sm"}>Mohon menunggu validasi Admin</Text>
|
||||
</Group>
|
||||
|
||||
</Footer>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -7,11 +7,12 @@ import fs from "fs";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
import funUploadProspektusInvestasi from "./fun_upload_prospek";
|
||||
|
||||
export async function funCreateInvestasi(
|
||||
gamabar: FormData,
|
||||
filePdf: FormData,
|
||||
data: MODEL_Investasi
|
||||
data: MODEL_Investasi
|
||||
) {
|
||||
// Function upload gambar
|
||||
const file: any = gamabar.get("file");
|
||||
@@ -47,8 +48,8 @@ export async function funCreateInvestasi(
|
||||
totalLembar: data.totalLembar.toString(),
|
||||
sisaLembar: data.totalLembar.toString(),
|
||||
roi: data.roi.toString(),
|
||||
masterPembagianDevidenId: data.masterPeriodeDevidenId,
|
||||
masterPeriodeDevidenId: data.masterPembagianDevidenId,
|
||||
masterPembagianDevidenId: data.masterPembagianDevidenId,
|
||||
masterPeriodeDevidenId: data.masterPeriodeDevidenId,
|
||||
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
||||
imagesId: uploadImage.id,
|
||||
masterStatusInvestasiId: "2",
|
||||
@@ -62,26 +63,31 @@ export async function funCreateInvestasi(
|
||||
};
|
||||
|
||||
// File upload function
|
||||
const dataPdf: any = filePdf.get("file");
|
||||
const pdfName = dataPdf.name;
|
||||
const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
||||
const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
||||
// const dataPdf: any = filePdf.get("file");
|
||||
// const pdfName = dataPdf.name;
|
||||
// const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
||||
// const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
||||
|
||||
const uploadFile = await prisma.prospektusInvestasi.create({
|
||||
data: {
|
||||
investasiId: createInvest.id,
|
||||
url: pdfRandomName,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
// const uploadFile = await prisma.prospektusInvestasi.create({
|
||||
// data: {
|
||||
// investasiId: createInvest.id,
|
||||
// url: pdfRandomName,
|
||||
// },
|
||||
// select: {
|
||||
// id: true,
|
||||
// url: true,
|
||||
// },
|
||||
// });
|
||||
|
||||
// if (!uploadFile) return { status: 400, message: "File Kosong" };
|
||||
// const upPdfFolder = Buffer.from(await file.arrayBuffer());
|
||||
// fs.writeFileSync(`./public/file/${uploadFile.url}`, upPdfFolder);
|
||||
|
||||
if (!uploadFile) return { status: 400, message: "File Kosong" };
|
||||
const upPdfFolder = Buffer.from(await file.arrayBuffer());
|
||||
fs.writeFileSync(`./public/file/${uploadFile.url}`, upPdfFolder);
|
||||
const updloadPDF = await funUploadProspektusInvestasi(
|
||||
filePdf,
|
||||
createInvest.id
|
||||
);
|
||||
// console.log(updloadPDF);
|
||||
|
||||
revalidatePath(RouterInvestasi.main_porto);
|
||||
|
||||
|
||||
@@ -6,28 +6,64 @@ import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import moment from "moment";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export default async function funGantiStatusInvestasi(id: string, val: string) {
|
||||
const publishCD = new Date
|
||||
const data = await prisma.investasi.update({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
data: {
|
||||
MasterStatusInvestasi: {
|
||||
connect: {
|
||||
id: val,
|
||||
export default async function funGantiStatusInvestasi(
|
||||
id: string,
|
||||
statusInves: string,
|
||||
statusProgres?: string
|
||||
) {
|
||||
console.log(statusProgres)
|
||||
if (statusProgres === '1') {
|
||||
const publishCD = new Date();
|
||||
const data = await prisma.investasi.update({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
data: {
|
||||
MasterStatusInvestasi: {
|
||||
connect: {
|
||||
id: statusInves,
|
||||
},
|
||||
},
|
||||
countDown: publishCD,
|
||||
MasterProgresInvestasi: {
|
||||
connect: {
|
||||
id: statusProgres,
|
||||
},
|
||||
},
|
||||
},
|
||||
countDown: publishCD,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
if (!data) return { status: 400 };
|
||||
if (!data) return { status: 400 };
|
||||
|
||||
revalidatePath(RouterInvestasi.portofolio);
|
||||
revalidatePath(RouterAdminInvestasi.main_investasi);
|
||||
revalidatePath(RouterInvestasi.portofolio);
|
||||
revalidatePath(RouterAdminInvestasi.main_investasi);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
};
|
||||
return {
|
||||
status: 200,
|
||||
};
|
||||
} else {
|
||||
const publishCD = new Date();
|
||||
const data = await prisma.investasi.update({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
data: {
|
||||
MasterStatusInvestasi: {
|
||||
connect: {
|
||||
id: statusInves,
|
||||
},
|
||||
},
|
||||
countDown: publishCD,
|
||||
},
|
||||
});
|
||||
|
||||
if (!data) return { status: 400 };
|
||||
|
||||
revalidatePath(RouterInvestasi.portofolio);
|
||||
revalidatePath(RouterAdminInvestasi.main_investasi);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,20 +2,67 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
|
||||
export default async function funUpdateInvestasi(
|
||||
dataLembarSaham: MODEL_Investasi,
|
||||
dataInvestasi: MODEL_Investasi
|
||||
) {
|
||||
|
||||
|
||||
const investasi = dataInvestasi;
|
||||
// console.log(investasi)
|
||||
const progres =
|
||||
((+investasi.totalLembar - +dataLembarSaham.sisaLembar) /
|
||||
+investasi.totalLembar) *
|
||||
100;
|
||||
const jumlahTerbeli = +investasi.totalLembar - +dataLembarSaham.sisaLembar;
|
||||
|
||||
export default async function funUpdateInvestasi(data: MODEL_Investasi) {
|
||||
// console.log(data)
|
||||
const res = await prisma.investasi.update({
|
||||
where: {
|
||||
id: data.id,
|
||||
id: dataLembarSaham.id,
|
||||
},
|
||||
data: {
|
||||
sisaLembar: "" + data.sisaLembar,
|
||||
|
||||
sisaLembar: "" + dataLembarSaham.sisaLembar,
|
||||
progress: "" + progres,
|
||||
lembarTerbeli: "" + jumlahTerbeli,
|
||||
},
|
||||
});
|
||||
|
||||
if (!res) return { status: 400, message: "Gagal update" };
|
||||
|
||||
if (res.progress === "100") {
|
||||
const updateStatusProgres = await prisma.investasi.update({
|
||||
where: {
|
||||
id: res.id,
|
||||
},
|
||||
data: {
|
||||
masterProgresInvestasiId: "2",
|
||||
},
|
||||
});
|
||||
|
||||
// console.log(updateStatusProgres)
|
||||
|
||||
try {
|
||||
await fetch(
|
||||
`https://wa.wibudev.com/code?nom=${investasi.author.nomor}&text=Selamat !! , Project Investasi ${investasi.title} Anda Sukses`
|
||||
);
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil, kirim pesan ke Author"
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 400,
|
||||
message: "Tidak Terkirim ke Author"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
revalidatePath(RouterInvestasi.main);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
message: "Update berhasil",
|
||||
|
||||
@@ -20,17 +20,39 @@ export interface Model_Midtrans_Success {
|
||||
finish_redirect_url: string;
|
||||
}
|
||||
|
||||
interface Model_Body {
|
||||
authorId: string;
|
||||
customer_name: string;
|
||||
phone: string;
|
||||
gross_amount: number;
|
||||
item_name: string;
|
||||
price: number;
|
||||
quantity: number;
|
||||
merchant_name: string;
|
||||
investasiId: string;
|
||||
}
|
||||
|
||||
interface Model_Token {
|
||||
token: string;
|
||||
redirect_url: string;
|
||||
}
|
||||
|
||||
export default async function funUpdatePaymentInvestasi(
|
||||
data: Model_Midtrans_Success,
|
||||
idPay: any,
|
||||
body: Model_Body,
|
||||
token: Model_Token
|
||||
) {
|
||||
console.log(data)
|
||||
if (data.status_code === "200") {
|
||||
const res = await prisma.transaksiInvestasi.update({
|
||||
where: {
|
||||
id: idPay,
|
||||
},
|
||||
const res = await prisma.transaksiInvestasi.create({
|
||||
data: {
|
||||
gross_amount: "" + body.gross_amount,
|
||||
merchant_name: body.merchant_name,
|
||||
price: "" + body.price,
|
||||
quantity: "" + body.quantity,
|
||||
token: token.token,
|
||||
redirect_url: token.redirect_url,
|
||||
authorId: body.authorId,
|
||||
investasiId: body.investasiId,
|
||||
status_code: data.status_code,
|
||||
status_message: data.status_message,
|
||||
order_id: data.order_id,
|
||||
@@ -48,49 +70,12 @@ export default async function funUpdatePaymentInvestasi(
|
||||
|
||||
if (!res) return { status: 400, message: "Gagal update transaksi" };
|
||||
|
||||
// const jumlah = Number(res.quantity);
|
||||
// const sisa = Number(investasi?.sisaLembar);
|
||||
// const hasil = sisa - jumlah;
|
||||
|
||||
// const updateTransaksi = await prisma.investasi.update({
|
||||
// where: {
|
||||
// id: investasi?.id,
|
||||
// },
|
||||
// data: {
|
||||
// sisaLembar: hasil.toString(),
|
||||
// },
|
||||
// });
|
||||
|
||||
// console.log(updateTransaksi);
|
||||
// if (!updateTransaksi)
|
||||
// return { status: 400, message: "Gagal update investasi" };
|
||||
|
||||
revalidatePath(RouterInvestasi.main_transaksi)
|
||||
revalidatePath(RouterInvestasi.main_transaksi);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
message: "Process",
|
||||
message: "Berhasil",
|
||||
data: res,
|
||||
};
|
||||
} else {
|
||||
if (data.status_code === "201") {
|
||||
const res = await prisma.transaksiInvestasi.update({
|
||||
where: {
|
||||
id: idPay,
|
||||
},
|
||||
data: {
|
||||
status_code: "201",
|
||||
},
|
||||
});
|
||||
return {
|
||||
message: "Success",
|
||||
};
|
||||
} else {
|
||||
if ((!data.status_code as any) === "400")
|
||||
return { status: 400, message: "Update Gagal" };
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil Update",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
src/app_modules/investasi/fun/fun_update_progres_persen.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
"use server";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
import moment from "moment";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function funUpadteProgresPersenInvestasi(data: MODEL_Investasi) {
|
||||
// console.log(data)
|
||||
if (data.MasterProgresInvestasi.id !== "2" && data.progress === "100") {
|
||||
const res = await prisma.investasi.update({
|
||||
where: {
|
||||
id: data.id,
|
||||
},
|
||||
data: {
|
||||
masterProgresInvestasiId: "2",
|
||||
},
|
||||
});
|
||||
// console.log(res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
23
src/app_modules/investasi/fun/fun_update_progres_waktu.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
"use server";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
import moment from "moment";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function funUpadteProgresWaktuInvestasi(data: MODEL_Investasi) {
|
||||
|
||||
const pencarian = data.MasterPencarianInvestor.name;
|
||||
const countD = moment(new Date()).diff(new Date(data.countDown), "days");
|
||||
|
||||
if (+pencarian - +countD <= 0) {
|
||||
const res = await prisma.investasi.update({
|
||||
where: {
|
||||
id: data.id,
|
||||
},
|
||||
data: {
|
||||
masterProgresInvestasiId: "3",
|
||||
},
|
||||
});
|
||||
// console.log(res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
45
src/app_modules/investasi/fun/get_list_all_investasi.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function getAllDataPublishInvestasi() {
|
||||
const data = await prisma.investasi.findMany({
|
||||
orderBy: [
|
||||
{
|
||||
masterProgresInvestasiId: "asc",
|
||||
},
|
||||
{
|
||||
countDown: "desc",
|
||||
},
|
||||
],
|
||||
where: {
|
||||
MasterStatusInvestasi: {
|
||||
name: {
|
||||
equals: "Publish",
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
authorId: true,
|
||||
hargaLembar: true,
|
||||
targetDana: true,
|
||||
totalLembar: true,
|
||||
sisaLembar: true,
|
||||
progress: true,
|
||||
roi: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
imagesId: true,
|
||||
ProspektusInvestasi: true,
|
||||
MasterPembagianDeviden: true,
|
||||
MasterPencarianInvestor: true,
|
||||
MasterPeriodeDeviden: true,
|
||||
MasterProgresInvestasi: true,
|
||||
countDown: true,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
}
|
||||
@@ -1,46 +1,142 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
/**
|
||||
*
|
||||
* @param status progres > 1 - 3
|
||||
* @type string
|
||||
* @returns data publish menurut status progresnya
|
||||
*/
|
||||
export async function getListAllPublish(status : string) {
|
||||
|
||||
export async function getListAllPublish() {
|
||||
const data = await prisma.investasi.findMany({
|
||||
orderBy: {
|
||||
countDown: "asc",
|
||||
},
|
||||
where: {
|
||||
MasterStatusInvestasi: {
|
||||
name: {
|
||||
equals: "Publish",
|
||||
if (status === "1") {
|
||||
const data = await prisma.investasi.findMany({
|
||||
orderBy: {
|
||||
countDown: "asc",
|
||||
},
|
||||
where: {
|
||||
MasterStatusInvestasi: {
|
||||
name: {
|
||||
equals: "Publish",
|
||||
},
|
||||
},
|
||||
AND: {
|
||||
MasterProgresInvestasi: {
|
||||
id: "1",
|
||||
},
|
||||
},
|
||||
},
|
||||
AND: {
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
authorId: true,
|
||||
hargaLembar: true,
|
||||
targetDana: true,
|
||||
totalLembar: true,
|
||||
sisaLembar: true,
|
||||
progress: true,
|
||||
roi: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
imagesId: true,
|
||||
// MasterStatusInvestasi: true,
|
||||
// BeritaInvestasi: true,
|
||||
// DokumenInvestasi: true,
|
||||
ProspektusInvestasi: true,
|
||||
MasterPembagianDeviden: true,
|
||||
MasterPencarianInvestor: true,
|
||||
MasterPeriodeDeviden: true,
|
||||
MasterProgresInvestasi: true,
|
||||
countDown: true,
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
authorId: true,
|
||||
hargaLembar: true,
|
||||
targetDana: true,
|
||||
totalLembar: true,
|
||||
sisaLembar: true,
|
||||
progress: true,
|
||||
roi: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
imagesId: true,
|
||||
MasterStatusInvestasi: true,
|
||||
BeritaInvestasi: true,
|
||||
DokumenInvestasi: true,
|
||||
ProspektusInvestasi: true,
|
||||
MasterPembagianDeviden: true,
|
||||
MasterPencarianInvestor: true,
|
||||
MasterPeriodeDeviden: true,
|
||||
countDown: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
});
|
||||
return data;
|
||||
}
|
||||
if (status === "2") {
|
||||
const data = await prisma.investasi.findMany({
|
||||
orderBy: {
|
||||
masterPencarianInvestorId: "asc",
|
||||
},
|
||||
where: {
|
||||
MasterStatusInvestasi: {
|
||||
name: {
|
||||
equals: "Publish",
|
||||
},
|
||||
},
|
||||
AND: {
|
||||
MasterProgresInvestasi: {
|
||||
id: "2",
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
authorId: true,
|
||||
hargaLembar: true,
|
||||
targetDana: true,
|
||||
totalLembar: true,
|
||||
sisaLembar: true,
|
||||
progress: true,
|
||||
roi: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
imagesId: true,
|
||||
// MasterStatusInvestasi: true,
|
||||
// BeritaInvestasi: true,
|
||||
// DokumenInvestasi: true,
|
||||
ProspektusInvestasi: true,
|
||||
MasterPembagianDeviden: true,
|
||||
MasterPencarianInvestor: true,
|
||||
MasterPeriodeDeviden: true,
|
||||
countDown: true,
|
||||
},
|
||||
});
|
||||
return data
|
||||
}
|
||||
if (status === "3") {
|
||||
const data = await prisma.investasi.findMany({
|
||||
orderBy: {
|
||||
masterPencarianInvestorId: "asc",
|
||||
},
|
||||
where: {
|
||||
MasterStatusInvestasi: {
|
||||
name: {
|
||||
equals: "Publish",
|
||||
},
|
||||
},
|
||||
AND: {
|
||||
MasterProgresInvestasi: {
|
||||
id: "3",
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
authorId: true,
|
||||
hargaLembar: true,
|
||||
targetDana: true,
|
||||
totalLembar: true,
|
||||
sisaLembar: true,
|
||||
progress: true,
|
||||
roi: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
imagesId: true,
|
||||
// MasterStatusInvestasi: true,
|
||||
// BeritaInvestasi: true,
|
||||
// DokumenInvestasi: true,
|
||||
ProspektusInvestasi: true,
|
||||
MasterPembagianDeviden: true,
|
||||
MasterPencarianInvestor: true,
|
||||
MasterPeriodeDeviden: true,
|
||||
countDown: true,
|
||||
},
|
||||
});
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export default async function getOneInvestasiById(id: string) {
|
||||
MasterPembagianDeviden: true,
|
||||
MasterPencarianInvestor: true,
|
||||
MasterPeriodeDeviden: true,
|
||||
MasterProgresInvestasi: true,
|
||||
author: true,
|
||||
countDown: true
|
||||
},
|
||||
|
||||
@@ -6,15 +6,18 @@ export default async function getOneTransaksiBerhasilByIdInvestasi(
|
||||
idTransaksi: string
|
||||
) {
|
||||
const data = await prisma.transaksiInvestasi.findUnique({
|
||||
|
||||
where: {
|
||||
id: idTransaksi,
|
||||
},
|
||||
select: {
|
||||
Investasi: {
|
||||
select: {
|
||||
|
||||
author: true,
|
||||
author: {
|
||||
select: {
|
||||
nomor: true,
|
||||
username: true,
|
||||
}
|
||||
},
|
||||
BeritaInvestasi: true,
|
||||
DokumenInvestasi: true,
|
||||
ProspektusInvestasi: true,
|
||||
@@ -35,6 +38,10 @@ export default async function getOneTransaksiBerhasilByIdInvestasi(
|
||||
id: true,
|
||||
gross_amount: true,
|
||||
quantity: true,
|
||||
transaction_id: true,
|
||||
status_message: true,
|
||||
payment_type: true,
|
||||
namaBank: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -33,7 +33,6 @@ export default async function getTokenTransaksi(data) {
|
||||
customer_details: {
|
||||
first_name: body.customer_name,
|
||||
phone: body.phone,
|
||||
// email: "test@midtrans.com",
|
||||
},
|
||||
enabled_payments: [
|
||||
"permata_va",
|
||||
@@ -45,7 +44,7 @@ export default async function getTokenTransaksi(data) {
|
||||
"shopeepay",
|
||||
],
|
||||
bca_va: {
|
||||
va_number: "82340374411111",
|
||||
va_number: "7725699636222",
|
||||
sub_company_code: "00000",
|
||||
free_text: {
|
||||
inquiry: [
|
||||
@@ -81,25 +80,15 @@ export default async function getTokenTransaksi(data) {
|
||||
}
|
||||
});
|
||||
|
||||
// console.log(token)
|
||||
|
||||
if (token.status === 400) {
|
||||
return { token: token };
|
||||
}
|
||||
|
||||
const newTransaksi = await prisma.transaksiInvestasi.create({
|
||||
data: {
|
||||
gross_amount: "" + data.gross_amount,
|
||||
merchant_name: data.merchant_name,
|
||||
price: "" + data.price,
|
||||
quantity: "" + data.quantity,
|
||||
token: token.value.token,
|
||||
redirect_url: token.value.redirect_url,
|
||||
authorId: data.authorId,
|
||||
investasiId: data.investasiId,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
token: token,
|
||||
dataTransaksi: newTransaksi,
|
||||
// dataTransaksi: newTransaksi,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ export default async function getTransaksiByIdInvestasi(id: string) {
|
||||
id: true,
|
||||
namaBank: true,
|
||||
nomorRekening: true,
|
||||
transaction_id: true,
|
||||
quantity: true,
|
||||
gross_amount: true,
|
||||
status_message: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
|
||||
@@ -13,3 +13,5 @@ export const gs_TransferValue = atomWithStorage("gs_TransferValue", {
|
||||
namaBank: "",
|
||||
nomorRekening: "",
|
||||
});
|
||||
|
||||
export const gs_midtrans_snap= atomWithStorage("gs_midtrans_snapssssssssss", false)
|
||||
|
||||
@@ -65,6 +65,8 @@ import UploadDokumenInvestasi from "./upload_dokumen/view";
|
||||
import LayoutUploadDokumenInvestasi from "./upload_dokumen/layout";
|
||||
import ProsesTransaksiInvestasi from "./proses_transaksi/view";
|
||||
import LayoutProsesTransaksiInvestasi from "./proses_transaksi/layout";
|
||||
import StatusPesananInvetsatsi from "./status_pesanan/view";
|
||||
import LayoutStatusPesananInvestasi from "./status_pesanan/layout";
|
||||
|
||||
export {
|
||||
MainInvestasi,
|
||||
@@ -134,4 +136,6 @@ export {
|
||||
LayoutUploadDokumenInvestasi,
|
||||
ProsesTransaksiInvestasi,
|
||||
LayoutProsesTransaksiInvestasi,
|
||||
StatusPesananInvetsatsi,
|
||||
LayoutStatusPesananInvestasi,
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import { useRouter } from "next/navigation";
|
||||
import dataDummy from "../dummy/data_dummy.json";
|
||||
import moment from "moment";
|
||||
import { IconCheck, IconCircleCheck } from "@tabler/icons-react";
|
||||
import { IconCheck, IconCircleCheck, IconXboxX } from "@tabler/icons-react";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
@@ -35,39 +35,23 @@ import { Warna } from "@/app/lib/warna";
|
||||
|
||||
export default function MainInvestasi({
|
||||
listData,
|
||||
pencarianInvestor,
|
||||
periodeDeviden,
|
||||
pembagianDeviden,
|
||||
dataSelesai,
|
||||
dataWaktuHabis,
|
||||
}: {
|
||||
listData: MODEL_Investasi[];
|
||||
pencarianInvestor: MODEL_DEFAULT_MASTER[];
|
||||
periodeDeviden: MODEL_DEFAULT_MASTER[];
|
||||
pembagianDeviden: MODEL_DEFAULT_MASTER[];
|
||||
dataSelesai: MODEL_Investasi[];
|
||||
dataWaktuHabis: MODEL_Investasi[];
|
||||
}) {
|
||||
// console.log(listData)
|
||||
const router = useRouter();
|
||||
const [investasi, setInvestasi] = useState(listData);
|
||||
const [invesDone, setInvesDone] = useState(dataSelesai);
|
||||
const [invesFail, setInvesFail] = useState(dataWaktuHabis);
|
||||
const [statusPublish, setStatusPublish] = useState(false);
|
||||
|
||||
async function onProgres(data: MODEL_Investasi) {
|
||||
// console.log(data)
|
||||
const total = Number(data.totalLembar);
|
||||
const sisa = Number(data.sisaLembar);
|
||||
const beli = total - sisa;
|
||||
const hasil = (beli / total) * 100;
|
||||
const progres = Math.round(hasil).toFixed(2);
|
||||
// console.log(progres)
|
||||
return progres;
|
||||
}
|
||||
// console.log(dataWaktuHabis)
|
||||
|
||||
// useShallowEffect(() => {
|
||||
// onStatusPublish(investasi)
|
||||
// },[investasi])
|
||||
|
||||
// async function onStatusPublish(investasi : MODEL_Investasi[]) {
|
||||
|
||||
// }
|
||||
|
||||
if (_.isEmpty(investasi))
|
||||
if (_.isEmpty(investasi) && _.isEmpty(invesDone) && _.isEmpty(invesFail))
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
@@ -79,7 +63,6 @@ export default function MainInvestasi({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(listData, null, 2)}</pre> */}
|
||||
|
||||
{investasi.map((e) => (
|
||||
<Card
|
||||
@@ -104,25 +87,12 @@ export default function MainInvestasi({
|
||||
</AspectRatio>
|
||||
</CardSection>
|
||||
|
||||
{/* Progress dan titlr */}
|
||||
<CardSection p={"lg"}>
|
||||
<Stack>
|
||||
<Title order={4}>{e.title}</Title>
|
||||
<Progress
|
||||
label={
|
||||
"" +
|
||||
(
|
||||
((+e.totalLembar - +e.sisaLembar) / +e.totalLembar) *
|
||||
100
|
||||
).toFixed(1) +
|
||||
"%"
|
||||
}
|
||||
value={
|
||||
+(
|
||||
((+e.totalLembar - +e.sisaLembar) / +e.totalLembar) *
|
||||
100
|
||||
).toFixed(1)
|
||||
}
|
||||
label={(+e.progress).toFixed(2) + " %"}
|
||||
value={+e.progress}
|
||||
color="teal"
|
||||
size="xl"
|
||||
radius="xl"
|
||||
@@ -151,7 +121,6 @@ export default function MainInvestasi({
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+e.hargaLembar)}
|
||||
{/* {e.hargaLembar} */}
|
||||
</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
@@ -179,15 +148,6 @@ export default function MainInvestasi({
|
||||
<Divider color="dark.4" />
|
||||
<CardSection p={"md"}>
|
||||
<Group position="apart">
|
||||
{/* <Box>
|
||||
{e.SahamTerbeli === null ? (
|
||||
""
|
||||
) : (
|
||||
<Badge variant="dot" color="teal">
|
||||
Saham Anda
|
||||
</Badge>
|
||||
)}
|
||||
</Box> */}
|
||||
<Button
|
||||
radius={"xl"}
|
||||
compact
|
||||
@@ -198,48 +158,55 @@ export default function MainInvestasi({
|
||||
Details
|
||||
</Button>
|
||||
|
||||
{(() => {
|
||||
if (
|
||||
Number(e.MasterPencarianInvestor.name) -
|
||||
{e.progress === "100" ? (
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<IconCircleCheck color="green" />
|
||||
<Text
|
||||
truncate
|
||||
variant="text"
|
||||
c={Warna.hijau_tua}
|
||||
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
||||
ta="center"
|
||||
fz="md"
|
||||
fw={700}
|
||||
>
|
||||
Selesai
|
||||
</Text>
|
||||
</Group>
|
||||
) : (
|
||||
<Box>
|
||||
{+e.MasterPencarianInvestor.name -
|
||||
moment(new Date()).diff(new Date(e.countDown), "days") <=
|
||||
0
|
||||
) {
|
||||
return (
|
||||
<>
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<IconCircleCheck color="green" />
|
||||
<Text
|
||||
truncate
|
||||
variant="text"
|
||||
c={Warna.hijau_tua}
|
||||
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
||||
ta="center"
|
||||
fz="md"
|
||||
fw={700}
|
||||
>
|
||||
Waktu Habis
|
||||
</Text>
|
||||
</Group>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<Text truncate>Sisa waktu:</Text>
|
||||
<Text truncate>
|
||||
{Number(e.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(
|
||||
new Date(e.countDown),
|
||||
"days"
|
||||
)}
|
||||
</Text>
|
||||
<Text truncate>Hari</Text>
|
||||
</Group>
|
||||
</>
|
||||
);
|
||||
}
|
||||
})()}
|
||||
0 ? (
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<IconXboxX color="red" />
|
||||
<Text
|
||||
truncate
|
||||
variant="text"
|
||||
c={Warna.merah}
|
||||
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
||||
ta="center"
|
||||
fz="md"
|
||||
fw={700}
|
||||
>
|
||||
Waktu Habis
|
||||
</Text>
|
||||
</Group>
|
||||
) : (
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<Text truncate>Sisa waktu:</Text>
|
||||
<Text truncate>
|
||||
{Number(e.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(
|
||||
new Date(e.countDown),
|
||||
"days"
|
||||
)}
|
||||
</Text>
|
||||
<Text truncate>Hari</Text>
|
||||
</Group>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</Group>
|
||||
</CardSection>
|
||||
</Card>
|
||||
|
||||
@@ -23,6 +23,7 @@ export interface MODEL_Investasi {
|
||||
MasterPembagianDeviden: Model_All_Master;
|
||||
MasterPencarianInvestor: Model_All_Master;
|
||||
MasterPeriodeDeviden: Model_All_Master;
|
||||
MasterProgresInvestasi: Model_All_Master,
|
||||
masterPeriodeDevidenId: string;
|
||||
masterPembagianDevidenId: string;
|
||||
masterPencarianInvestorId: string;
|
||||
@@ -34,6 +35,9 @@ export interface MODEL_Transaksi_Investasi {
|
||||
id: string;
|
||||
namaBank: string;
|
||||
nomorRekening: string;
|
||||
transaction_id: string,
|
||||
status_message: string
|
||||
payment_type: string,
|
||||
active: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
|
||||
@@ -1,18 +1,43 @@
|
||||
"use client";
|
||||
|
||||
import HeaderTamplate from "@/app_modules/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import { ActionIcon, AppShell, Box, Group, Header, Text } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import React, { useState } from "react";
|
||||
import { gs_midtrans_snap } from "../g_state";
|
||||
import { IconArrowLeft } from "@tabler/icons-react";
|
||||
import { title } from "process";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function LayoutProsesTransaksiInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [snapShow, setSnapShow] = useAtom(gs_midtrans_snap);
|
||||
const router = useRouter();
|
||||
// console.log(snapShow)
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<HeaderTamplate title="Proses Transaksi" />}>
|
||||
{children}
|
||||
<AppShell
|
||||
header={
|
||||
<Header height={50} sx={{ borderStyle: "none" }}>
|
||||
<Group h={50} position="apart" px={"md"}>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
<IconArrowLeft />
|
||||
</ActionIcon>
|
||||
<Text fw={500}>Proses Transaksi</Text>
|
||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
>
|
||||
<Box>{children}</Box>
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
Container,
|
||||
Flex,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
import { MODEL_User_profile } from "@/app_modules/home/models/user_profile";
|
||||
@@ -22,7 +22,7 @@ import toast from "react-simple-toasts";
|
||||
import funUpdatePaymentInvestasi from "../fun/fun_update_payment";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_investasiFooter } from "../g_state";
|
||||
import { gs_investasiFooter, gs_midtrans_snap } from "../g_state";
|
||||
import funUpdateInvestasi from "../fun/fun_update_investasi";
|
||||
|
||||
export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||
@@ -38,6 +38,11 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||
const [hotmenu, setHotmenu] = useAtom(gs_investasiFooter);
|
||||
const [snapShow, setSnapShow] = useState(false);
|
||||
|
||||
useShallowEffect(() => {
|
||||
setJumlah(0)
|
||||
setTotal(0)
|
||||
},[])
|
||||
|
||||
// console.log(userLogin.id);
|
||||
// console.log(investasi);
|
||||
|
||||
@@ -61,28 +66,29 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||
await getTokenTransaksi(body).then(async (res) => {
|
||||
if (res.token.status === 200) {
|
||||
// console.log(res.token.value.token)
|
||||
setSnapShow(true);
|
||||
snap.embed(res.token.value.token, {
|
||||
embedId: "embedId",
|
||||
// setSnapShow(true);
|
||||
snap.pay(res.token.value.token, {
|
||||
// embedId: "embedId",
|
||||
onSuccess: async function (result) {
|
||||
console.log(result);
|
||||
// console.log("success");
|
||||
setSnapShow(false);
|
||||
// setSnapShow(false);
|
||||
|
||||
await funUpdatePaymentInvestasi(result, res.dataTransaksi.id).then(
|
||||
await funUpdatePaymentInvestasi(result, body, res.token.value).then(
|
||||
async (resUpdate) => {
|
||||
if (resUpdate.status === 200) {
|
||||
const hasil =
|
||||
investasi.sisaLembar - res.dataTransaksi.quantity;
|
||||
// console.log(resUpdate.message)
|
||||
const lembarTersisa = investasi.sisaLembar - resUpdate.data.quantity;
|
||||
|
||||
const body = {
|
||||
const body2 = {
|
||||
id: investasi.id,
|
||||
sisaLembar: hasil,
|
||||
sisaLembar: lembarTersisa,
|
||||
};
|
||||
|
||||
await funUpdateInvestasi(body);
|
||||
await funUpdateInvestasi(body2, investasi);
|
||||
toast(res.message);
|
||||
router.push(RouterInvestasi.main_transaksi);
|
||||
router.push(
|
||||
RouterInvestasi.status_pesanan + `${resUpdate.data.id}`
|
||||
);
|
||||
|
||||
setHotmenu(3);
|
||||
} else {
|
||||
toast(res.message);
|
||||
@@ -91,32 +97,30 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||
);
|
||||
},
|
||||
onPending: async function (result) {
|
||||
await funUpdatePaymentInvestasi(result, res.dataTransaksi.id);
|
||||
router.push(RouterInvestasi.proses_transaksi + `${investasi.id}`);
|
||||
setSnapShow(false);
|
||||
|
||||
console.log("pending");
|
||||
console.log(result);
|
||||
},
|
||||
onError: async function (result) {
|
||||
await funUpdatePaymentInvestasi(result, res.dataTransaksi.id);
|
||||
router.push(RouterInvestasi.main_transaksi);
|
||||
setSnapShow(false);
|
||||
|
||||
console.log("error");
|
||||
console.log(result);
|
||||
// console.log("pending");
|
||||
// console.log(result);
|
||||
// await funUpdatePaymentInvestasi(result, res.dataTransaksi.id);
|
||||
// toast(res.message);
|
||||
// router.push(
|
||||
// RouterInvestasi.status_pesanan + `${res.dataTransaksi.id}`
|
||||
// );
|
||||
// router.push(RouterInvestasi.detail + `${investasi.id}`)
|
||||
await router.push(RouterInvestasi.detail + `${investasi.id}`);
|
||||
setJumlah(0);
|
||||
},
|
||||
onClose: async function (result) {
|
||||
if (result === undefined) {
|
||||
const data = {
|
||||
status_code: "400",
|
||||
};
|
||||
await funUpdatePaymentInvestasi(data, res.dataTransaksi.id);
|
||||
router.push(RouterInvestasi.main_transaksi);
|
||||
setSnapShow(false);
|
||||
// router.push(RouterPay.home);
|
||||
console.log(data);
|
||||
}
|
||||
await router.push(RouterInvestasi.detail + `${investasi.id}`);
|
||||
|
||||
// if (result === undefined) {
|
||||
// const data = {
|
||||
// status_code: "400",
|
||||
// };
|
||||
// // await funUpdatePaymentInvestasi(data, res.dataTransaksi.id);
|
||||
// router.push(RouterInvestasi.main_transaksi);
|
||||
// setSnapShow(false);
|
||||
// // router.push(RouterPay.home);
|
||||
// console.log(data);
|
||||
// }
|
||||
},
|
||||
});
|
||||
} else {
|
||||
@@ -143,89 +147,90 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{!snapShow && (
|
||||
<Box px={"md"}>
|
||||
{/* Sisa Lembar Saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Text>Sisa Lembar Saham</Text>
|
||||
<Text fz={23}>
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.sisaLembar)}{" "}
|
||||
</Text>
|
||||
</Group>
|
||||
{/* {!snapShow && (
|
||||
|
||||
)} */}
|
||||
<Box>
|
||||
{/* Sisa Lembar Saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Text>Sisa Lembar Saham</Text>
|
||||
<Text fz={23}>
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.sisaLembar)}{" "}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
{/* Harga perlembar saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Text>Harga Perlembar</Text>
|
||||
<Text fz={23}>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.hargaLembar)}{" "}
|
||||
</Text>
|
||||
</Group>
|
||||
{/* Harga perlembar saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Text>Harga Perlembar</Text>
|
||||
<Text fz={23}>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.hargaLembar)}{" "}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
{/* Lembar saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Box>
|
||||
<Text>Jumlah Pembelian</Text>
|
||||
<Text c={"blue"} fs={"italic"} fz={10}>
|
||||
minimal pembelian 10 lembar
|
||||
</Text>
|
||||
{/* <Text c={"red"} fs={"italic"} fz={10}>
|
||||
{/* Lembar saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Box>
|
||||
<Text>Jumlah Pembelian</Text>
|
||||
<Text c={"blue"} fs={"italic"} fz={10}>
|
||||
minimal pembelian 10 lembar
|
||||
</Text>
|
||||
{/* <Text c={"red"} fs={"italic"} fz={10}>
|
||||
maximal pembelian {maxPembelian} lembar
|
||||
</Text> */}
|
||||
</Box>
|
||||
<NumberInput
|
||||
type="number"
|
||||
ref={focusTrapRef}
|
||||
w={100}
|
||||
max={maxPembelian}
|
||||
onChange={(val) => {
|
||||
setTotal(val * +investasi.hargaLembar);
|
||||
setJumlah(val);
|
||||
// console.log(val);
|
||||
</Box>
|
||||
<NumberInput
|
||||
type="number"
|
||||
ref={focusTrapRef}
|
||||
w={100}
|
||||
max={maxPembelian}
|
||||
onChange={(val) => {
|
||||
setTotal(val * +investasi.hargaLembar);
|
||||
setJumlah(val);
|
||||
// console.log(val);
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
<Divider my={"lg"} />
|
||||
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Box>
|
||||
<Text>Total Harga</Text>
|
||||
</Box>
|
||||
<Text fz={25}>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(total)}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
<Center>
|
||||
{jumlah < 10 ? (
|
||||
<Button w={350} radius={50} bg={"gray"} disabled>
|
||||
Beli
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
w={350}
|
||||
radius={50}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
onProses();
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
>
|
||||
Beli
|
||||
</Button>
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
|
||||
<Divider my={"lg"} />
|
||||
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Box>
|
||||
<Text>Total Harga</Text>
|
||||
</Box>
|
||||
<Text fz={25}>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(total)}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
<Center>
|
||||
{jumlah < 10 ? (
|
||||
<Button w={350} radius={50} bg={"gray"} disabled>
|
||||
Beli Saham
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
w={350}
|
||||
radius={50}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
onProses();
|
||||
}}
|
||||
>
|
||||
Beli Saham
|
||||
</Button>
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
<Flex align={"center"} justify={"center"} id="embedId" />
|
||||
{/* <Flex align={"center"} justify={"center"} id="embedId" /> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
30
src/app_modules/investasi/status_pesanan/layout.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
"use client";
|
||||
|
||||
import HeaderTamplate from "@/app_modules/component/header_tamplate";
|
||||
import { ActionIcon, AppShell, Group, Header, Text } from "@mantine/core";
|
||||
import { IconArrowLeft } from "@tabler/icons-react";
|
||||
import router from "next/router";
|
||||
import { title } from "process";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutStatusPesananInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={
|
||||
<Header height={50}>
|
||||
<Group h={50} position="center" px={"md"}>
|
||||
<Text>Status Transaksi</Text>
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
70
src/app_modules/investasi/status_pesanan/view.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { MODEL_Transaksi_Investasi } from "../model/model_investasi";
|
||||
import { Button, Group, Paper, Stack, Text } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
|
||||
export default function StatusPesananInvetsatsi({
|
||||
dataTransaksi,
|
||||
}: {
|
||||
dataTransaksi: MODEL_Transaksi_Investasi;
|
||||
}) {
|
||||
const router = useRouter()
|
||||
const [transaksi, setTransaksi] = useState(dataTransaksi);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Paper withBorder p={"md"}>
|
||||
<Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Pemilik Investasi</Text>
|
||||
<Text>{transaksi.Investasi.author.username}</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Nomor Telephone</Text>
|
||||
<Text>{transaksi.Investasi.author.nomor}</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Nama Proyek Investasi </Text>
|
||||
<Text>{transaksi.Investasi.title}</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Paper>
|
||||
<Paper withBorder p={"md"}>
|
||||
<Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Transaksi ID</Text>
|
||||
<Text>{transaksi.transaction_id}</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Lembar Terbeli</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID").format(+transaksi.quantity)} lembar</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Total Transfer</Text>
|
||||
<Text>Rp. {new Intl.NumberFormat("id-ID", {maximumFractionDigits: 10}).format(+transaksi.gross_amount)}</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Tipe Pembayaran</Text>
|
||||
<Text>{transaksi.payment_type.replace('_', " ")}</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Nama Bank</Text>
|
||||
<Text>{transaksi.namaBank}</Text>
|
||||
</Stack>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"}>Status Pembayaran</Text>
|
||||
<Text>{transaksi.status_message}</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Paper>
|
||||
<Button radius={"xl"} onClick={() => router.push(RouterInvestasi.main_transaksi)}>
|
||||
Kembali ke List Transaksi
|
||||
</Button>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -68,8 +68,8 @@ export default function TransaksiInvestasi({
|
||||
<>
|
||||
<Stack>
|
||||
{transaksi.map((e) => (
|
||||
<Box key={e.id}>
|
||||
<Link href={e.redirect_url} style={{textDecorationLine: "none"}}>
|
||||
<Box key={e.id} onClick={() => router.push(RouterInvestasi.status_pesanan + `${e.id}`)}>
|
||||
|
||||
<Paper p="xs" bg={"gray"}>
|
||||
<Group position="apart">
|
||||
<Title order={6}>{e.Investasi.title}</Title>
|
||||
@@ -86,62 +86,8 @@ export default function TransaksiInvestasi({
|
||||
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
||||
</Stack>
|
||||
<Text>{e.quantity} Lembar</Text>
|
||||
{/* {(() => {
|
||||
if (e.masterStatusTransaksiInvestasiId === "1") {
|
||||
return (
|
||||
<>
|
||||
<Title
|
||||
order={5}
|
||||
c={e.MasterStatusTransaksiInvestasi.color}
|
||||
>
|
||||
{e.MasterStatusTransaksiInvestasi.name}
|
||||
</Title>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
if (e.masterStatusTransaksiInvestasiId === "2") {
|
||||
return (
|
||||
<>
|
||||
<Title
|
||||
order={5}
|
||||
c={e.MasterStatusTransaksiInvestasi.color}
|
||||
>
|
||||
{e.MasterStatusTransaksiInvestasi.name}
|
||||
</Title>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
if (e.masterStatusTransaksiInvestasiId === "3") {
|
||||
return (
|
||||
<>
|
||||
<>
|
||||
<Title
|
||||
order={5}
|
||||
c={e.MasterStatusTransaksiInvestasi.color}
|
||||
>
|
||||
{e.MasterStatusTransaksiInvestasi.name}
|
||||
</Title>
|
||||
</>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Title
|
||||
order={5}
|
||||
c={e.MasterStatusTransaksiInvestasi.color}
|
||||
>
|
||||
{e.MasterStatusTransaksiInvestasi.name}
|
||||
</Title>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
})()} */}
|
||||
</Group>
|
||||
</Paper>
|
||||
</Link>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
14
src/bin/seeder/investasi/master_progres.json
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"id": "1",
|
||||
"name": "Dalam Proses"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"name": "Selesai"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"name": "Waktu Habis"
|
||||
}
|
||||
]
|
||||