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?
|
UserSession UserSession?
|
||||||
Profile Profile?
|
Profile Profile?
|
||||||
Investasi Investasi[]
|
Investasi Investasi[]
|
||||||
// Investor Investor[]
|
|
||||||
TransaksiInvestasi TransaksiInvestasi[]
|
TransaksiInvestasi TransaksiInvestasi[]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,19 +123,17 @@ model Investasi {
|
|||||||
masterPembagianDevidenId String?
|
masterPembagianDevidenId String?
|
||||||
MasterPencarianInvestor MasterPencarianInvestor? @relation(fields: [masterPencarianInvestorId], references: [id])
|
MasterPencarianInvestor MasterPencarianInvestor? @relation(fields: [masterPencarianInvestorId], references: [id])
|
||||||
masterPencarianInvestorId String?
|
masterPencarianInvestorId String?
|
||||||
|
|
||||||
ImageInvestasi Images? @relation(fields: [imagesId], references: [id])
|
ImageInvestasi Images? @relation(fields: [imagesId], references: [id])
|
||||||
imagesId String? @unique
|
imagesId String? @unique
|
||||||
|
|
||||||
ProspektusInvestasi ProspektusInvestasi?
|
|
||||||
|
|
||||||
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
|
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
|
||||||
masterStatusInvestasiId String? @default("2")
|
masterStatusInvestasiId String? @default("2")
|
||||||
|
ProspektusInvestasi ProspektusInvestasi?
|
||||||
BeritaInvestasi BeritaInvestasi[]
|
BeritaInvestasi BeritaInvestasi[]
|
||||||
DokumenInvestasi DokumenInvestasi[]
|
DokumenInvestasi DokumenInvestasi[]
|
||||||
|
TransaksiInvestasi TransaksiInvestasi[]
|
||||||
// Investor Investor[]
|
MasterProgresInvestasi MasterProgresInvestasi? @relation(fields: [masterProgresInvestasiId], references: [id])
|
||||||
TransaksiInvestasi TransaksiInvestasi[]
|
masterProgresInvestasiId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
model MasterPencarianInvestor {
|
model MasterPencarianInvestor {
|
||||||
@@ -219,6 +216,15 @@ model MasterBank {
|
|||||||
updatedAt DateTime @updatedAt
|
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 {
|
model TransaksiInvestasi {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
Investasi Investasi @relation(fields: [investasiId], references: [id])
|
Investasi Investasi @relation(fields: [investasiId], references: [id])
|
||||||
@@ -262,16 +268,3 @@ model MasterStatusTransaksiInvestasi {
|
|||||||
TransaksiInvestasi TransaksiInvestasi[]
|
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 {
|
} else {
|
||||||
try {
|
try {
|
||||||
await fetch(
|
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({
|
return NextResponse.json({
|
||||||
body,
|
body,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export async function GET(
|
|||||||
req: NextRequest,
|
req: NextRequest,
|
||||||
{ params }: { params: { id: string } }
|
{ params }: { params: { id: string } }
|
||||||
) {
|
) {
|
||||||
|
|
||||||
const data = await prisma.images.findUnique({
|
const data = await prisma.images.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: params.id,
|
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,
|
req: NextRequest,
|
||||||
{ params }: { params: { id: string } }
|
{ params }: { params: { id: string } }
|
||||||
) {
|
) {
|
||||||
console.log(params.id)
|
// console.log(params.id)
|
||||||
const data = await prisma.prospektusInvestasi.findUnique({
|
const data = await prisma.prospektusInvestasi.findUnique({
|
||||||
where: { id: params.id },
|
where: { id: params.id },
|
||||||
select: {
|
select: {
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import pembagianDeviden from "./../../../bin/seeder/investasi/pembagian_deviden.
|
|||||||
import statusInvestasi from "./../../../bin/seeder/investasi/status_investasi.json";
|
import statusInvestasi from "./../../../bin/seeder/investasi/status_investasi.json";
|
||||||
import namaBank from "./../../../bin/seeder/investasi/nama_bank.json";
|
import namaBank from "./../../../bin/seeder/investasi/nama_bank.json";
|
||||||
import statusTransaksiInvestasi from "./../../../bin/seeder/investasi/status_transaksi_investasi.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) {
|
export async function GET(req: Request) {
|
||||||
const dev = new URL(req.url).searchParams.get("dev");
|
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) {
|
for (let i of bidangBisnis) {
|
||||||
await prisma.masterBidangBisnis.upsert({
|
await prisma.masterBidangBisnis.upsert({
|
||||||
where: {
|
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 });
|
return NextResponse.json({ success: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
|
|
||||||
const totalInvestor = await funTotalInvestorByIdInvestasi(dataInvestasi?.id)
|
const totalInvestor = await funTotalInvestorByIdInvestasi(dataInvestasi?.id)
|
||||||
|
|
||||||
|
// console.log(dataInvestasi?.MasterProgresInvestasi?.name)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DetailInvestasi
|
<DetailInvestasi
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DetailSahamTerbeli } from "@/app_modules/investasi";
|
import { DetailSahamTerbeli } from "@/app_modules/investasi";
|
||||||
import funTotalInvestorByIdInvestasi from "@/app_modules/investasi/fun/fun_total_investor_by_id";
|
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 } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataTransaksi = await getOneTransaksiBerhasilByIdInvestasi(params.id);
|
const dataTransaksi = await getOneTransaksiBerhasilByIdInvestasi(params.id);
|
||||||
|
|||||||
@@ -1,24 +1,44 @@
|
|||||||
import { MainInvestasi } from "@/app_modules/investasi";
|
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 { getListAllPublish } from "@/app_modules/investasi/fun/get_list_all_publish";
|
||||||
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
import getPencarianInvestor from "@/app_modules/investasi/fun/master/get_pencarian_investor";
|
|
||||||
import getPeriodeDeviden from "@/app_modules/investasi/fun/master/get_periode_deviden";
|
import _ from "lodash";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const data = await getListAllPublish();
|
const dataOnProgres = await getListAllPublish("1");
|
||||||
const pencarianInvestor = await getPencarianInvestor();
|
const dataSelesai = await getListAllPublish("2");
|
||||||
const periodeDeviden = await getPeriodeDeviden();
|
const dataWaktuHabis = await getListAllPublish("3");
|
||||||
const pembagianDeviden = await getPembagianDeviden();
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<MainInvestasi
|
<MainInvestasi
|
||||||
listData={data as any}
|
listData={allData as any}
|
||||||
pencarianInvestor={pencarianInvestor as any}
|
dataSelesai={dataSelesai as any}
|
||||||
periodeDeviden={periodeDeviden as any}
|
dataWaktuHabis={dataWaktuHabis as any}
|
||||||
pembagianDeviden={pembagianDeviden as any}
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
|
|
||||||
const userLogin = await funGetUserProfile(user.id);
|
const userLogin = await funGetUserProfile(user.id);
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
// console.log(userLogin);
|
|
||||||
|
// console.log(dataInvestasi);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProsesTransaksiInvestasi
|
<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_gambar: "/api/investasi/gambar/",
|
||||||
api_file_prospektus: "/api/investasi/prospektus/",
|
api_file_prospektus: "/api/investasi/prospektus/",
|
||||||
api_file_dokumen: "/api/investasi/dokumen/",
|
api_file_dokumen: "/api/investasi/dokumen/",
|
||||||
|
api_get_notif_midtrans: "/api/investasi/midtrans",
|
||||||
|
|
||||||
//INVESTASI
|
//INVESTASI
|
||||||
main: "/dev/investasi/main",
|
main: "/dev/investasi/main",
|
||||||
@@ -20,6 +21,7 @@ export const RouterInvestasi = {
|
|||||||
proses_investasi: "/dev/investasi/proses_investasi/",
|
proses_investasi: "/dev/investasi/proses_investasi/",
|
||||||
proses_transaksi: "/dev/investasi/proses_transaksi/",
|
proses_transaksi: "/dev/investasi/proses_transaksi/",
|
||||||
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
||||||
|
status_pesanan:"/dev/investasi/status_pesanan/",
|
||||||
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
||||||
metode_transfer: "/dev/investasi/metode_transfer/",
|
metode_transfer: "/dev/investasi/metode_transfer/",
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function onPublish() {
|
async function onPublish() {
|
||||||
await funGantiStatusInvestasi(investasi.id, "3").then((res) => {
|
await funGantiStatusInvestasi(investasi.id, "3", "1").then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setTimeout(() => setPublish(false), 1000);
|
setTimeout(() => setPublish(false), 1000);
|
||||||
router.push(RouterAdminInvestasi.table_status_review);
|
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")
|
// toast("Berhasil disimpan")
|
||||||
|
|
||||||
// if (_.values(body).includes("")) return toast("Lengkapi data");
|
// if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||||
if (!fl) return toast("Gambar Kosong");
|
if (!fl) return toast("Gambar Kosong");
|
||||||
if (!pdf) return toast("File Kosong");
|
if (!pdf) return toast("File Kosong");
|
||||||
|
|
||||||
const gmbr = new FormData();
|
const gmbr = new FormData();
|
||||||
gmbr.append("file", fl);
|
gmbr.append("file", fl);
|
||||||
|
|
||||||
const flPdf = new FormData();
|
const flPdf = new FormData();
|
||||||
flPdf.append("file", pdf);
|
flPdf.append("file", pdf as any);
|
||||||
|
|
||||||
await funCreateInvestasi(gmbr, flPdf, body as any).then((res) => {
|
await funCreateInvestasi(gmbr, flPdf, body as any).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
// toast(res.message);
|
// toast(res.message);
|
||||||
setChangeColor(1);
|
setChangeColor(1);
|
||||||
setActiveTab("Review");
|
setActiveTab("Review");
|
||||||
router.push(RouterInvestasi.dialog_create);
|
router.push(RouterInvestasi.dialog_create);
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onTotalLembar(target: any, harga: any) {
|
async function onTotalLembar(target: any, harga: any) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import {
|
|||||||
IconCircleCheck,
|
IconCircleCheck,
|
||||||
IconFileDescription,
|
IconFileDescription,
|
||||||
IconSpeakerphone,
|
IconSpeakerphone,
|
||||||
|
IconXboxX,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -41,13 +42,13 @@ export default function DetailInvestasi({
|
|||||||
dataUser,
|
dataUser,
|
||||||
loginUserId,
|
loginUserId,
|
||||||
progress,
|
progress,
|
||||||
totalInvestor
|
totalInvestor,
|
||||||
}: {
|
}: {
|
||||||
dataInvestasi: MODEL_Investasi;
|
dataInvestasi: MODEL_Investasi;
|
||||||
dataUser: MODEL_User_profile;
|
dataUser: MODEL_User_profile;
|
||||||
loginUserId: string;
|
loginUserId: string;
|
||||||
progress: number;
|
progress: number;
|
||||||
totalInvestor: number
|
totalInvestor: number;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [investasi, setInvestasi] = useState(dataInvestasi);
|
const [investasi, setInvestasi] = useState(dataInvestasi);
|
||||||
@@ -102,22 +103,54 @@ export default function DetailInvestasi({
|
|||||||
</Avatar>
|
</Avatar>
|
||||||
<Text>{user.username}</Text>
|
<Text>{user.username}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
{Number(investasi.MasterPencarianInvestor.name) -
|
{investasi.MasterProgresInvestasi.id === "1" ? (
|
||||||
moment(new Date()).diff(new Date(investasi.countDown), "days") <=
|
<Box>
|
||||||
0 ? (
|
<Group position="right" spacing={"xs"}>
|
||||||
<Group position="right">
|
<Text>Sisa waktu:</Text>
|
||||||
<IconCircleCheck color="green" />
|
<Text>
|
||||||
<Text c={"green"}>Selesai</Text>
|
{Number(investasi.MasterPencarianInvestor.name) -
|
||||||
</Group>
|
moment(new Date()).diff(
|
||||||
|
new Date(investasi.countDown),
|
||||||
|
"days"
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
<Text>Hari</Text>
|
||||||
|
</Group>
|
||||||
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<Group position="right" spacing={"xs"}>
|
<Box>
|
||||||
<Text>Sisa waktu:</Text>
|
{investasi.MasterProgresInvestasi.id === "2" ? (
|
||||||
<Text>
|
<Group position="right" spacing={"xs"}>
|
||||||
{Number(investasi.MasterPencarianInvestor.name) -
|
<IconCircleCheck color="green" />
|
||||||
moment(new Date()).diff(new Date(investasi.countDown), "days")}
|
<Text
|
||||||
</Text>
|
truncate
|
||||||
<Text>Hari</Text>
|
variant="text"
|
||||||
</Group>
|
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>
|
</Group>
|
||||||
|
|
||||||
@@ -192,9 +225,13 @@ export default function DetailInvestasi({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Investor</Text>
|
<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>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>ROI</Text>
|
<Text>ROI</Text>
|
||||||
@@ -242,25 +279,38 @@ export default function DetailInvestasi({
|
|||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{loginUserId === investasi.authorId ? (
|
{investasi.sisaLembar === "0" ||
|
||||||
|
Number(investasi.MasterPencarianInvestor.name) -
|
||||||
|
moment(new Date()).diff(new Date(investasi.countDown), "days") <=
|
||||||
|
0 ? (
|
||||||
<Center mb={"md"}>
|
<Center mb={"md"}>
|
||||||
<Button disabled radius={50} w={350}>
|
<Button disabled radius={50} w={350} variant="transparent">
|
||||||
Investasi Ini Milik Anda
|
Investasi Telah Ditutup
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
) : (
|
) : (
|
||||||
<Center mb={"md"}>
|
<Box>
|
||||||
<Button
|
{loginUserId === investasi.authorId ? (
|
||||||
radius={50}
|
<Center mb={"md"}>
|
||||||
w={350}
|
<Button disabled radius={50} w={350}>
|
||||||
bg={Warna.biru}
|
Investasi Ini Milik Anda
|
||||||
onClick={() => {
|
</Button>
|
||||||
onSubmit();
|
</Center>
|
||||||
}}
|
) : (
|
||||||
>
|
<Center mb={"md"}>
|
||||||
Beli Saham
|
<Button
|
||||||
</Button>
|
radius={50}
|
||||||
</Center>
|
w={350}
|
||||||
|
bg={Warna.biru}
|
||||||
|
onClick={() => {
|
||||||
|
onSubmit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Beli Saham
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,19 +20,20 @@ export default function LayoutDialogPageCreateInvestasi({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
setTimeout(() => router.push(RouterInvestasi.portofolio), 3000)
|
setTimeout(() => router.push(RouterInvestasi.portofolio), 3000);
|
||||||
},[])
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell
|
<AppShell
|
||||||
footer={
|
footer={
|
||||||
<Footer height={70} sx={{ borderStyle: "none" }}>
|
<Footer height={80} sx={{ borderStyle: "none" }}>
|
||||||
<Group spacing={4} position="center">
|
<Group spacing={4} position="center">
|
||||||
<IconAlertTriangle color="orange" size={20} />
|
<IconAlertTriangle color="orange" size={20} />
|
||||||
<Text fz={"sm"}>Proyek Investasi anda akan berstatus DRAFT</Text>
|
<Text fz={"sm"}>Mohon menunggu validasi Admin</Text>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
</Footer>
|
</Footer>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import fs from "fs";
|
|||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { MODEL_Investasi } from "../model/model_investasi";
|
import { MODEL_Investasi } from "../model/model_investasi";
|
||||||
|
import funUploadProspektusInvestasi from "./fun_upload_prospek";
|
||||||
|
|
||||||
export async function funCreateInvestasi(
|
export async function funCreateInvestasi(
|
||||||
gamabar: FormData,
|
gamabar: FormData,
|
||||||
@@ -47,8 +48,8 @@ export async function funCreateInvestasi(
|
|||||||
totalLembar: data.totalLembar.toString(),
|
totalLembar: data.totalLembar.toString(),
|
||||||
sisaLembar: data.totalLembar.toString(),
|
sisaLembar: data.totalLembar.toString(),
|
||||||
roi: data.roi.toString(),
|
roi: data.roi.toString(),
|
||||||
masterPembagianDevidenId: data.masterPeriodeDevidenId,
|
masterPembagianDevidenId: data.masterPembagianDevidenId,
|
||||||
masterPeriodeDevidenId: data.masterPembagianDevidenId,
|
masterPeriodeDevidenId: data.masterPeriodeDevidenId,
|
||||||
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
||||||
imagesId: uploadImage.id,
|
imagesId: uploadImage.id,
|
||||||
masterStatusInvestasiId: "2",
|
masterStatusInvestasiId: "2",
|
||||||
@@ -62,26 +63,31 @@ export async function funCreateInvestasi(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// File upload function
|
// File upload function
|
||||||
const dataPdf: any = filePdf.get("file");
|
// const dataPdf: any = filePdf.get("file");
|
||||||
const pdfName = dataPdf.name;
|
// const pdfName = dataPdf.name;
|
||||||
const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
// const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
||||||
const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
// const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
||||||
|
|
||||||
const uploadFile = await prisma.prospektusInvestasi.create({
|
// const uploadFile = await prisma.prospektusInvestasi.create({
|
||||||
data: {
|
// data: {
|
||||||
investasiId: createInvest.id,
|
// investasiId: createInvest.id,
|
||||||
url: pdfRandomName,
|
// url: pdfRandomName,
|
||||||
},
|
// },
|
||||||
select: {
|
// select: {
|
||||||
id: true,
|
// id: true,
|
||||||
url: 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 updloadPDF = await funUploadProspektusInvestasi(
|
||||||
const upPdfFolder = Buffer.from(await file.arrayBuffer());
|
filePdf,
|
||||||
fs.writeFileSync(`./public/file/${uploadFile.url}`, upPdfFolder);
|
createInvest.id
|
||||||
|
);
|
||||||
|
// console.log(updloadPDF);
|
||||||
|
|
||||||
revalidatePath(RouterInvestasi.main_porto);
|
revalidatePath(RouterInvestasi.main_porto);
|
||||||
|
|
||||||
|
|||||||
@@ -6,28 +6,64 @@ import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export default async function funGantiStatusInvestasi(id: string, val: string) {
|
export default async function funGantiStatusInvestasi(
|
||||||
const publishCD = new Date
|
id: string,
|
||||||
const data = await prisma.investasi.update({
|
statusInves: string,
|
||||||
where: {
|
statusProgres?: string
|
||||||
id: id,
|
) {
|
||||||
},
|
console.log(statusProgres)
|
||||||
data: {
|
if (statusProgres === '1') {
|
||||||
MasterStatusInvestasi: {
|
const publishCD = new Date();
|
||||||
connect: {
|
const data = await prisma.investasi.update({
|
||||||
id: val,
|
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(RouterInvestasi.portofolio);
|
||||||
revalidatePath(RouterAdminInvestasi.main_investasi);
|
revalidatePath(RouterAdminInvestasi.main_investasi);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
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 prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_Investasi } from "../model/model_investasi";
|
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({
|
const res = await prisma.investasi.update({
|
||||||
where: {
|
where: {
|
||||||
id: data.id,
|
id: dataLembarSaham.id,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
sisaLembar: "" + data.sisaLembar,
|
sisaLembar: "" + dataLembarSaham.sisaLembar,
|
||||||
|
progress: "" + progres,
|
||||||
|
lembarTerbeli: "" + jumlahTerbeli,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!res) return { status: 400, message: "Gagal update" };
|
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 {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Update berhasil",
|
message: "Update berhasil",
|
||||||
|
|||||||
@@ -20,17 +20,39 @@ export interface Model_Midtrans_Success {
|
|||||||
finish_redirect_url: string;
|
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(
|
export default async function funUpdatePaymentInvestasi(
|
||||||
data: Model_Midtrans_Success,
|
data: Model_Midtrans_Success,
|
||||||
idPay: any,
|
body: Model_Body,
|
||||||
|
token: Model_Token
|
||||||
) {
|
) {
|
||||||
console.log(data)
|
|
||||||
if (data.status_code === "200") {
|
if (data.status_code === "200") {
|
||||||
const res = await prisma.transaksiInvestasi.update({
|
const res = await prisma.transaksiInvestasi.create({
|
||||||
where: {
|
|
||||||
id: idPay,
|
|
||||||
},
|
|
||||||
data: {
|
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_code: data.status_code,
|
||||||
status_message: data.status_message,
|
status_message: data.status_message,
|
||||||
order_id: data.order_id,
|
order_id: data.order_id,
|
||||||
@@ -48,49 +70,12 @@ export default async function funUpdatePaymentInvestasi(
|
|||||||
|
|
||||||
if (!res) return { status: 400, message: "Gagal update transaksi" };
|
if (!res) return { status: 400, message: "Gagal update transaksi" };
|
||||||
|
|
||||||
// const jumlah = Number(res.quantity);
|
revalidatePath(RouterInvestasi.main_transaksi);
|
||||||
// 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)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
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";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
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() {
|
if (status === "1") {
|
||||||
const data = await prisma.investasi.findMany({
|
const data = await prisma.investasi.findMany({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
countDown: "asc",
|
countDown: "asc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
MasterStatusInvestasi: {
|
MasterStatusInvestasi: {
|
||||||
name: {
|
name: {
|
||||||
equals: "Publish",
|
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,
|
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: {
|
return data;
|
||||||
id: true,
|
}
|
||||||
title: true,
|
if (status === "2") {
|
||||||
authorId: true,
|
const data = await prisma.investasi.findMany({
|
||||||
hargaLembar: true,
|
orderBy: {
|
||||||
targetDana: true,
|
masterPencarianInvestorId: "asc",
|
||||||
totalLembar: true,
|
},
|
||||||
sisaLembar: true,
|
where: {
|
||||||
progress: true,
|
MasterStatusInvestasi: {
|
||||||
roi: true,
|
name: {
|
||||||
active: true,
|
equals: "Publish",
|
||||||
createdAt: true,
|
},
|
||||||
updatedAt: true,
|
},
|
||||||
imagesId: true,
|
AND: {
|
||||||
MasterStatusInvestasi: true,
|
MasterProgresInvestasi: {
|
||||||
BeritaInvestasi: true,
|
id: "2",
|
||||||
DokumenInvestasi: true,
|
},
|
||||||
ProspektusInvestasi: true,
|
},
|
||||||
MasterPembagianDeviden: true,
|
},
|
||||||
MasterPencarianInvestor: true,
|
select: {
|
||||||
MasterPeriodeDeviden: true,
|
id: true,
|
||||||
countDown: true,
|
title: true,
|
||||||
},
|
authorId: true,
|
||||||
});
|
hargaLembar: true,
|
||||||
|
targetDana: true,
|
||||||
return data;
|
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,
|
MasterPembagianDeviden: true,
|
||||||
MasterPencarianInvestor: true,
|
MasterPencarianInvestor: true,
|
||||||
MasterPeriodeDeviden: true,
|
MasterPeriodeDeviden: true,
|
||||||
|
MasterProgresInvestasi: true,
|
||||||
author: true,
|
author: true,
|
||||||
countDown: true
|
countDown: true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,15 +6,18 @@ export default async function getOneTransaksiBerhasilByIdInvestasi(
|
|||||||
idTransaksi: string
|
idTransaksi: string
|
||||||
) {
|
) {
|
||||||
const data = await prisma.transaksiInvestasi.findUnique({
|
const data = await prisma.transaksiInvestasi.findUnique({
|
||||||
|
|
||||||
where: {
|
where: {
|
||||||
id: idTransaksi,
|
id: idTransaksi,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
Investasi: {
|
Investasi: {
|
||||||
select: {
|
select: {
|
||||||
|
author: {
|
||||||
author: true,
|
select: {
|
||||||
|
nomor: true,
|
||||||
|
username: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
BeritaInvestasi: true,
|
BeritaInvestasi: true,
|
||||||
DokumenInvestasi: true,
|
DokumenInvestasi: true,
|
||||||
ProspektusInvestasi: true,
|
ProspektusInvestasi: true,
|
||||||
@@ -35,6 +38,10 @@ export default async function getOneTransaksiBerhasilByIdInvestasi(
|
|||||||
id: true,
|
id: true,
|
||||||
gross_amount: true,
|
gross_amount: true,
|
||||||
quantity: 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: {
|
customer_details: {
|
||||||
first_name: body.customer_name,
|
first_name: body.customer_name,
|
||||||
phone: body.phone,
|
phone: body.phone,
|
||||||
// email: "test@midtrans.com",
|
|
||||||
},
|
},
|
||||||
enabled_payments: [
|
enabled_payments: [
|
||||||
"permata_va",
|
"permata_va",
|
||||||
@@ -45,7 +44,7 @@ export default async function getTokenTransaksi(data) {
|
|||||||
"shopeepay",
|
"shopeepay",
|
||||||
],
|
],
|
||||||
bca_va: {
|
bca_va: {
|
||||||
va_number: "82340374411111",
|
va_number: "7725699636222",
|
||||||
sub_company_code: "00000",
|
sub_company_code: "00000",
|
||||||
free_text: {
|
free_text: {
|
||||||
inquiry: [
|
inquiry: [
|
||||||
@@ -81,25 +80,15 @@ export default async function getTokenTransaksi(data) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// console.log(token)
|
||||||
|
|
||||||
if (token.status === 400) {
|
if (token.status === 400) {
|
||||||
return { token: token };
|
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 {
|
return {
|
||||||
token: token,
|
token: token,
|
||||||
dataTransaksi: newTransaksi,
|
// dataTransaksi: newTransaksi,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ export default async function getTransaksiByIdInvestasi(id: string) {
|
|||||||
id: true,
|
id: true,
|
||||||
namaBank: true,
|
namaBank: true,
|
||||||
nomorRekening: true,
|
nomorRekening: true,
|
||||||
|
transaction_id: true,
|
||||||
|
quantity: true,
|
||||||
|
gross_amount: true,
|
||||||
|
status_message: true,
|
||||||
active: true,
|
active: true,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
updatedAt: true,
|
updatedAt: true,
|
||||||
|
|||||||
@@ -13,3 +13,5 @@ export const gs_TransferValue = atomWithStorage("gs_TransferValue", {
|
|||||||
namaBank: "",
|
namaBank: "",
|
||||||
nomorRekening: "",
|
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 LayoutUploadDokumenInvestasi from "./upload_dokumen/layout";
|
||||||
import ProsesTransaksiInvestasi from "./proses_transaksi/view";
|
import ProsesTransaksiInvestasi from "./proses_transaksi/view";
|
||||||
import LayoutProsesTransaksiInvestasi from "./proses_transaksi/layout";
|
import LayoutProsesTransaksiInvestasi from "./proses_transaksi/layout";
|
||||||
|
import StatusPesananInvetsatsi from "./status_pesanan/view";
|
||||||
|
import LayoutStatusPesananInvestasi from "./status_pesanan/layout";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
MainInvestasi,
|
MainInvestasi,
|
||||||
@@ -134,4 +136,6 @@ export {
|
|||||||
LayoutUploadDokumenInvestasi,
|
LayoutUploadDokumenInvestasi,
|
||||||
ProsesTransaksiInvestasi,
|
ProsesTransaksiInvestasi,
|
||||||
LayoutProsesTransaksiInvestasi,
|
LayoutProsesTransaksiInvestasi,
|
||||||
|
StatusPesananInvetsatsi,
|
||||||
|
LayoutStatusPesananInvestasi,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import dataDummy from "../dummy/data_dummy.json";
|
import dataDummy from "../dummy/data_dummy.json";
|
||||||
import moment from "moment";
|
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 { MODEL_Investasi } from "../model/model_investasi";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -35,39 +35,23 @@ import { Warna } from "@/app/lib/warna";
|
|||||||
|
|
||||||
export default function MainInvestasi({
|
export default function MainInvestasi({
|
||||||
listData,
|
listData,
|
||||||
pencarianInvestor,
|
dataSelesai,
|
||||||
periodeDeviden,
|
dataWaktuHabis,
|
||||||
pembagianDeviden,
|
|
||||||
}: {
|
}: {
|
||||||
listData: MODEL_Investasi[];
|
listData: MODEL_Investasi[];
|
||||||
pencarianInvestor: MODEL_DEFAULT_MASTER[];
|
dataSelesai: MODEL_Investasi[];
|
||||||
periodeDeviden: MODEL_DEFAULT_MASTER[];
|
dataWaktuHabis: MODEL_Investasi[];
|
||||||
pembagianDeviden: MODEL_DEFAULT_MASTER[];
|
|
||||||
}) {
|
}) {
|
||||||
|
// console.log(listData)
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [investasi, setInvestasi] = useState(listData);
|
const [investasi, setInvestasi] = useState(listData);
|
||||||
|
const [invesDone, setInvesDone] = useState(dataSelesai);
|
||||||
|
const [invesFail, setInvesFail] = useState(dataWaktuHabis);
|
||||||
const [statusPublish, setStatusPublish] = useState(false);
|
const [statusPublish, setStatusPublish] = useState(false);
|
||||||
|
|
||||||
async function onProgres(data: MODEL_Investasi) {
|
// console.log(dataWaktuHabis)
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// useShallowEffect(() => {
|
if (_.isEmpty(investasi) && _.isEmpty(invesDone) && _.isEmpty(invesFail))
|
||||||
// onStatusPublish(investasi)
|
|
||||||
// },[investasi])
|
|
||||||
|
|
||||||
// async function onStatusPublish(investasi : MODEL_Investasi[]) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (_.isEmpty(investasi))
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -79,7 +63,6 @@ export default function MainInvestasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(listData, null, 2)}</pre> */}
|
|
||||||
|
|
||||||
{investasi.map((e) => (
|
{investasi.map((e) => (
|
||||||
<Card
|
<Card
|
||||||
@@ -104,25 +87,12 @@ export default function MainInvestasi({
|
|||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</CardSection>
|
</CardSection>
|
||||||
|
|
||||||
{/* Progress dan titlr */}
|
|
||||||
<CardSection p={"lg"}>
|
<CardSection p={"lg"}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Title order={4}>{e.title}</Title>
|
<Title order={4}>{e.title}</Title>
|
||||||
<Progress
|
<Progress
|
||||||
label={
|
label={(+e.progress).toFixed(2) + " %"}
|
||||||
"" +
|
value={+e.progress}
|
||||||
(
|
|
||||||
((+e.totalLembar - +e.sisaLembar) / +e.totalLembar) *
|
|
||||||
100
|
|
||||||
).toFixed(1) +
|
|
||||||
"%"
|
|
||||||
}
|
|
||||||
value={
|
|
||||||
+(
|
|
||||||
((+e.totalLembar - +e.sisaLembar) / +e.totalLembar) *
|
|
||||||
100
|
|
||||||
).toFixed(1)
|
|
||||||
}
|
|
||||||
color="teal"
|
color="teal"
|
||||||
size="xl"
|
size="xl"
|
||||||
radius="xl"
|
radius="xl"
|
||||||
@@ -151,7 +121,6 @@ export default function MainInvestasi({
|
|||||||
{new Intl.NumberFormat("id-ID", {
|
{new Intl.NumberFormat("id-ID", {
|
||||||
maximumSignificantDigits: 10,
|
maximumSignificantDigits: 10,
|
||||||
}).format(+e.hargaLembar)}
|
}).format(+e.hargaLembar)}
|
||||||
{/* {e.hargaLembar} */}
|
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -179,15 +148,6 @@ export default function MainInvestasi({
|
|||||||
<Divider color="dark.4" />
|
<Divider color="dark.4" />
|
||||||
<CardSection p={"md"}>
|
<CardSection p={"md"}>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
{/* <Box>
|
|
||||||
{e.SahamTerbeli === null ? (
|
|
||||||
""
|
|
||||||
) : (
|
|
||||||
<Badge variant="dot" color="teal">
|
|
||||||
Saham Anda
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
</Box> */}
|
|
||||||
<Button
|
<Button
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
compact
|
compact
|
||||||
@@ -198,48 +158,55 @@ export default function MainInvestasi({
|
|||||||
Details
|
Details
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{(() => {
|
{e.progress === "100" ? (
|
||||||
if (
|
<Group position="right" spacing={"xs"}>
|
||||||
Number(e.MasterPencarianInvestor.name) -
|
<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") <=
|
moment(new Date()).diff(new Date(e.countDown), "days") <=
|
||||||
0
|
0 ? (
|
||||||
) {
|
<Group position="right" spacing={"xs"}>
|
||||||
return (
|
<IconXboxX color="red" />
|
||||||
<>
|
<Text
|
||||||
<Group position="right" spacing={"xs"}>
|
truncate
|
||||||
<IconCircleCheck color="green" />
|
variant="text"
|
||||||
<Text
|
c={Warna.merah}
|
||||||
truncate
|
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
||||||
variant="text"
|
ta="center"
|
||||||
c={Warna.hijau_tua}
|
fz="md"
|
||||||
sx={{ fontFamily: "Greycliff CF, sans-serif" }}
|
fw={700}
|
||||||
ta="center"
|
>
|
||||||
fz="md"
|
Waktu Habis
|
||||||
fw={700}
|
</Text>
|
||||||
>
|
</Group>
|
||||||
Waktu Habis
|
) : (
|
||||||
</Text>
|
<Group position="right" spacing={"xs"}>
|
||||||
</Group>
|
<Text truncate>Sisa waktu:</Text>
|
||||||
</>
|
<Text truncate>
|
||||||
);
|
{Number(e.MasterPencarianInvestor.name) -
|
||||||
} else {
|
moment(new Date()).diff(
|
||||||
return (
|
new Date(e.countDown),
|
||||||
<>
|
"days"
|
||||||
<Group position="right" spacing={"xs"}>
|
)}
|
||||||
<Text truncate>Sisa waktu:</Text>
|
</Text>
|
||||||
<Text truncate>
|
<Text truncate>Hari</Text>
|
||||||
{Number(e.MasterPencarianInvestor.name) -
|
</Group>
|
||||||
moment(new Date()).diff(
|
)}
|
||||||
new Date(e.countDown),
|
</Box>
|
||||||
"days"
|
)}
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
<Text truncate>Hari</Text>
|
|
||||||
</Group>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})()}
|
|
||||||
</Group>
|
</Group>
|
||||||
</CardSection>
|
</CardSection>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export interface MODEL_Investasi {
|
|||||||
MasterPembagianDeviden: Model_All_Master;
|
MasterPembagianDeviden: Model_All_Master;
|
||||||
MasterPencarianInvestor: Model_All_Master;
|
MasterPencarianInvestor: Model_All_Master;
|
||||||
MasterPeriodeDeviden: Model_All_Master;
|
MasterPeriodeDeviden: Model_All_Master;
|
||||||
|
MasterProgresInvestasi: Model_All_Master,
|
||||||
masterPeriodeDevidenId: string;
|
masterPeriodeDevidenId: string;
|
||||||
masterPembagianDevidenId: string;
|
masterPembagianDevidenId: string;
|
||||||
masterPencarianInvestorId: string;
|
masterPencarianInvestorId: string;
|
||||||
@@ -34,6 +35,9 @@ export interface MODEL_Transaksi_Investasi {
|
|||||||
id: string;
|
id: string;
|
||||||
namaBank: string;
|
namaBank: string;
|
||||||
nomorRekening: string;
|
nomorRekening: string;
|
||||||
|
transaction_id: string,
|
||||||
|
status_message: string
|
||||||
|
payment_type: string,
|
||||||
active: boolean;
|
active: boolean;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
|
|||||||
@@ -1,18 +1,43 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import HeaderTamplate from "@/app_modules/component/header_tamplate";
|
import HeaderTamplate from "@/app_modules/component/header_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
import { ActionIcon, AppShell, Box, Group, Header, Text } from "@mantine/core";
|
||||||
import React from "react";
|
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({
|
export default function LayoutProsesTransaksiInvestasi({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
|
const [snapShow, setSnapShow] = useAtom(gs_midtrans_snap);
|
||||||
|
const router = useRouter();
|
||||||
|
// console.log(snapShow)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell header={<HeaderTamplate title="Proses Transaksi" />}>
|
<AppShell
|
||||||
{children}
|
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>
|
</AppShell>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
Container,
|
Container,
|
||||||
Flex,
|
Flex,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useFocusTrap } from "@mantine/hooks";
|
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { MODEL_Investasi } from "../model/model_investasi";
|
import { MODEL_Investasi } from "../model/model_investasi";
|
||||||
import { MODEL_User_profile } from "@/app_modules/home/models/user_profile";
|
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 funUpdatePaymentInvestasi from "../fun/fun_update_payment";
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_investasiFooter } from "../g_state";
|
import { gs_investasiFooter, gs_midtrans_snap } from "../g_state";
|
||||||
import funUpdateInvestasi from "../fun/fun_update_investasi";
|
import funUpdateInvestasi from "../fun/fun_update_investasi";
|
||||||
|
|
||||||
export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||||
@@ -38,6 +38,11 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
|||||||
const [hotmenu, setHotmenu] = useAtom(gs_investasiFooter);
|
const [hotmenu, setHotmenu] = useAtom(gs_investasiFooter);
|
||||||
const [snapShow, setSnapShow] = useState(false);
|
const [snapShow, setSnapShow] = useState(false);
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
setJumlah(0)
|
||||||
|
setTotal(0)
|
||||||
|
},[])
|
||||||
|
|
||||||
// console.log(userLogin.id);
|
// console.log(userLogin.id);
|
||||||
// console.log(investasi);
|
// console.log(investasi);
|
||||||
|
|
||||||
@@ -61,28 +66,29 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
|||||||
await getTokenTransaksi(body).then(async (res) => {
|
await getTokenTransaksi(body).then(async (res) => {
|
||||||
if (res.token.status === 200) {
|
if (res.token.status === 200) {
|
||||||
// console.log(res.token.value.token)
|
// console.log(res.token.value.token)
|
||||||
setSnapShow(true);
|
// setSnapShow(true);
|
||||||
snap.embed(res.token.value.token, {
|
snap.pay(res.token.value.token, {
|
||||||
embedId: "embedId",
|
// embedId: "embedId",
|
||||||
onSuccess: async function (result) {
|
onSuccess: async function (result) {
|
||||||
console.log(result);
|
// setSnapShow(false);
|
||||||
// console.log("success");
|
|
||||||
setSnapShow(false);
|
|
||||||
|
|
||||||
await funUpdatePaymentInvestasi(result, res.dataTransaksi.id).then(
|
await funUpdatePaymentInvestasi(result, body, res.token.value).then(
|
||||||
async (resUpdate) => {
|
async (resUpdate) => {
|
||||||
if (resUpdate.status === 200) {
|
if (resUpdate.status === 200) {
|
||||||
const hasil =
|
// console.log(resUpdate.message)
|
||||||
investasi.sisaLembar - res.dataTransaksi.quantity;
|
const lembarTersisa = investasi.sisaLembar - resUpdate.data.quantity;
|
||||||
|
|
||||||
const body = {
|
const body2 = {
|
||||||
id: investasi.id,
|
id: investasi.id,
|
||||||
sisaLembar: hasil,
|
sisaLembar: lembarTersisa,
|
||||||
};
|
};
|
||||||
|
|
||||||
await funUpdateInvestasi(body);
|
await funUpdateInvestasi(body2, investasi);
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
router.push(RouterInvestasi.main_transaksi);
|
router.push(
|
||||||
|
RouterInvestasi.status_pesanan + `${resUpdate.data.id}`
|
||||||
|
);
|
||||||
|
|
||||||
setHotmenu(3);
|
setHotmenu(3);
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
@@ -91,32 +97,30 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
onPending: async function (result) {
|
onPending: async function (result) {
|
||||||
await funUpdatePaymentInvestasi(result, res.dataTransaksi.id);
|
// console.log("pending");
|
||||||
router.push(RouterInvestasi.proses_transaksi + `${investasi.id}`);
|
// console.log(result);
|
||||||
setSnapShow(false);
|
// await funUpdatePaymentInvestasi(result, res.dataTransaksi.id);
|
||||||
|
// toast(res.message);
|
||||||
console.log("pending");
|
// router.push(
|
||||||
console.log(result);
|
// RouterInvestasi.status_pesanan + `${res.dataTransaksi.id}`
|
||||||
},
|
// );
|
||||||
onError: async function (result) {
|
// router.push(RouterInvestasi.detail + `${investasi.id}`)
|
||||||
await funUpdatePaymentInvestasi(result, res.dataTransaksi.id);
|
await router.push(RouterInvestasi.detail + `${investasi.id}`);
|
||||||
router.push(RouterInvestasi.main_transaksi);
|
setJumlah(0);
|
||||||
setSnapShow(false);
|
|
||||||
|
|
||||||
console.log("error");
|
|
||||||
console.log(result);
|
|
||||||
},
|
},
|
||||||
onClose: async function (result) {
|
onClose: async function (result) {
|
||||||
if (result === undefined) {
|
await router.push(RouterInvestasi.detail + `${investasi.id}`);
|
||||||
const data = {
|
|
||||||
status_code: "400",
|
// if (result === undefined) {
|
||||||
};
|
// const data = {
|
||||||
await funUpdatePaymentInvestasi(data, res.dataTransaksi.id);
|
// status_code: "400",
|
||||||
router.push(RouterInvestasi.main_transaksi);
|
// };
|
||||||
setSnapShow(false);
|
// // await funUpdatePaymentInvestasi(data, res.dataTransaksi.id);
|
||||||
// router.push(RouterPay.home);
|
// router.push(RouterInvestasi.main_transaksi);
|
||||||
console.log(data);
|
// setSnapShow(false);
|
||||||
}
|
// // router.push(RouterPay.home);
|
||||||
|
// console.log(data);
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -143,89 +147,90 @@ export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!snapShow && (
|
{/* {!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>
|
|
||||||
|
|
||||||
{/* Harga perlembar saham */}
|
)} */}
|
||||||
<Group position="apart" mb={"md"}>
|
<Box>
|
||||||
<Text>Harga Perlembar</Text>
|
{/* Sisa Lembar Saham */}
|
||||||
<Text fz={23}>
|
<Group position="apart" mb={"md"}>
|
||||||
Rp.{" "}
|
<Text>Sisa Lembar Saham</Text>
|
||||||
{new Intl.NumberFormat("id-ID", {
|
<Text fz={23}>
|
||||||
maximumFractionDigits: 10,
|
{new Intl.NumberFormat("id-ID", {
|
||||||
}).format(+investasi.hargaLembar)}{" "}
|
maximumFractionDigits: 10,
|
||||||
</Text>
|
}).format(+investasi.sisaLembar)}{" "}
|
||||||
</Group>
|
</Text>
|
||||||
|
</Group>
|
||||||
|
|
||||||
{/* Lembar saham */}
|
{/* Harga perlembar saham */}
|
||||||
<Group position="apart" mb={"md"}>
|
<Group position="apart" mb={"md"}>
|
||||||
<Box>
|
<Text>Harga Perlembar</Text>
|
||||||
<Text>Jumlah Pembelian</Text>
|
<Text fz={23}>
|
||||||
<Text c={"blue"} fs={"italic"} fz={10}>
|
Rp.{" "}
|
||||||
minimal pembelian 10 lembar
|
{new Intl.NumberFormat("id-ID", {
|
||||||
</Text>
|
maximumFractionDigits: 10,
|
||||||
{/* <Text c={"red"} fs={"italic"} fz={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}>
|
||||||
maximal pembelian {maxPembelian} lembar
|
maximal pembelian {maxPembelian} lembar
|
||||||
</Text> */}
|
</Text> */}
|
||||||
</Box>
|
</Box>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
type="number"
|
type="number"
|
||||||
ref={focusTrapRef}
|
ref={focusTrapRef}
|
||||||
w={100}
|
w={100}
|
||||||
max={maxPembelian}
|
max={maxPembelian}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setTotal(val * +investasi.hargaLembar);
|
setTotal(val * +investasi.hargaLembar);
|
||||||
setJumlah(val);
|
setJumlah(val);
|
||||||
// console.log(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"} />
|
{/* <Flex align={"center"} justify={"center"} id="embedId" /> */}
|
||||||
|
|
||||||
<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" />
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
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>
|
<Stack>
|
||||||
{transaksi.map((e) => (
|
{transaksi.map((e) => (
|
||||||
<Box key={e.id}>
|
<Box key={e.id} onClick={() => router.push(RouterInvestasi.status_pesanan + `${e.id}`)}>
|
||||||
<Link href={e.redirect_url} style={{textDecorationLine: "none"}}>
|
|
||||||
<Paper p="xs" bg={"gray"}>
|
<Paper p="xs" bg={"gray"}>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Title order={6}>{e.Investasi.title}</Title>
|
<Title order={6}>{e.Investasi.title}</Title>
|
||||||
@@ -86,62 +86,8 @@ export default function TransaksiInvestasi({
|
|||||||
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text>{e.quantity} Lembar</Text>
|
<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>
|
</Group>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Link>
|
|
||||||
</Box>
|
</Box>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</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"
|
||||||
|
}
|
||||||
|
]
|
||||||