Merge pull request #32 from bipproduction/donasi/create

Donasi/create
This commit is contained in:
Bagasbanuna02
2024-01-02 16:38:31 +08:00
committed by GitHub
551 changed files with 23326 additions and 866 deletions

5
.env
View File

@@ -4,4 +4,7 @@
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public"
DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public"
PWD="QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb"
Client_KEY="SB-Mid-client-9NDTxltqdZrEB9m-"
Server_KEY="SB-Mid-server-NyltU-U7fLVQd1nv1LWBKylr"

3
.gitignore vendored
View File

@@ -21,7 +21,8 @@
# debug
npm-debug.log*
yarn-debug.log*
rn-debug.log*
yarn-error.log*
# local env files

4
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"WillLuke.nextjs.addTypesOnSave": true,
"WillLuke.nextjs.hasPrompted": true
}

37
README_DEV.md Normal file
View File

@@ -0,0 +1,37 @@
## Page info
### API
- src/app/api
### Api path shortcut
- src/app/lib/api.ts
### fun
Deskripsi: Global function seperti console.log, random number dll.
### lib
Deskripsi: Library untuk menampung beberapa function seperti:
- global prisma
- colortune untuk tampilan FE
### bin
Deskripsi: JSON seeder
- menjalankan seeder : http://localhost:3000/api/seeder?dev=DEV-HIPMI
### App_Modules
Deskripsi: Folder client yang mencakup sub menu dari menu-menu utama
- Auth:
1. login
2. validasi
3. register
4. logout
5. splash screen
6. state (khusus bagian auth)
- Home:
1. home page
## NOTE
Function name:
- g = global
- gs = global state

2
config.yaml Normal file
View File

@@ -0,0 +1,2 @@
server:
password: QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb

View File

@@ -1,4 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
reactStrictMode: false,
experimental: {
serverActions: true
},
}
module.exports = nextConfig

View File

@@ -11,21 +11,40 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@mantine/carousel": "^7.1.5",
"@mantine/core": "^6.0.17",
"@mantine/dropzone": "^7.1.3",
"@mantine/hooks": "^6.0.17",
"@mantine/next": "^6.0.17",
"@mantine/notifications": "^6.0.17",
"@prisma/client": "^5.0.0",
"@tabler/icons-react": "^2.38.0",
"@types/lodash": "^4.14.199",
"@types/node": "20.4.5",
"@types/react": "18.2.17",
"@types/react-dom": "18.2.7",
"@types/uuid": "^9.0.4",
"autoprefixer": "10.4.14",
"embla-carousel-react": "^8.0.0-rc14",
"eslint": "8.45.0",
"eslint-config-next": "13.4.12",
"next": "13.4.12",
"iron-session": "^6.3.1",
"jotai": "^2.4.3",
"lodash": "^4.17.21",
"midtrans-client": "^1.3.1",
"moment": "^2.29.4",
"next": "^13.5.4-canary.8",
"postcss": "8.4.27",
"react": "18.2.0",
"react-countdown": "^2.3.5",
"react-dom": "18.2.0",
"react-responsive-carousel": "^3.2.23",
"react-simple-toasts": "^5.10.0",
"react-toastify": "^9.1.3",
"socket.io-client": "^4.7.2",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
"typescript": "5.1.6",
"uuid": "^9.0.1",
"yaml": "^2.3.2"
}
}

View File

@@ -0,0 +1,51 @@
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"username" TEXT NOT NULL,
"nomor" TEXT NOT NULL,
"active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3),
"masterUserRoleId" TEXT NOT NULL DEFAULT '1',
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "MasterUserRole" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3),
CONSTRAINT "MasterUserRole_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "UserSession" (
"id" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"userId" TEXT NOT NULL,
CONSTRAINT "UserSession_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
-- CreateIndex
CREATE UNIQUE INDEX "User_nomor_key" ON "User"("nomor");
-- CreateIndex
CREATE UNIQUE INDEX "UserSession_userId_key" ON "UserSession"("userId");
-- AddForeignKey
ALTER TABLE "User" ADD CONSTRAINT "User_masterUserRoleId_fkey" FOREIGN KEY ("masterUserRoleId") REFERENCES "MasterUserRole"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "UserSession" ADD CONSTRAINT "UserSession_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,41 @@
-- CreateTable
CREATE TABLE "Profile" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"email" TEXT NOT NULL,
"alamat" TEXT NOT NULL,
"jenisKelamin" 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,
"userId" TEXT,
"imagesId" TEXT,
CONSTRAINT "Profile_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Images" (
"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,
CONSTRAINT "Images_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Profile_email_key" ON "Profile"("email");
-- CreateIndex
CREATE UNIQUE INDEX "Profile_userId_key" ON "Profile"("userId");
-- CreateIndex
CREATE UNIQUE INDEX "Profile_imagesId_key" ON "Profile"("imagesId");
-- AddForeignKey
ALTER TABLE "Profile" ADD CONSTRAINT "Profile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Profile" ADD CONSTRAINT "Profile_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES "Images"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View 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;

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"

View File

@@ -9,5 +9,347 @@ datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
username String @unique
nomor String @unique
active Boolean @default(true)
createdAt DateTime? @default(now())
updatedAt DateTime? @updatedAt
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
masterUserRoleId String @default("1")
UserSession UserSession?
Profile Profile?
Investasi Investasi[]
TransaksiInvestasi TransaksiInvestasi[]
Donasi Donasi[]
}
model MasterUserRole {
id String @id
name String
active Boolean @default(true)
createdAt DateTime? @default(now())
updatedAt DateTime? @updatedAt
User User[]
}
model UserSession {
id String @id @default(cuid())
token String
expires DateTime
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
User User @relation(fields: [userId], references: [id])
userId String @unique
}
model Profile {
id String @id @default(cuid())
name String
email String @unique
alamat String
jenisKelamin String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
User User? @relation(fields: [userId], references: [id])
userId String? @unique
ImageProfile Images? @relation(fields: [imagesId], references: [id])
imagesId String? @unique
Katalog Katalog[]
}
model Images {
id String @id @default(cuid())
url String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
Profile Profile?
Investasi Investasi?
BeritaInvestasi BeritaInvestasi[]
Donasi Donasi?
CeritaDonasi Donasi_Cerita[]
Donasi_TemporaryCreate Donasi_TemporaryCreate[]
}
model Katalog {
id String @id @default(cuid())
namaBisnis String
alamatKantor String
tlpn String
deskripsi String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
Profile Profile? @relation(fields: [profileId], references: [id])
profileId String?
MasterBidangBisnis MasterBidangBisnis @relation(fields: [masterBidangBisnisId], references: [id])
masterBidangBisnisId String
}
model MasterBidangBisnis {
id String @id
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
Katalog Katalog[]
}
// -------------------- INVESTASI --------------------- //
// Table investasi / saham
model Investasi {
id String @id @default(cuid())
title String
targetDana String
hargaLembar String
totalLembar String
roi String
active Boolean @default(true)
countDown DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
author User? @relation(fields: [authorId], references: [id])
authorId String?
catatan String?
sisaLembar String
lembarTerbeli String? @default("0")
progress String? @default("0")
MasterPeriodeDeviden MasterPeriodeDeviden? @relation(fields: [masterPeriodeDevidenId], references: [id])
masterPeriodeDevidenId String?
MasterPembagianDeviden MasterPembagianDeviden? @relation(fields: [masterPembagianDevidenId], references: [id])
masterPembagianDevidenId String?
MasterPencarianInvestor MasterPencarianInvestor? @relation(fields: [masterPencarianInvestorId], references: [id])
masterPencarianInvestorId String?
ImageInvestasi Images? @relation(fields: [imagesId], references: [id])
imagesId String? @unique
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
masterStatusInvestasiId String? @default("2")
ProspektusInvestasi ProspektusInvestasi?
BeritaInvestasi BeritaInvestasi[]
DokumenInvestasi DokumenInvestasi[]
TransaksiInvestasi TransaksiInvestasi[]
MasterProgresInvestasi MasterProgresInvestasi? @relation(fields: [masterProgresInvestasiId], references: [id])
masterProgresInvestasiId String?
}
model MasterPencarianInvestor {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
investasi Investasi[]
}
model MasterPeriodeDeviden {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
investasi Investasi[]
}
model MasterPembagianDeviden {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
investasi Investasi[]
}
model MasterStatusInvestasi {
id String @id @default(cuid())
name String
color String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
investasi Investasi[]
}
model ProspektusInvestasi {
id String @id @default(cuid())
url String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
investasi Investasi? @relation(fields: [investasiId], references: [id])
investasiId String? @unique
}
model DokumenInvestasi {
id String @id @default(cuid())
title String
url String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
investasi Investasi? @relation(fields: [investasiId], references: [id])
investasiId String?
}
model BeritaInvestasi {
id String @id @default(cuid())
title String
deskripsi String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
ImageBerita Images? @relation(fields: [imagesId], references: [id])
imagesId String?
investasi Investasi @relation(fields: [investasiId], references: [id])
investasiId String
}
model MasterBank {
id String @id @default(cuid())
name String
norek String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model MasterProgresInvestasi {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Investasi Investasi[]
}
model TransaksiInvestasi {
id String @id @default(cuid())
Investasi Investasi @relation(fields: [investasiId], references: [id])
investasiId String
Author User @relation(fields: [authorId], references: [id])
authorId String
namaBank String?
nomorRekening String?
token String?
redirect_url String?
quantity String
price String
gross_amount String
merchant_name String
status_code String?
status_message String?
transaction_id String?
order_id String?
payment_type String?
transaction_time String?
transaction_status String?
fraud_status String?
pdf_url String?
finish_redirect_url String?
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
MasterStatusTransaksiInvestasi MasterStatusTransaksiInvestasi? @relation(fields: [masterStatusTransaksiInvestasiId], references: [id])
masterStatusTransaksiInvestasiId String? @default("1")
}
model MasterStatusTransaksiInvestasi {
id String @id @default(cuid())
name String
color String?
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
TransaksiInvestasi TransaksiInvestasi[]
}
// -------------------- DONASI --------------------- //
model Donasi {
id String @id @default(cuid())
title String
target String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
publishTime DateTime?
catatan String?
Author User? @relation(fields: [authorId], references: [id])
authorId String?
imageDonasi Images? @relation(fields: [imagesId], references: [id])
imagesId String? @unique
CeritaDonasi Donasi_Cerita?
DonasiMaster_Ketegori DonasiMaster_Kategori? @relation(fields: [donasiMaster_KategoriId], references: [id])
donasiMaster_KategoriId String?
DonasiMaster_Durasi DonasiMaster_Durasi? @relation(fields: [donasiMaster_DurasiId], references: [id])
donasiMaster_DurasiId String?
DonasiMaster_Status DonasiMaster_StatusDonasi? @relation(fields: [donasiMaster_StatusDonasiId], references: [id])
donasiMaster_StatusDonasiId String? @default("2")
}
model Donasi_TemporaryCreate {
id String @id @default(cuid())
title String
target String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
imageDonasiTemporary Images? @relation(fields: [imagesId], references: [id])
imagesId String? @unique
kategori DonasiMaster_Kategori? @relation(fields: [donasiMaster_KategoriId], references: [id])
donasiMaster_KategoriId String?
durasi DonasiMaster_Durasi? @relation(fields: [donasiMaster_DurasiId], references: [id])
donasiMaster_DurasiId String?
}
model DonasiMaster_Kategori {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Donasi Donasi[]
Donasi_TemporaryCreate Donasi_TemporaryCreate[]
}
model DonasiMaster_Durasi {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Donasi Donasi[]
Donasi_TemporaryCreate Donasi_TemporaryCreate[]
}
model Donasi_Cerita {
id String @id @default(cuid())
pembukaan String
cerita String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
imageCeritaDonasi Images? @relation(fields: [imagesId], references: [id])
imagesId String? @unique
Donasi Donasi? @relation(fields: [donasiId], references: [id])
donasiId String? @unique
}
model DonasiMaster_StatusDonasi {
id String @id @default(cuid())
name String
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Donasi Donasi[]
}

BIN
public/aset/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
public/aset/dummy_file.pdf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
public/aset/no-file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
public/aset/no-img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
public/aset/pdf-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Binary file not shown.

1
public/file/index.ts Normal file
View File

@@ -0,0 +1 @@
// Image for file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

View File

@@ -0,0 +1 @@
// Image for investasi

View File

@@ -0,0 +1,36 @@
import { redirect } from "next/navigation";
import { myConsole } from "@/app/fun/my_console";
import prisma from "@/app/lib/prisma";
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
// console.log(body);
if (body.nomor === "1234567890") {
return NextResponse.json({
success: true,
status: 200,
message: "Login Success",
});
} else {
try {
await fetch(
`https://wa.wibudev.com/code?nom=${body.nomor}&text=Masukan Kode OTP:${body.otp}`
);
return NextResponse.json({
body,
status: 200,
message: "Login Success",
});
} catch (error) {
return NextResponse.json({ status: 500, message: "Server Error !!!" });
}
}
}
return NextResponse.json({ success: false });
}

View File

@@ -0,0 +1,12 @@
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
export async function GET() {
cookies().set({
name: "ssn",
value: "",
maxAge: 0,
});
return NextResponse.json({ status: 200, message: "Logout" });
}

View File

@@ -0,0 +1,59 @@
import { sealData } from "iron-session";
import { myConsole } from "@/app/fun/my_console";
import prisma from "@/app/lib/prisma";
import { data } from "autoprefixer";
import { NextResponse } from "next/server";
import { cookies } from "next/headers";
import { getConfig } from "@/bin/config";
import fs from "fs";
import yaml from "yaml";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
// MyConsole(body);
const cekUsername = await prisma.user.findUnique({
where: {
username: body.username,
},
});
myConsole(cekUsername);
if (cekUsername)
return NextResponse.json({ status: 400, message: "Username sudah ada" });
const data = await prisma.user.create({
data: {
username: body.username,
nomor: body.nomor,
},
});
if (data) {
const seal = await sealData(
JSON.stringify({
id: data.id,
username: data.username,
}),
{
password: await config.server.password,
}
);
cookies().set({
name: "ssn",
value: seal,
maxAge: 60 * 60 * 24 * 7,
});
return NextResponse.json({ status: 201 });
}
return NextResponse.json({ success: true });
}
return NextResponse.json({ success: false });
}

View File

@@ -0,0 +1,59 @@
import { myConsole } from "@/app/fun/my_console";
import prisma from "@/app/lib/prisma";
import { NextResponse } from "next/server";
import { cookies } from "next/headers";
import { sealData, unsealData } from "iron-session";
import { getConfig } from "@/bin/config";
import yaml from "yaml";
import fs from "fs";
import { revalidatePath } from "next/cache";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
const data = await prisma.user.findUnique({
where: {
nomor: body.nomor,
},
select: {
id: true,
nomor: true,
username: true,
active: true,
},
});
myConsole(data)
if (!data) return NextResponse.json({ status: 404 });
if (data) {
const res = await sealData(
JSON.stringify({
id: data.id,
username: data.username,
}),
{
password: (await config.server.password),
}
);
cookies().set({
name: "ssn",
value: res,
maxAge: 60 * 60 * 24 * 7,
});
revalidatePath("/dev/home")
return NextResponse.json({ status: 200, data });
}
return NextResponse.json({ success: true });
}
return NextResponse.json({ success: false });
}

View File

@@ -0,0 +1,32 @@
import prisma from "@/app/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
) {
const get = await prisma.images.findUnique({
where: {
id: params.id,
},
select: {
url: true,
},
});
if (!fs.existsSync(`./public/donasi/image/${get?.url}`)) {
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
return new NextResponse(notFile, {
headers: {
"Content-Type": "image/png",
},
});
}
const file = fs.readFileSync(`./public/donasi/image/${get?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",
},
});
}

View File

@@ -0,0 +1,34 @@
import prisma from "@/app/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
) {
const get = await prisma.images.findUnique({
where: {
id: params.id,
},
select: {
url: true,
},
});
if (!fs.existsSync(`./public/donasi/image_cerita/${get?.url}`)) {
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
return new NextResponse(notFile, {
headers: {
"Content-Type": "image/png",
},
});
}
const file = fs.readFileSync(`./public/donasi/image_cerita/${get?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",
},
});
}

View File

@@ -0,0 +1,23 @@
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
export async function GET(
req: NextRequest,
{ params }: { params: { url: string } }
) {
if (!fs.existsSync(`./public/donasi/image/${params.url}`)) {
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
return new NextResponse(notFile, {
headers: {
"Content-Type": "image/png",
},
});
}
const file = fs.readFileSync(`./public/donasi/image/${params.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",
},
});
}

View File

@@ -0,0 +1,25 @@
import { NextRequest, NextResponse } from "next/server";
import fs from "fs"
export async function GET(
req: NextRequest,
{ params }: { params: { url: string } }
) {
if (!fs.existsSync(`./public/donasi/image_cerita/${params.url}`)) {
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
return new NextResponse(notFile, {
headers: {
"Content-Type": "image/png",
},
});
}
const file = fs.readFileSync(`./public/donasi/image_cerita/${params.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",
},
});
}

View File

@@ -0,0 +1 @@
# Test

View File

@@ -0,0 +1,22 @@
import prisma from "@/app/lib/prisma";
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
) {
const data = await prisma.dokumenInvestasi.findUnique({
where: { id: params.id },
select: {
url: true,
},
});
const file = fs.readFileSync(`./public/file/${data?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "application/pdf",
},
});
}

View File

@@ -0,0 +1,33 @@
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
import prisma from "@/app/lib/prisma";
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
) {
const data = await prisma.images.findUnique({
where: {
id: params.id,
},
select: {
url: true,
},
});
if (!fs.existsSync(`./public/investasi/${data?.url}`)) {
const fl = fs.readFileSync(`./public/aset/no-img.png`);
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png",
},
});
}
const fl = fs.readFileSync(`./public/investasi/${data?.url}`);
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png",
},
});
}

View 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 });
}

View File

@@ -0,0 +1,23 @@
import prisma from "@/app/lib/prisma";
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
) {
// console.log(params.id)
const data = await prisma.prospektusInvestasi.findUnique({
where: { id: params.id },
select: {
url: true,
},
});
const file = fs.readFileSync(`./public/file/${data?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "application/pdf",
},
});
}

View File

@@ -0,0 +1,22 @@
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
export async function GET(
req: NextRequest,
{ params }: { params: { name: string } }
) {
if (!fs.existsSync(`./public/img/${params.name}`)) {
const fl = fs.readFileSync(`./public/aset/avatar.png`);
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png",
},
});
}
const fl = fs.readFileSync(`./public/img/${params.name}`);
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png",
},
});
}

236
src/app/api/seeder/route.ts Normal file
View File

@@ -0,0 +1,236 @@
import prisma from "@/app/lib/prisma";
import { NextResponse } from "next/server";
import userRole from "../../../bin/seeder/user_role.json";
import bidangBisnis from "../../../bin/seeder/bidang_bisnis.json";
import pencarianInvestor from "./../../../bin/seeder/investasi/pencarian_investor.json";
import periodeDeviden from "./../../../bin/seeder/investasi/periode_deviden.json";
import pembagianDeviden from "./../../../bin/seeder/investasi/pembagian_deviden.json";
import statusInvestasi from "./../../../bin/seeder/investasi/status_investasi.json";
import namaBank from "./../../../bin/seeder/investasi/nama_bank.json";
import statusTransaksiInvestasi from "./../../../bin/seeder/investasi/status_transaksi_investasi.json";
import jenisProgres from "../../../bin/seeder/investasi/master_progres.json";
import userSeeder from "../../../bin/seeder/user_seeder.json";
import donasi_status from "../../../bin/seeder/donasi/master_status.json";
import donasi_kategori from "../../../bin/seeder/donasi/master_kategori.json";
import donasi_durasi from "../../../bin/seeder/donasi/master_durasi.json";
export async function GET(req: Request) {
const dev = new URL(req.url).searchParams.get("dev");
if (dev === "DEV-HIPMI") {
for (let i of userRole) {
const data = await prisma.masterUserRole.upsert({
where: {
id: i.id.toString(),
},
update: {
id: i.id.toString(),
name: i.name,
},
create: {
id: i.id.toString(),
name: i.name,
},
});
}
for (let i of userSeeder) {
await prisma.user.upsert({
where: {
nomor: i.nomor,
},
create: {
nomor: i.nomor,
username: i.name,
masterUserRoleId: i.masterUserRoleId,
},
update: {
nomor: i.nomor,
username: i.name,
masterUserRoleId: i.masterUserRoleId,
},
});
}
for (let i of bidangBisnis) {
await prisma.masterBidangBisnis.upsert({
where: {
id: i.id.toString(),
},
update: {
id: i.id.toString(),
name: i.name,
},
create: {
id: i.id.toString(),
name: i.name,
},
});
}
for (let i of pencarianInvestor) {
await prisma.masterPencarianInvestor.upsert({
where: {
id: i.id.toString(),
},
update: {
id: i.id.toString(),
name: i.name,
},
create: {
id: i.id.toString(),
name: i.name,
},
});
}
for (let i of pembagianDeviden) {
await prisma.masterPembagianDeviden.upsert({
where: {
id: i.id.toString(),
},
update: {
id: i.id.toString(),
name: i.name,
},
create: {
id: i.id.toString(),
name: i.name,
},
});
}
for (let i of periodeDeviden) {
await prisma.masterPeriodeDeviden.upsert({
where: {
id: i.id.toString(),
},
update: {
id: i.id.toString(),
name: i.name,
},
create: {
id: i.id.toString(),
name: i.name,
},
});
}
for (let i of statusInvestasi) {
await prisma.masterStatusInvestasi.upsert({
where: {
id: i.id,
},
create: {
id: i.id,
name: i.name,
color: i.color,
},
update: {
id: i.id,
name: i.name,
color: i.color,
},
});
}
for (let i of namaBank) {
await prisma.masterBank.upsert({
where: {
id: i.id.toString(),
},
create: {
id: i.id.toString(),
name: i.name,
norek: i.norek.toString(),
},
update: {
id: i.id.toString(),
name: i.name,
norek: i.norek.toString(),
},
});
}
for (let i of statusTransaksiInvestasi) {
await prisma.masterStatusTransaksiInvestasi.upsert({
where: {
id: i.id,
},
create: {
id: i.id,
name: i.name,
color: i.color,
},
update: {
id: i.id,
name: i.name,
color: i.color,
},
});
}
for (let i of jenisProgres) {
await prisma.masterProgresInvestasi.upsert({
where: {
id: i.id,
},
create: {
id: i.id,
name: i.name,
},
update: {
name: i.name,
},
});
}
for (let d of donasi_status) {
await prisma.donasiMaster_StatusDonasi.upsert({
where: {
id: d.id,
},
create: {
id: d.id,
name: d.name,
},
update: {
name: d.name,
},
});
}
for (let d of donasi_kategori) {
await prisma.donasiMaster_Kategori.upsert({
where: {
id: d.id,
},
create: {
id: d.id,
name: d.name,
},
update: {
name: d.name,
},
});
}
for (let d of donasi_durasi) {
await prisma.donasiMaster_Durasi.upsert({
where: {
id: d.id,
},
create: {
id: d.id,
name: d.name,
},
update: {
name: d.name,
},
});
}
return NextResponse.json({ success: true });
}
return NextResponse.json({ success: false });
}

View File

@@ -0,0 +1,9 @@
import { Admin_Award } from "@/app_modules/admin/award";
export default async function Page() {
return (
<>
<Admin_Award />
</>
);
}

View File

@@ -0,0 +1,9 @@
import Admin_Award from "@/app_modules/admin/award/main";
export default async function Page() {
return (
<>
<Admin_Award />
</>
);
}

View File

@@ -0,0 +1,9 @@
import { AdminDonasi_DetailPublish } from "@/app_modules/admin/donasi";
export default async function Page() {
return (
<>
<AdminDonasi_DetailPublish />
</>
);
}

View File

@@ -0,0 +1,9 @@
import { AdminDonasi_DetailReview } from "@/app_modules/admin/donasi";
import { AdminDonasi_getById } from "@/app_modules/admin/donasi/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
// console.log(params.id)
const dataReview = await AdminDonasi_getById(params.id)
// console.log(dataReview)
return <AdminDonasi_DetailReview dataReview={dataReview as any}/>
}

View File

@@ -0,0 +1,20 @@
import { AdminDonasi_Main } from "@/app_modules/admin/donasi";
import AdminDonasi_funCountByStatus from "@/app_modules/admin/donasi/fun/count/fun_count_donasi_by_status";
export default async function Page() {
const countPublish = await AdminDonasi_funCountByStatus("1");
const countReview = await AdminDonasi_funCountByStatus("2");
const countDraft = await AdminDonasi_funCountByStatus("3");
const countReject = await AdminDonasi_funCountByStatus("4");
return (
<>
<AdminDonasi_Main
countPublish={countPublish as number}
countReview={countReview as number}
countDraft={countDraft as number}
countReject={countReject as number}
/>
</>
);
}

View File

@@ -0,0 +1,10 @@
import { AdminDonasi_TablePublish } from "@/app_modules/admin/donasi";
import { AdminDonasi_getByStatus } from "@/app_modules/admin/donasi/fun/get/get_donasi_by_status";
export default async function Page() {
const listPublish = await AdminDonasi_getByStatus("1")
// console.log(listPublish)
return<>
<AdminDonasi_TablePublish listPublish={listPublish as any}/>
</>
}

View File

@@ -0,0 +1,10 @@
import { AdminDonasi_TableReject } from "@/app_modules/admin/donasi";
import { AdminDonasi_getByStatus } from "@/app_modules/admin/donasi/fun/get/get_donasi_by_status";
export default async function Page() {
const dataReject = await AdminDonasi_getByStatus("4")
// console.log(dataReject)
return<>
<AdminDonasi_TableReject dataReject={dataReject as any}/>
</>
}

View File

@@ -0,0 +1,9 @@
import { AdminDonasi_TableReview } from "@/app_modules/admin/donasi";
import { AdminDonasi_getByStatus } from "@/app_modules/admin/donasi/fun/get/get_donasi_by_status";
import { getToken_UserId } from "@/app_modules/fun/get_user_token";
export default async function Page() {
const listReview = await AdminDonasi_getByStatus("2");
// console.log(listReview);
return <AdminDonasi_TableReview listReview={listReview as any} />;
}

View File

@@ -0,0 +1,16 @@
import { Admin_LayoutBuktiTransferInvestasi } from "@/app_modules/admin/investasi";
import React from "react";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<Admin_LayoutBuktiTransferInvestasi>
{children}
</Admin_LayoutBuktiTransferInvestasi>
</>
);
}

View File

@@ -0,0 +1,9 @@
import { Admin_BuktiTransferInvestasi } from "@/app_modules/admin/investasi";
export default async function Page() {
return (
<>
<Admin_BuktiTransferInvestasi />
</>
);
}

View File

@@ -0,0 +1,10 @@
import { Admin_LayoutHalamanAksi } from "@/app_modules/admin/investasi";
import React from "react";
export default async function Layout({ children }: { children: React.ReactNode }) {
return <>
<Admin_LayoutHalamanAksi>{children}</Admin_LayoutHalamanAksi>
</>;
}

View File

@@ -0,0 +1,10 @@
import { Admin_HalamanAksi } from "@/app_modules/admin/investasi";
export default async function Page({params}:{params: {id: string}}) {
return (
<>
<Admin_HalamanAksi idInves={params.id} />
</>
);
}

View File

@@ -0,0 +1,16 @@
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
export default async function Page({ params }: { params: { id: string } }) {
const dataInvestasi = await getOneInvestasiById(params.id)
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any)
// console.log(dataUser)
return (
<>
<Admin_KonfirmasiInvestasi dataInvestasi={dataInvestasi as any} dataUser={dataUser as any} />
</>
);
}

View File

@@ -0,0 +1,32 @@
import { Admin_Investasi } from "@/app_modules/admin/investasi";
import Admin_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
import Admin_getPublishProgresInvestasi from "@/app_modules/admin/investasi/fun/get_publish_progres";
import Admin_getTotalInvestasiByUser from "@/app_modules/admin/investasi/fun/get_total_investasi_by_user";
export default async function Page() {
const listInvestasi = await Admin_funGetAllInvestasi();
const countDraft = await Admin_CountStatusInvestasi(1);
const countReview = await Admin_CountStatusInvestasi(2);
const countPublish = await Admin_CountStatusInvestasi(3);
const countReject = await Admin_CountStatusInvestasi(4);
const totalInvestasiByUser = await Admin_getTotalInvestasiByUser()
const publishProgres = await Admin_getPublishProgresInvestasi()
// console.log(targetTerbesar)
return (
<>
<Admin_Investasi
listInvestasi={listInvestasi as any}
countDraft={countDraft}
countReview={countReview}
countPublish={countPublish}
countReject={countReject}
totalInvestasiByUser={totalInvestasiByUser}
publishProgres={publishProgres}
/>
{/* <pre>{JSON.stringify(totalInvestasiByUser, null,2)}</pre> */}
</>
);
}

View File

@@ -0,0 +1,16 @@
import { Admin_LayoutStatusTransferInvesatasi } from "@/app_modules/admin/investasi";
import React from "react";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<Admin_LayoutStatusTransferInvesatasi>
{children}
</Admin_LayoutStatusTransferInvesatasi>
</>
);
}

View File

@@ -0,0 +1,8 @@
import { Admin_StatusTransferInvesatasi } from "@/app_modules/admin/investasi";
export default async function Page() {
return<>
<Admin_StatusTransferInvesatasi/>
</>
}

View File

@@ -0,0 +1,10 @@
import { Admin_TablePublishInvestasi } from "@/app_modules/admin/investasi";
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
export default async function Page() {
const listInvestasi = await Admin_funGetAllInvestasi();
return<>
<Admin_TablePublishInvestasi dataInvestsi={listInvestasi as any}/>
</>
}

View File

@@ -0,0 +1,10 @@
import { Admin_TableRejectInvestasi } from "@/app_modules/admin/investasi";
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
export default async function Page() {
const dataInvestsi = await Admin_funGetAllInvestasi()
return <>
<Admin_TableRejectInvestasi dataInvestsi={dataInvestsi as any}/>
</>
}

View File

@@ -0,0 +1,9 @@
import { Admin_TableReviewInvestasi } from "@/app_modules/admin/investasi";
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
export default async function Page() {
const dataInvestsi = await Admin_funGetAllInvestasi()
return <>
<Admin_TableReviewInvestasi dataInvestsi={dataInvestsi as any}/>
</>
}

View File

@@ -0,0 +1,14 @@
import { AdminLayout } from "@/app_modules/admin/main";
import React from "react";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<AdminLayout>{children}</AdminLayout>
</>
);
}

View File

@@ -0,0 +1,5 @@
import { AdminMain } from "@/app_modules/admin/main";
export default async function Page() {
return <AdminMain />;
}

View File

@@ -0,0 +1,14 @@
import { Login } from "@/app_modules/auth";
import { cookies } from "next/headers";
export default function Page() {
const c = cookies().getAll();
const tkn = c;
return (
<>
{/* {JSON.stringify(tkn)} */}
<Login />;
</>
);
}

View File

@@ -0,0 +1,5 @@
import { Register } from "@/app_modules/auth";
export default function Page() {
return <Register />;
}

Some files were not shown because too many files have changed in this diff Show More