Update Versi 1.5.27 #32
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"WillLuke.nextjs.addTypesOnSave": true,
|
||||
"WillLuke.nextjs.hasPrompted": true
|
||||
}
|
||||
"WillLuke.nextjs.addTypesOnSave": true,
|
||||
"WillLuke.nextjs.hasPrompted": true,
|
||||
"prismaERDPreviewer.preferredTheme": "dark"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||
|
||||
## [1.2.42](https://github.com/bipproduction/hipmi/compare/v1.2.41...v1.2.42) (2025-01-30)
|
||||
|
||||
## [1.2.41](https://github.com/bipproduction/hipmi/compare/v1.2.40...v1.2.41) (2025-01-21)
|
||||
|
||||
## [1.2.40](https://github.com/bipproduction/hipmi/compare/v1.2.39...v1.2.40) (2025-01-16)
|
||||
|
||||
## [1.2.39](https://github.com/bipproduction/hipmi/compare/v1.2.38...v1.2.39) (2025-01-12)
|
||||
|
||||
3399
backup.sql
Normal file
3399
backup.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hipmi",
|
||||
"version": "1.2.40",
|
||||
"version": "1.2.42",
|
||||
"private": true,
|
||||
"prisma": {
|
||||
"seed": "bun prisma/seed.ts"
|
||||
@@ -28,7 +28,7 @@
|
||||
"@mantine/next": "^6.0.17",
|
||||
"@mantine/notifications": "^6.0.17",
|
||||
"@mantine/tiptap": "^7.5.3",
|
||||
"@prisma/client": "^5.0.0",
|
||||
"@prisma/client": "^6.3.0",
|
||||
"@react-pdf/renderer": "^3.4.4",
|
||||
"@tabler/icons-react": "^2.38.0",
|
||||
"@tiptap/extension-highlight": "^2.2.3",
|
||||
@@ -69,9 +69,10 @@
|
||||
"next": "^13.5.4-canary.8",
|
||||
"next-dev": "^1.1.9",
|
||||
"next-scroll-loader": "^1.0.9",
|
||||
"p-limit": "^6.2.0",
|
||||
"pdfjs-dist": "^4.6.82",
|
||||
"postcss": "8.4.27",
|
||||
"prisma": "^5.19.1",
|
||||
"prisma": "^6.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-countdown": "^2.3.5",
|
||||
"react-dom": "18.2.0",
|
||||
@@ -89,6 +90,7 @@
|
||||
"react-toastify": "^9.1.3",
|
||||
"sharp": "^0.33.5",
|
||||
"socket.io-client": "^4.7.2",
|
||||
"swr": "^2.3.0",
|
||||
"tailwindcss": "3.3.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "5.1.6",
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
engineType = "binary"
|
||||
provider = "prisma-client-js"
|
||||
engineType = "binary"
|
||||
binaryTargets = ["native"]
|
||||
}
|
||||
|
||||
datasource db {
|
||||
@@ -47,6 +48,9 @@ model User {
|
||||
User_Notifikasi Notifikasi[] @relation("UserNotifikasi")
|
||||
BusinessMaps BusinessMaps[]
|
||||
Investasi_Invoice Investasi_Invoice[]
|
||||
|
||||
EventSponsor EventSponsor[]
|
||||
EventTransaksi EventTransaksi[]
|
||||
}
|
||||
|
||||
model MasterUserRole {
|
||||
@@ -166,6 +170,7 @@ model MasterBank {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
Investasi_Invoice Investasi_Invoice[]
|
||||
EventTransaksi EventTransaksi[]
|
||||
}
|
||||
|
||||
model MasterStatus {
|
||||
@@ -177,6 +182,15 @@ model MasterStatus {
|
||||
Job Job[]
|
||||
}
|
||||
|
||||
model MasterStatusTransaksi {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
EventTransaksi EventTransaksi[]
|
||||
}
|
||||
|
||||
// -------------------- INVESTASI --------------------- //
|
||||
// Table investasi / saham
|
||||
model Investasi {
|
||||
@@ -593,6 +607,8 @@ model Event {
|
||||
Event_Peserta Event_Peserta[]
|
||||
EventMaster_TipeAcara EventMaster_TipeAcara? @relation(fields: [eventMaster_TipeAcaraId], references: [id])
|
||||
eventMaster_TipeAcaraId Int?
|
||||
EventSponsor EventSponsor[]
|
||||
EventTransaksi EventTransaksi[]
|
||||
}
|
||||
|
||||
model EventMaster_TipeAcara {
|
||||
@@ -952,3 +968,50 @@ model MasterKategoriApp {
|
||||
name String
|
||||
value String?
|
||||
}
|
||||
|
||||
// ======================= EVENT ======================= //
|
||||
|
||||
model EventSponsor {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
name String
|
||||
isTransfer Boolean? @default(false)
|
||||
fileName String
|
||||
fileExt String?
|
||||
fileId String
|
||||
|
||||
Author User? @relation(fields: [authorId], references: [id])
|
||||
authorId String?
|
||||
|
||||
Event Event? @relation(fields: [eventId], references: [id])
|
||||
eventId String?
|
||||
|
||||
EventTransaksi EventTransaksi?
|
||||
}
|
||||
|
||||
model EventTransaksi {
|
||||
id String @id @default(cuid())
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
nominal Int
|
||||
status String
|
||||
transferImageId String?
|
||||
|
||||
MasterBank MasterBank? @relation(fields: [masterBankId], references: [id])
|
||||
masterBankId String?
|
||||
|
||||
AuthorId User? @relation(fields: [authorId], references: [id])
|
||||
authorId String?
|
||||
|
||||
Event Event? @relation(fields: [eventId], references: [id])
|
||||
eventId String?
|
||||
|
||||
EventSponsor EventSponsor? @relation(fields: [eventSponsorId], references: [id])
|
||||
eventSponsorId String? @unique
|
||||
|
||||
MasterStatusTransaksi MasterStatusTransaksi? @relation(fields: [masterStatusTransaksiId], references: [id])
|
||||
masterStatusTransaksiId String?
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ import prisma from "./../src/app/lib/prisma";
|
||||
import { generate_seeder } from "./../src/app_modules/_global/fun/generate_seeder";
|
||||
|
||||
(async () => {
|
||||
console.log("start");
|
||||
console.log("start seeder >>");
|
||||
await generate_seeder();
|
||||
})()
|
||||
.then(() => {
|
||||
console.log("success");
|
||||
console.log("<< success seeder");
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
console.error("<< error seeder", e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
|
||||
50
src/app/api/admin/donasi/dashboard/[name]/route.ts
Normal file
50
src/app/api/admin/donasi/dashboard/[name]/route.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { data } from "autoprefixer";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }: {
|
||||
params: { name: string }
|
||||
}) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const { name } = params;
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(name);
|
||||
fixData = await prisma.donasi.count({
|
||||
where: {
|
||||
DonasiMaster_Status: {
|
||||
name: fixStatus
|
||||
},
|
||||
}
|
||||
});
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data donasi dashboard",
|
||||
data: fixData
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data donasi dashboard >>", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Failed to get data donasi dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
39
src/app/api/admin/donasi/dashboard/kategori/route.ts
Normal file
39
src/app/api/admin/donasi/dashboard/kategori/route.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== 'GET') {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: 'Method not allowed',
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.donasiMaster_Kategori.count({});
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: 'Success get data donasi dashboard',
|
||||
data: fixData
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error('Error get data donasi dashboard >>', error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: 'Error get data donasi dashboard',
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
255
src/app/api/admin/event/[status]/route.ts
Normal file
255
src/app/api/admin/event/[status]/route.ts
Normal file
@@ -0,0 +1,255 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: { status: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const { status } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const search = searchParams.get("search");
|
||||
const page = searchParams.get("page");
|
||||
const takeData = 10;
|
||||
const skipData = Number(page) * takeData - takeData;
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
|
||||
if (!page && !search) {
|
||||
fixData = await prisma.event.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: false,
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
} else if (!page && search) {
|
||||
fixData = await prisma.event.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: false,
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
} else if (page && !search) {
|
||||
if (fixStatus === "Publish") {
|
||||
const getAllData = await prisma.event.findMany({
|
||||
where: {
|
||||
active: true,
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
isArsip: false,
|
||||
},
|
||||
});
|
||||
|
||||
for (let i of getAllData) {
|
||||
if (moment(i.tanggalSelesai).diff(moment(), "minutes") < 0) {
|
||||
await prisma.event.update({
|
||||
where: {
|
||||
id: i.id,
|
||||
},
|
||||
data: {
|
||||
isArsip: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const data = await prisma.event.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: false,
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
|
||||
const nCount = await prisma.event.count({
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
active: true,
|
||||
isArsip: false,
|
||||
},
|
||||
});
|
||||
|
||||
fixData = {
|
||||
data: data,
|
||||
nPage: _.ceil(nCount / takeData),
|
||||
};
|
||||
} else if (page && search) {
|
||||
if (fixStatus === "Publish") {
|
||||
const getAllData = await prisma.event.findMany({
|
||||
where: {
|
||||
active: true,
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
isArsip: false,
|
||||
},
|
||||
});
|
||||
|
||||
for (let i of getAllData) {
|
||||
if (moment(i.tanggalSelesai).diff(moment(), "minutes") < 0) {
|
||||
await prisma.event.update({
|
||||
where: {
|
||||
id: i.id,
|
||||
},
|
||||
data: {
|
||||
isArsip: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const data = await prisma.event.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: false,
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
|
||||
const nCount = await prisma.event.count({
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: false,
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
fixData = {
|
||||
data: data,
|
||||
nPage: _.ceil(nCount / takeData),
|
||||
};
|
||||
}
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: `Success get data table event ${status}`,
|
||||
data: fixData,
|
||||
});
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data table event dashboard >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed get data table event dashboard",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
53
src/app/api/admin/event/dashboard/[name]/route.ts
Normal file
53
src/app/api/admin/event/dashboard/[name]/route.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: { name: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const { name } = params;
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(name);
|
||||
fixData = await prisma.event.count({
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: fixStatus,
|
||||
},
|
||||
isArsip: false,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: true,
|
||||
message: "Success get data event dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data event dashboard >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed to get data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
47
src/app/api/admin/event/dashboard/riwayat/route.ts
Normal file
47
src/app/api/admin/event/dashboard/riwayat/route.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.event.count({
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
isArsip: true,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: true,
|
||||
message: "Success get data riwayat event dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data riwayat event dashboard >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed to get data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
44
src/app/api/admin/event/dashboard/tipe-acara/route.ts
Normal file
44
src/app/api/admin/event/dashboard/tipe-acara/route.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.eventMaster_TipeAcara.count({
|
||||
where: {
|
||||
active: true,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: true,
|
||||
message: "Success get data riwayat event dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data riwayat event dashboard >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed to get data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
201
src/app/api/admin/event/riwayat/route.ts
Normal file
201
src/app/api/admin/event/riwayat/route.ts
Normal file
@@ -0,0 +1,201 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const { searchParams } = new URL(request.url);
|
||||
const search = searchParams.get("search");
|
||||
const page = searchParams.get("page");
|
||||
const takeData = 10;
|
||||
const skipData = Number(page) * takeData - takeData;
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
|
||||
if (!page && !search) {
|
||||
fixData = await prisma.event.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
isArsip: true,
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
} else if (!page && search) {
|
||||
fixData = await prisma.event.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
isArsip: true,
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
} else if (page && !search) {
|
||||
const data = await prisma.event.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
isArsip: true,
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
|
||||
const nCount = await prisma.event.count({
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: true,
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
fixData = {
|
||||
data: data,
|
||||
nPage: _.ceil(nCount / takeData),
|
||||
};
|
||||
} else if (page && search) {
|
||||
const data = await prisma.event.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
isArsip: true,
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
EventMaster_Status: true,
|
||||
EventMaster_TipeAcara: true,
|
||||
},
|
||||
});
|
||||
|
||||
const nCount = await prisma.event.count({
|
||||
where: {
|
||||
active: true,
|
||||
isArsip: true,
|
||||
EventMaster_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
title: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
fixData = {
|
||||
data,
|
||||
nPage: _.ceil(nCount / takeData),
|
||||
};
|
||||
}
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: true,
|
||||
message: "Success get data riwayat event",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data riwayat event >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Error get data riwayat event",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
44
src/app/api/admin/forum/dashboard/publish/route.ts
Normal file
44
src/app/api/admin/forum/dashboard/publish/route.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }: {
|
||||
params: { status: string }
|
||||
}) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.forum_Posting.count({
|
||||
where: {
|
||||
isActive: true,
|
||||
}
|
||||
})
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data forum dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data forum dashboard", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data forum dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
41
src/app/api/admin/forum/dashboard/report_komentar/route.ts
Normal file
41
src/app/api/admin/forum/dashboard/report_komentar/route.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.forum_ReportKomentar.count({
|
||||
where: {
|
||||
isActive: true,
|
||||
}
|
||||
})
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data forum dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data forum dashboard", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data forum dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
41
src/app/api/admin/forum/dashboard/report_posting/route.ts
Normal file
41
src/app/api/admin/forum/dashboard/report_posting/route.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.forum_ReportPosting.count({
|
||||
where: {
|
||||
isActive: true,
|
||||
}
|
||||
})
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data forum dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data forum dashboard", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data forum dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
46
src/app/api/admin/investasi/dashboard/[name]/route.ts
Normal file
46
src/app/api/admin/investasi/dashboard/[name]/route.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }: { params: { name: string } }) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
const { name } = params;
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(name);
|
||||
fixData = await prisma.investasi.count({
|
||||
where: {
|
||||
MasterStatusInvestasi: {
|
||||
name: fixStatus
|
||||
},
|
||||
}
|
||||
})
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data investasi dashboard",
|
||||
data: fixData,
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data investasi dashboard >>", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data investasi dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
50
src/app/api/admin/job/dashboard/[status]/route.ts
Normal file
50
src/app/api/admin/job/dashboard/[status]/route.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }: {
|
||||
params: { status: string }
|
||||
}) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
const { status } = params;
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
fixData = await prisma.job.count({
|
||||
where: {
|
||||
MasterStatus: {
|
||||
name: fixStatus,
|
||||
},
|
||||
isArsip: false,
|
||||
}
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data job-vacancy dashboard",
|
||||
data: fixData
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data job-vacancy dashboard", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data job-vacancy dashboard",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
44
src/app/api/admin/job/dashboard/arsip/route.ts
Normal file
44
src/app/api/admin/job/dashboard/arsip/route.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.job.count({
|
||||
where: {
|
||||
MasterStatus: {
|
||||
name: "Publish"
|
||||
},
|
||||
isArsip: true
|
||||
}
|
||||
})
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data job-vacancy dashboard",
|
||||
data: fixData
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data job-vacancy dashboard", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data job-vacancy dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
31
src/app/api/admin/main_dashboard/portofolio/route.ts
Normal file
31
src/app/api/admin/main_dashboard/portofolio/route.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const data = await prisma.portofolio.count({
|
||||
where: {
|
||||
active: true
|
||||
}
|
||||
});
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Data portofolio",
|
||||
data: data
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
backendLogger.error("Error Get Count Portofolio Main Dashboard")
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error Get Count Portofolio Main Dashboard",
|
||||
data: null
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
42
src/app/api/admin/main_dashboard/user/route.ts
Normal file
42
src/app/api/admin/main_dashboard/user/route.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
try {
|
||||
const data = await prisma.user.count({
|
||||
where: {
|
||||
active: true
|
||||
},
|
||||
|
||||
|
||||
})
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Data user",
|
||||
data: data
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error("Error Get Count User Main Dashboard")
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Gagal mendapatkan data",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
|
||||
}
|
||||
51
src/app/api/admin/voting/dashboard/[name]/route.ts
Normal file
51
src/app/api/admin/voting/dashboard/[name]/route.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }: {
|
||||
params: { name: string }
|
||||
}) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
|
||||
const { name } = params;
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(name);
|
||||
fixData = await prisma.voting.count({
|
||||
where: {
|
||||
Voting_Status: {
|
||||
name: fixStatus
|
||||
},
|
||||
isArsip: false
|
||||
},
|
||||
})
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data voting dashboard",
|
||||
data: fixData
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data voting dashboard >>", error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Error get data voting dashboard",
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
44
src/app/api/admin/voting/dashboard/riwayat/route.ts
Normal file
44
src/app/api/admin/voting/dashboard/riwayat/route.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
},
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
try {
|
||||
let fixData;
|
||||
fixData = await prisma.voting.count({
|
||||
where: {
|
||||
Voting_Status: {
|
||||
name: "Publish",
|
||||
},
|
||||
isArsip: true,
|
||||
}
|
||||
})
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: 'Success get data voting dashboard',
|
||||
data: fixData
|
||||
},
|
||||
{ status: 200 }
|
||||
)
|
||||
} catch (error) {
|
||||
backendLogger.error('Error get data voting dashboard >>', error);
|
||||
NextResponse.json({
|
||||
success: false,
|
||||
message: 'Error get data voting dashboard',
|
||||
reason: (error as Error).message
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
48
src/app/api/event/[id]/route.ts
Normal file
48
src/app/api/event/[id]/route.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
context: { params: { id: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const { id } = context.params;
|
||||
|
||||
fixData = await prisma.event.findUnique({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
include: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
EventMaster_TipeAcara: true,
|
||||
EventMaster_Status: true,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Berhasil mendapatkan data",
|
||||
data: fixData,
|
||||
});
|
||||
} catch (error) {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Gagal mendapatkan data" },
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,16 @@
|
||||
import { event_funCheckKehadiran } from "@/app_modules/event/fun";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const { searchParams } = new URL(req.url);
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const { searchParams } = new URL(request.url);
|
||||
const userId = searchParams.get("userId");
|
||||
const eventId = searchParams.get("eventId");
|
||||
|
||||
|
||||
@@ -1,15 +1,50 @@
|
||||
import { event_funCheckPesertaByUserId } from "@/app_modules/event/fun";
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const { searchParams } = new URL(req.url);
|
||||
const userId = searchParams.get("userId");
|
||||
const eventId = searchParams.get("eventId");
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const res = await event_funCheckPesertaByUserId({
|
||||
eventId: eventId as string,
|
||||
userId: userId as string,
|
||||
});
|
||||
try {
|
||||
let fixData;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const userId = searchParams.get("userId");
|
||||
const eventId = searchParams.get("eventId");
|
||||
|
||||
return NextResponse.json(res, { status: 200 });
|
||||
const check = await prisma.event_Peserta.findFirst({
|
||||
where: {
|
||||
userId: userId,
|
||||
eventId: eventId,
|
||||
},
|
||||
});
|
||||
|
||||
if (check) {
|
||||
fixData = true;
|
||||
} else {
|
||||
fixData = false;
|
||||
}
|
||||
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json(
|
||||
{ success: true, message: "Success get data", data: fixData },
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
await prisma.$disconnect();
|
||||
backendLogger.error("Error get data detail event:", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Gagal mendapatkan data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
67
src/app/api/event/peserta/[id]/route.ts
Normal file
67
src/app/api/event/peserta/[id]/route.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
context: { params: { id: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const { id } = context.params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const page = searchParams.get("page");
|
||||
const takeData = 10;
|
||||
const skipData = Number(page) * takeData - takeData;
|
||||
|
||||
fixData = await prisma.event_Peserta.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
eventId: id,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
active: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
userId: true,
|
||||
isPresent: true,
|
||||
User: {
|
||||
select: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
Event: true,
|
||||
eventId: true,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get data",
|
||||
data: fixData,
|
||||
});
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get list data:", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed get data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
106
src/app/api/event/sponsor/[id]/route.ts
Normal file
106
src/app/api/event/sponsor/[id]/route.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { IEventSponsor } from "@/app_modules/event/_lib/interface";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(
|
||||
request: Request,
|
||||
context: { params: { id: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "POST") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
if (!userLoginId) {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "User not found" },
|
||||
{ status: 401 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const { id } = context.params;
|
||||
const req: IEventSponsor = await request.json();
|
||||
|
||||
fixData = await prisma.eventSponsor.create({
|
||||
data: {
|
||||
eventId: id,
|
||||
name: req.name as string,
|
||||
fileName: req.fileName as string,
|
||||
fileExt: req.fileExt as string,
|
||||
fileId: req.fileId as string,
|
||||
// authorId: userLoginId,
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success create sponsor",
|
||||
});
|
||||
} catch (error) {
|
||||
await prisma.$disconnect();
|
||||
backendLogger.error("Error create sponsor event", error);
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Failed create sponsor" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
context: { params: { id: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const { id } = context.params;
|
||||
|
||||
fixData = await prisma.eventSponsor.findUnique({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
include: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success create sponsor",
|
||||
data: fixData,
|
||||
});
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get sponsor event", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed create sponsor",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
79
src/app/api/event/sponsor/list/[id]/route.ts
Normal file
79
src/app/api/event/sponsor/list/[id]/route.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
context: { params: { id: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const { id } = context.params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const page = searchParams.get("page");
|
||||
const takeData = 10;
|
||||
const skipData = Number(page) * takeData - takeData;
|
||||
|
||||
if (!page) {
|
||||
fixData = await prisma.eventSponsor.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
eventId: id,
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
include: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
} else {
|
||||
fixData = await prisma.eventSponsor.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
eventId: id,
|
||||
},
|
||||
include: {
|
||||
Author: {
|
||||
include: {
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success create sponsor",
|
||||
data: fixData,
|
||||
});
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get sponsor event", error);
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed create sponsor",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
39
src/app/api/event/tipe-acara/route.ts
Normal file
39
src/app/api/event/tipe-acara/route.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const data = await prisma.eventMaster_TipeAcara.findMany({
|
||||
orderBy: {
|
||||
id: "asc",
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Success get tipe acara",
|
||||
data: data,
|
||||
});
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get tipe acara", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Failed get tipe acara ",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
41
src/app/api/master/bank/route.ts
Normal file
41
src/app/api/master/bank/route.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await prisma.masterBank.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "asc",
|
||||
},
|
||||
where: {
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json(
|
||||
{ success: true, message: "Berhasil mendapatkan data", data: res },
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
await prisma.$disconnect();
|
||||
backendLogger.error("Error Get Master Bank >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "API Error Get Data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
41
src/app/api/master/status_transaksi/route.ts
Normal file
41
src/app/api/master/status_transaksi/route.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: "Method not allowed" },
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await prisma.masterStatusTransaksi.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "asc",
|
||||
},
|
||||
where: {
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json(
|
||||
{ success: true, message: "Berhasil mendapatkan data", data: res },
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
await prisma.$disconnect();
|
||||
backendLogger.error("Error Get Master Status Transaksi >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "API Error Get Data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -68,18 +68,3 @@ export async function GET(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function main({ id }: { id: string }) {
|
||||
const fixData = await prisma.beritaInvestasi.findMany({
|
||||
take: 10,
|
||||
skip: 0,
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
investasiId: id.trim(),
|
||||
active: true,
|
||||
},
|
||||
});
|
||||
console.log("data sebelum disconnect>>", fixData);
|
||||
}
|
||||
|
||||
@@ -1,33 +1,55 @@
|
||||
import { decrypt } from "@/app/auth/_lib/decrypt";
|
||||
import { prisma } from "@/app/lib";
|
||||
import { cookies } from 'next/headers'
|
||||
import { cookies } from "next/headers";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const token = req.headers.get('Authorization')?.split(' ')[1];
|
||||
try {
|
||||
const token = req.headers.get("Authorization")?.split(" ")[1];
|
||||
|
||||
const decripted = await decrypt({
|
||||
token: token!,
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!
|
||||
})
|
||||
token: token!,
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||
});
|
||||
|
||||
if (!decripted) {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Unauthorized"
|
||||
}, { status: 401 })
|
||||
await prisma.$disconnect();
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Unauthorized",
|
||||
},
|
||||
{ status: 401 }
|
||||
);
|
||||
}
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
id: decripted.id
|
||||
}
|
||||
})
|
||||
where: {
|
||||
id: decripted.id,
|
||||
},
|
||||
});
|
||||
|
||||
// Disconnect after successful query
|
||||
await prisma.$disconnect();
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Berhasil mendapatkan data",
|
||||
data: user
|
||||
})
|
||||
}
|
||||
success: true,
|
||||
message: "Berhasil mendapatkan data",
|
||||
data: user,
|
||||
});
|
||||
} catch (error) {
|
||||
// Ensure connection is closed even if error occurs
|
||||
await prisma.$disconnect();
|
||||
|
||||
console.error("Error in user validation:", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Terjadi kesalahan pada server",
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
46
src/app/api/user/all/route.ts
Normal file
46
src/app/api/user/all/route.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
if (request.method === "GET") {
|
||||
try {
|
||||
let fixData;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const except_id = searchParams.get("except-id");
|
||||
|
||||
if (!except_id) {
|
||||
fixData = await prisma.user.findMany({
|
||||
where: {
|
||||
active: true,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
fixData = await prisma.user.findMany({
|
||||
where: {
|
||||
active: true,
|
||||
masterUserRoleId: "1",
|
||||
id: {
|
||||
not: except_id,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Berhasil mendapatkan data",
|
||||
data: fixData,
|
||||
});
|
||||
} catch (error) {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Gagal mendapatkan data",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
message: "Method not allowed",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,9 @@ export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<AdminDonasi_Main
|
||||
countPublish={countPublish as number}
|
||||
countReview={countReview as number}
|
||||
countDraft={countDraft as number}
|
||||
countReject={countReject as number}
|
||||
// countPublish={countPublish as number}
|
||||
// countReview={countReview as number}
|
||||
// countReject={countReject as number}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
134
src/app/dev/admin/event/_lib/api_fecth_admin_event.ts
Normal file
134
src/app/dev/admin/event/_lib/api_fecth_admin_event.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
export {
|
||||
apiGetAdminEventStatusCountDashboard as apiGetEventStatusCountDashboard,
|
||||
apiGetAdminEventCountTipeAcara as apiGetEventTipeAcara,
|
||||
apiGetAdminEventRiwayatCount as apiGetEventRiwayatCount,
|
||||
apiGetAdminEventByStatus as apiGetDataEventByStatus,
|
||||
apiGetAdminEventRiwayat,
|
||||
apiGetAdminEventTipeAcara,
|
||||
};
|
||||
|
||||
const apiGetAdminEventStatusCountDashboard = async ({
|
||||
name,
|
||||
}: {
|
||||
name: "Publish" | "Review" | "Reject";
|
||||
}) => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const response = await fetch(`/api/admin/event/dashboard/${name}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiGetAdminEventRiwayatCount = async () => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const response = await fetch(`/api/admin/event/dashboard/riwayat`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiGetAdminEventCountTipeAcara = async () => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const response = await fetch(`/api/admin/event/dashboard/tipe-acara`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiGetAdminEventByStatus = async ({
|
||||
status,
|
||||
page,
|
||||
search,
|
||||
}: {
|
||||
status: "Publish" | "Review" | "Reject";
|
||||
page: string;
|
||||
search: string;
|
||||
}) => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const isPage = page ? `?page=${page}` : "";
|
||||
const isSearch = search ? `&search=${search}` : "";
|
||||
const respone = await fetch(
|
||||
`/api/admin/event/${status}${isPage}${isSearch}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return await respone.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiGetAdminEventRiwayat = async ({
|
||||
page,
|
||||
search,
|
||||
}: {
|
||||
page: string;
|
||||
search: string;
|
||||
}) => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const isPage = page ? `?page=${page}` : "";
|
||||
const isSearch = search ? `&search=${search}` : "";
|
||||
const response = await fetch(`/api/admin/event/riwayat${isPage}${isSearch}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiGetAdminEventTipeAcara = async () => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const response = await fetch(`/api/event/tipe-acara`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
@@ -1,12 +1,10 @@
|
||||
import { AdminEvent_Riwayat } from "@/app_modules/admin/event";
|
||||
import { adminEvent_funGetListAllRiwayat } from "@/app_modules/admin/event/fun/get/get_list_all_riwayat";
|
||||
|
||||
export default async function Page() {
|
||||
const listRiwayat = await adminEvent_funGetListAllRiwayat({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_Riwayat listRiwayat={listRiwayat} />
|
||||
<AdminEvent_Riwayat />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ import { AdminEvent_DetailTipeAcara } from "@/app_modules/admin/event";
|
||||
import { AdminEvent_getListTipeAcara } from "@/app_modules/admin/event/fun/get/get_list_tipe_acara";
|
||||
|
||||
export default async function Page() {
|
||||
const listTipe = await AdminEvent_getListTipeAcara()
|
||||
// const listTipe = await AdminEvent_getListTipeAcara()
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_DetailTipeAcara listTipe={listTipe}/>
|
||||
<AdminEvent_DetailTipeAcara />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
11
src/app/dev/admin/event/detail/detail_sponsor/page.tsx
Normal file
11
src/app/dev/admin/event/detail/detail_sponsor/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import AdminEvent_DetailSponsor from '@/app_modules/admin/event/table_status/detail_sponsor';
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_DetailSponsor />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
12
src/app/dev/admin/event/detail/publish/[id]/page.tsx
Normal file
12
src/app/dev/admin/event/detail/publish/[id]/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import AdminEvent_DetailPublish from '@/app_modules/admin/event/table_status/detail_publish';
|
||||
import React from 'react';
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_DetailPublish/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
@@ -1,26 +1,9 @@
|
||||
import { AdminEvent_Main } from "@/app_modules/admin/event";
|
||||
import AdminEvent_funCountByStatusId from "@/app_modules/admin/event/fun/count/fun_count_event_by_status_id";
|
||||
import { AdminEvent_funCountRiwayat } from "@/app_modules/admin/event/fun/count/fun_count_riwayat";
|
||||
import { AdminEvent_funCountTipeAcara } from "@/app_modules/admin/event/fun/count/fun_count_tipe_acara";
|
||||
|
||||
export default async function Page() {
|
||||
const countPublish = await AdminEvent_funCountByStatusId("1");
|
||||
const countReview = await AdminEvent_funCountByStatusId("2");
|
||||
const countDraft = await AdminEvent_funCountByStatusId("3");
|
||||
const countReject = await AdminEvent_funCountByStatusId("4");
|
||||
const countTipeAcara = await AdminEvent_funCountTipeAcara();
|
||||
const countRiwayat = await AdminEvent_funCountRiwayat();
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_Main
|
||||
countPublish={countPublish as number}
|
||||
countReview={countReview as number}
|
||||
countDraft={countDraft as number}
|
||||
countReject={countReject as number}
|
||||
countTipeAcara={countTipeAcara as number}
|
||||
countRiwayat={countRiwayat}
|
||||
/>
|
||||
<AdminEvent_Main />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { AdminEvent_TablePublish } from "@/app_modules/admin/event";
|
||||
import { adminEvent_funGetListPublish } from "@/app_modules/admin/event/fun";
|
||||
|
||||
async function Page() {
|
||||
const listPublish = await adminEvent_funGetListPublish({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_TablePublish listPublish={listPublish as any} />
|
||||
<AdminEvent_TablePublish />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ import { AdminEvent_TableReject } from "@/app_modules/admin/event";
|
||||
import { adminEvent_funGetListReject } from "@/app_modules/admin/event/fun";
|
||||
|
||||
export default async function Page() {
|
||||
const listReject = await adminEvent_funGetListReject({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_TableReject listReject={listReject as any} />
|
||||
<AdminEvent_TableReject />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { AdminEvent_TableReview } from "@/app_modules/admin/event";
|
||||
import { adminEvent_funGetListReview } from "@/app_modules/admin/event/fun";
|
||||
|
||||
export default async function Page() {
|
||||
const listReview = await adminEvent_funGetListReview({ page: 1 });
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminEvent_TableReview listData={listReview as any} />
|
||||
<AdminEvent_TableReview />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<AdminForum_Main
|
||||
countPublish={countPublish}
|
||||
countLaporanPosting={countLaporanPosting}
|
||||
countLaporanKomentar={countLaporanKomentar}
|
||||
// countPublish={countPublish}
|
||||
// countLaporanPosting={countLaporanPosting}
|
||||
// countLaporanKomentar={countLaporanKomentar}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -6,10 +6,10 @@ import Admin_getTotalInvestasiByUser from "@/app_modules/admin/investasi/fun/get
|
||||
|
||||
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 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)
|
||||
@@ -18,10 +18,10 @@ export default async function Page() {
|
||||
<>
|
||||
<Admin_Investasi
|
||||
listInvestasi={listInvestasi as any}
|
||||
countDraft={countDraft}
|
||||
countReview={countReview}
|
||||
countPublish={countPublish}
|
||||
countReject={countReject}
|
||||
// countDraft={countDraft}
|
||||
// countReview={countReview}
|
||||
// countPublish={countPublish}
|
||||
// countReject={countReject}
|
||||
totalInvestasiByUser={totalInvestasiByUser}
|
||||
publishProgres={publishProgres}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import { AdminJob_Main } from "@/app_modules/admin/job";
|
||||
import { AdminJob_funCountStatusByStatusId } from "@/app_modules/admin/job/fun/count/fun_count_job_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const countPublish = await AdminJob_funCountStatusByStatusId("1")
|
||||
const countReview = await AdminJob_funCountStatusByStatusId("2");
|
||||
const countReject = await AdminJob_funCountStatusByStatusId("4");
|
||||
const countArsip = await AdminJob_funCountStatusByStatusId("0")
|
||||
// const countPublish = await AdminJob_funCountStatusByStatusId("1")
|
||||
// const countReview = await AdminJob_funCountStatusByStatusId("2");
|
||||
// const countReject = await AdminJob_funCountStatusByStatusId("4");
|
||||
// const countArsip = await AdminJob_funCountStatusByStatusId("0")
|
||||
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<AdminJob_Main
|
||||
countPublish={countPublish as number}
|
||||
countReview={countReview as number}
|
||||
countReject={countReject as number}
|
||||
countArsip={countArsip as number}
|
||||
// countPublish={countPublish as number}
|
||||
// countReview={countReview as number}
|
||||
// countReject={countReject as number}
|
||||
// countArsip={countArsip as number}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -3,12 +3,12 @@ import { AdminMainDashboard_CountPOrtofolio } from "@/app_modules/admin/main_das
|
||||
import { AdminMainDashboard_CountUser } from "@/app_modules/admin/main_dashboard/fun/count/fun_count_user";
|
||||
|
||||
export default async function Page() {
|
||||
const countUser = await AdminMainDashboard_CountUser();
|
||||
const countPorto = await AdminMainDashboard_CountPOrtofolio();
|
||||
// const countUser = await AdminMainDashboard_CountUser();
|
||||
// const countPorto = await AdminMainDashboard_CountPOrtofolio();
|
||||
|
||||
// await new Promise((a, b) => {
|
||||
// setTimeout(a, 4000);
|
||||
// });
|
||||
|
||||
return <AdminMain countUser={countUser} countPorto={countPorto} />;
|
||||
return <AdminMain/>;
|
||||
}
|
||||
|
||||
@@ -2,18 +2,18 @@ import { AdminVote_Main } from "@/app_modules/admin/vote";
|
||||
import AdminVote_funCountByStatusId from "@/app_modules/admin/vote/fun/count/fun_count_vote_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const countPublish = await AdminVote_funCountByStatusId("1");
|
||||
const countReview = await AdminVote_funCountByStatusId("2");
|
||||
const countDraft = await AdminVote_funCountByStatusId("0");
|
||||
const countReject = await AdminVote_funCountByStatusId("4");
|
||||
// const countPublish = await AdminVote_funCountByStatusId("1");
|
||||
// const countReview = await AdminVote_funCountByStatusId("2");
|
||||
// const countDraft = await AdminVote_funCountByStatusId("0");
|
||||
// const countReject = await AdminVote_funCountByStatusId("4");
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminVote_Main
|
||||
countPublish={countPublish as number}
|
||||
countReview={countReview as number}
|
||||
countDraft={countDraft as number}
|
||||
countReject={countReject as number}
|
||||
// countPublish={countPublish as number}
|
||||
// countReview={countReview as number}
|
||||
// countDraft={countDraft as number}
|
||||
// countReject={countReject as number}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import { CreateDonasiNew } from "@/app_modules/donasi";
|
||||
|
||||
|
||||
export default async function Page() {
|
||||
// const masterKategori = await Donasi_getMasterKategori();
|
||||
// const masterDurasi = await Donasi_getMasterDurasi();
|
||||
|
||||
return (
|
||||
// <CreateDonasi masterKategori={masterKategori} masterDurasi={masterDurasi} />
|
||||
<CreateDonasiNew />
|
||||
);
|
||||
return <CreateDonasiNew />;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Donasi_CreateKabar } from "@/app_modules/donasi";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const donasiId = params.id;
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Donasi_CreateKabar donasiId={donasiId} />
|
||||
<Donasi_CreateKabar />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
import { EditDonasi, EditDonasiNew } from "@/app_modules/donasi";
|
||||
import { Donasi_getMasterDurasi, Donasi_getMasterKategori } from "@/app_modules/donasi/fun";
|
||||
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
// const dataDonasi = await Donasi_getOneById(params.id)
|
||||
// const masterKategori = await Donasi_getMasterKategori()
|
||||
// const masterDurasi = await Donasi_getMasterDurasi()
|
||||
import { EditDonasiNew } from "@/app_modules/donasi";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
{/* <EditDonasi dataDonasi={dataDonasi as any} masterKategori={masterKategori} masterDurasi={masterDurasi} /> */}
|
||||
<EditDonasiNew />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { funGetUserIdByToken } from '@/app_modules/_global/fun/get';
|
||||
import LayoutEvent_DetailSponsor from '@/app_modules/event/detail/detail_sponsor/layout';
|
||||
import React from 'react';
|
||||
|
||||
function Layout({children} : {children: React.ReactNode}) {
|
||||
async function Layout({children} : {children: React.ReactNode}) {
|
||||
const userLoginId = await funGetUserIdByToken()
|
||||
return (
|
||||
<>
|
||||
<LayoutEvent_DetailSponsor>{children}</LayoutEvent_DetailSponsor>
|
||||
<LayoutEvent_DetailSponsor userLoginId={userLoginId}>
|
||||
{children}
|
||||
</LayoutEvent_DetailSponsor>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { funGetUserIdByToken } from '@/app_modules/_global/fun/get';
|
||||
import DetailSponsor_Event from '@/app_modules/event/detail/detail_sponsor';
|
||||
import React from 'react';
|
||||
|
||||
function Page() {
|
||||
async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
return (
|
||||
<>
|
||||
<DetailSponsor_Event/>
|
||||
<DetailSponsor_Event userLoginId={userLoginId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,13 +5,12 @@ import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let eventId = params.id;
|
||||
const dataEvent = await event_getOneById(eventId);
|
||||
const listKontributor = await Event_getListPesertaById(eventId);
|
||||
// const dataEvent = await event_getOneById(eventId);
|
||||
// const listKontributor = await Event_getListPesertaById(eventId);
|
||||
const totalPeserta = await Event_countTotalPesertaById(eventId)
|
||||
return (
|
||||
<>
|
||||
<Event_DetailKontribusi
|
||||
eventId={eventId}
|
||||
totalPeserta={totalPeserta}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -2,17 +2,15 @@ import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { Event_DetailMain } from "@/app_modules/event";
|
||||
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let eventId = params.id;
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const totalPeserta = await Event_countTotalPesertaById(eventId);
|
||||
// const totalPeserta = await Event_countTotalPesertaById(eventId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Event_DetailMain
|
||||
userLoginId={userLoginId as string}
|
||||
totalPeserta={totalPeserta as any}
|
||||
eventId={eventId}
|
||||
// totalPeserta={totalPeserta as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -9,7 +9,6 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
<>
|
||||
<Event_DetailRiwayat
|
||||
totalPeserta={totalPeserta as any}
|
||||
eventId={eventId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
14
src/app/dev/event/detail/sponsor/edit_sponsor/layout.tsx
Normal file
14
src/app/dev/event/detail/sponsor/edit_sponsor/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import Event_LayoutEditSponsor from '@/app_modules/event/detail/sponsor/edit_sponsor/layout';
|
||||
import React from 'react';
|
||||
|
||||
function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Event_LayoutEditSponsor>
|
||||
{children}
|
||||
</Event_LayoutEditSponsor>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Layout;
|
||||
12
src/app/dev/event/detail/sponsor/edit_sponsor/page.tsx
Normal file
12
src/app/dev/event/detail/sponsor/edit_sponsor/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import Event_EditSponsor from '@/app_modules/event/detail/sponsor/edit_sponsor';
|
||||
import React from 'react';
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<>
|
||||
<Event_EditSponsor/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
@@ -0,0 +1,14 @@
|
||||
import Event_LayoutMetodePembayaran from '@/app_modules/event/detail/sponsor/metode_pembayaran/layout';
|
||||
import React from 'react';
|
||||
|
||||
function Layout({ children } : { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Event_LayoutMetodePembayaran>
|
||||
{children}
|
||||
</Event_LayoutMetodePembayaran>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Layout;
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
import Event_MetodePembayaran from '@/app_modules/event/detail/sponsor/metode_pembayaran';
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<>
|
||||
<Event_MetodePembayaran />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
@@ -0,0 +1,12 @@
|
||||
import Event_LayoutNominalSponsor from '@/app_modules/event/detail/sponsor/nominal_sponsor/layout';
|
||||
import React from 'react';
|
||||
|
||||
function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Event_LayoutNominalSponsor>{children}</Event_LayoutNominalSponsor>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Layout;
|
||||
@@ -0,0 +1,12 @@
|
||||
import Event_PilihNominalSponsor from '@/app_modules/event/detail/sponsor/nominal_sponsor';
|
||||
import React from 'react';
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<>
|
||||
<Event_PilihNominalSponsor />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
14
src/app/dev/event/invoice/[id]/layout.tsx
Normal file
14
src/app/dev/event/invoice/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import Event_LayoutInvoice from '@/app_modules/event/detail/invoice/layout';
|
||||
import React from 'react';
|
||||
|
||||
function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Event_LayoutInvoice>
|
||||
{children}
|
||||
</Event_LayoutInvoice>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Layout;
|
||||
14
src/app/dev/event/invoice/[id]/page.tsx
Normal file
14
src/app/dev/event/invoice/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { funGetUserIdByToken } from '@/app_modules/_global/fun/get';
|
||||
import Event_Invoice from '@/app_modules/event/detail/invoice';
|
||||
import React from 'react';
|
||||
|
||||
async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
return (
|
||||
<>
|
||||
<Event_Invoice userLoginId={userLoginId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
@@ -1,17 +1,12 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import Ui_Konfirmasi from "@/app_modules/event/_ui/konfirmasi";
|
||||
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const eventId = (await params).id;
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Ui_Konfirmasi userLoginId={userLoginId as string} eventId={eventId} />
|
||||
<Ui_Konfirmasi userLoginId={userLoginId as string} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
|
||||
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Notifikasi_UiMain />
|
||||
<Notifikasi_UiMain userLoginId={userLoginId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
|
||||
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
return (
|
||||
<>
|
||||
<Notifikasi_UiMain />
|
||||
<Notifikasi_UiMain userLoginId={userLoginId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ const DIRECTORY_ID = {
|
||||
|
||||
// Job
|
||||
job_image: "cm0ypp6zl0003kp7jf59zuvjy",
|
||||
|
||||
// Event
|
||||
event_sponsor: "cm65zlbyf001udvmggnd6i0oh",
|
||||
event_bukti_transfer: "cm65zlehy001wdvmgnobur2zh",
|
||||
};
|
||||
|
||||
export default DIRECTORY_ID;
|
||||
|
||||
5
src/app/lib/limit.ts
Normal file
5
src/app/lib/limit.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import pLimit from "p-limit";
|
||||
|
||||
const global_limit = pLimit(1);
|
||||
|
||||
export default global_limit;
|
||||
@@ -1,28 +0,0 @@
|
||||
"use server";
|
||||
|
||||
import _ from "lodash";
|
||||
import { cookies } from "next/headers";
|
||||
import { decrypt } from "../auth/_lib/decrypt";
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
|
||||
export async function newFunGetUserId() {
|
||||
try {
|
||||
const key = process.env.NEXT_PUBLIC_BASE_SESSION_KEY;
|
||||
const c = cookies().get("hipmi-key");
|
||||
|
||||
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const token = c.value;
|
||||
const dataUser = await decrypt({
|
||||
token: token,
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||
});
|
||||
|
||||
return dataUser?.id;
|
||||
} catch (error) {
|
||||
backendLogger.log("Gagal mendapatkan user id", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,4 @@ process.on("SIGINT", async () => {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
// console.log("==> Test prisma");
|
||||
|
||||
export default prisma;
|
||||
|
||||
@@ -3,6 +3,8 @@ export const RouterAdminEvent = {
|
||||
|
||||
// detail
|
||||
detail_peserta: "/dev/admin/event/detail/peserta/",
|
||||
detail_publish: "/dev/admin/event/detail/publish/",
|
||||
detail_sponsor: "/dev/admin/event/detail/detail_sponsor/",
|
||||
|
||||
// child
|
||||
detail_tipe_acara: "/dev/admin/event/child/tipe_acara",
|
||||
@@ -12,4 +14,7 @@ export const RouterAdminEvent = {
|
||||
table_review: "/dev/admin/event/table/review",
|
||||
table_publish: "/dev/admin/event/table/publish",
|
||||
table_reject: "/dev/admin/event/table/reject",
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -22,6 +22,7 @@ export const RouterAdminDonasi_OLD = {
|
||||
table_publish: "/dev/admin/donasi/table/publish",
|
||||
table_review: "/dev/admin/donasi/table/review",
|
||||
table_reject: "/dev/admin/donasi/table/reject",
|
||||
table_kategori: "/dev/admin/donasi/table/kategori",
|
||||
|
||||
// detail
|
||||
detail_publish: "/dev/admin/donasi/detail/publish/",
|
||||
|
||||
@@ -7,7 +7,7 @@ export const RouterEvent = {
|
||||
riwayat: ({ id }: { id: string }) => `/dev/event/main/riwayat/${id}`,
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param statusId | 1 - 4 | 1: Publish, 2: Review, 3: Draft, 4: Reject
|
||||
* @type string
|
||||
*/
|
||||
@@ -34,17 +34,20 @@ export const RouterEvent = {
|
||||
detail_riwayat: "/dev/event/detail/riwayat/",
|
||||
|
||||
//peserta
|
||||
daftar_peserta: ({ id }: { id: string }) =>
|
||||
`/dev/event/detail/peserta/${id}`,
|
||||
daftar_peserta: ({ id }: { id: string }) => `/dev/event/detail/peserta/${id}`,
|
||||
|
||||
//sponsor
|
||||
daftar_sponsor: ({ id }: { id: string }) =>
|
||||
`/dev/event/detail/sponsor/${id}`,
|
||||
tambah_sponsor: "/dev/event/detail/tambah_sponsor/",
|
||||
daftar_sponsor: ({ id }: { id: string }) => `/dev/event/detail/sponsor/${id}`,
|
||||
edit_sponsor: "/dev/event/detail/sponsor/edit_sponsor/",
|
||||
tambah_sponsor: ({ id }: { id: string }) =>
|
||||
`/dev/event/detail/sponsor/tambah_sponsor/${id}`,
|
||||
detail_sponsor: ({ id }: { id: string }) =>
|
||||
`/dev/event/detail/detail_sponsor/${id}`,
|
||||
nominal_sponsor: ({ id }: { id: string }) =>
|
||||
`/dev/event/detail/sponsor/nominal_sponsor/${id}`,
|
||||
|
||||
|
||||
|
||||
metode_pembayaran: ({ id }: { id: string }) =>
|
||||
`/dev/event/detail/sponsor/metode_pembayaran/${id}`,
|
||||
invoice: ({ id }: { id: string }) =>
|
||||
`/dev/event/invoice/${id}`,
|
||||
};
|
||||
|
||||
|
||||
30
src/app/zz-makuro/LoadDataContoh.tsx
Normal file
30
src/app/zz-makuro/LoadDataContoh.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
"use client";
|
||||
import { Stack } from "@mantine/core";
|
||||
import useSwr from "swr";
|
||||
|
||||
const fether = (url: string) =>
|
||||
fetch("https://jsonplaceholder.typicode.com" + url, {
|
||||
cache: "force-cache",
|
||||
next: {
|
||||
revalidate: 60,
|
||||
},
|
||||
}).then((res) => res.json());
|
||||
|
||||
export default function LoadDataContoh() {
|
||||
const { data, isLoading, error, mutate, isValidating } = useSwr(
|
||||
"/posts/1",
|
||||
fether,
|
||||
{
|
||||
revalidateOnFocus: false,
|
||||
revalidateOnReconnect: false,
|
||||
refreshInterval: 1000,
|
||||
}
|
||||
);
|
||||
return (
|
||||
<Stack>
|
||||
{isLoading && <div>Loading...</div>}
|
||||
LoadDataContoh
|
||||
{JSON.stringify(data, null, 2)}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
9
src/app/zz-makuro/get-data-example.ts
Normal file
9
src/app/zz-makuro/get-data-example.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
async function getDataExample() {
|
||||
const res = await fetch("https://jsonplaceholder.typicode.com/posts", {
|
||||
next: {
|
||||
revalidate: 60,
|
||||
},
|
||||
});
|
||||
|
||||
return res.json();
|
||||
}
|
||||
@@ -1,14 +1,51 @@
|
||||
"use client";
|
||||
import { useHookstate } from "@hookstate/core";
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import { Suspense } from "react";
|
||||
import LoadDataContoh from "./LoadDataContoh";
|
||||
|
||||
const listMenu = [
|
||||
{
|
||||
name: "Dashboard",
|
||||
url: "/dashboard",
|
||||
icon: "dashboard",
|
||||
},
|
||||
{
|
||||
name: "Event",
|
||||
url: "/event",
|
||||
icon: "event",
|
||||
},
|
||||
{
|
||||
name: "Donasi",
|
||||
url: "/donasi",
|
||||
icon: "donasi",
|
||||
},
|
||||
];
|
||||
|
||||
export default function Page() {
|
||||
const fether = async (url: string) =>
|
||||
fetch("https://jsonplaceholder.typicode.com" + url, {
|
||||
next: {
|
||||
revalidate: 2,
|
||||
},
|
||||
}).then(async (res) => {
|
||||
const data = await res.json();
|
||||
// console.log(data);
|
||||
return data;
|
||||
});
|
||||
|
||||
export default async function Page() {
|
||||
const data = await fether("/posts/1");
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
|
||||
<Button onClick={() => {}}>tekan</Button>
|
||||
</Stack>
|
||||
<div>
|
||||
{listMenu.map((item) => {
|
||||
return (
|
||||
<div key={item.name}>
|
||||
<a href={item.url}>{item.name}</a>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{/* <LoadDataContoh /> */}
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
{JSON.stringify(data, null, 2)}
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export const MainColor = {
|
||||
};
|
||||
|
||||
export const AccentColor = {
|
||||
blackgray: "#333533",
|
||||
blackgray: "#333533FF",
|
||||
darkblue: "#002E59",
|
||||
blue: "#00447D",
|
||||
softblue: "#007CBA",
|
||||
@@ -19,7 +19,25 @@ export const AccentColor = {
|
||||
white: "#FEFFFE"
|
||||
|
||||
};
|
||||
|
||||
export const AdminColor = {
|
||||
yellow: "#FFEB99",
|
||||
green: "#A7DCA5",
|
||||
orange: "#F7C69B",
|
||||
red: "#F4A8A8",
|
||||
bgAdmin: "#182c47",
|
||||
white: "#D6D9DCFF",
|
||||
dividerWhite: "#D6D9DC2E",
|
||||
softBlue: "#163C64FF"
|
||||
|
||||
}
|
||||
//yellow: "#FFC300"
|
||||
//yellow: "#FFD60A"
|
||||
// white: "#FEFFFE"
|
||||
|
||||
// Warna Terang: #80a7c4
|
||||
// Warna Sedang: #40738d
|
||||
// Warna Asli: #002e59
|
||||
// Warna Lebih Gelap: #001f3b
|
||||
// Warna Tergelap: #001323
|
||||
|
||||
|
||||
@@ -25,8 +25,10 @@ import voting_status from "../../../bin/seeder/voting/master_status.json";
|
||||
import { master_kategori_app } from "@/bin/seeder/master";
|
||||
import { new_status_transaksi_investasi } from "@/bin/seeder/investasi";
|
||||
import { master_nama_bank } from "@/bin/seeder/master";
|
||||
import { master_status_transaksi } from "@/bin/seeder/master";
|
||||
import pLimit from "p-limit";
|
||||
|
||||
export async function generate_seeder() {
|
||||
async function masterUserRole() {
|
||||
for (let i of userRole) {
|
||||
await prisma.masterUserRole.upsert({
|
||||
where: {
|
||||
@@ -42,7 +44,10 @@ export async function generate_seeder() {
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("masterUserRole success");
|
||||
}
|
||||
|
||||
async function seederUser() {
|
||||
for (let i of userSeeder) {
|
||||
await prisma.user.upsert({
|
||||
where: {
|
||||
@@ -62,7 +67,10 @@ export async function generate_seeder() {
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("user seeder success");
|
||||
}
|
||||
|
||||
async function masterBisnis() {
|
||||
for (let i of bidangBisnis) {
|
||||
await prisma.masterBidangBisnis.upsert({
|
||||
where: {
|
||||
@@ -78,7 +86,10 @@ export async function generate_seeder() {
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("masterBisnis success");
|
||||
}
|
||||
|
||||
async function masterPencarianInvestor() {
|
||||
for (let i of pencarianInvestor) {
|
||||
await prisma.masterPencarianInvestor.upsert({
|
||||
where: {
|
||||
@@ -95,6 +106,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterPencarianInvestor success");
|
||||
}
|
||||
|
||||
async function masterPembagianDeviden() {
|
||||
for (let i of pembagianDeviden) {
|
||||
await prisma.masterPembagianDeviden.upsert({
|
||||
where: {
|
||||
@@ -111,6 +126,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterPembagianDeviden success");
|
||||
}
|
||||
|
||||
async function masterPeriodeDeviden() {
|
||||
for (let i of periodeDeviden) {
|
||||
await prisma.masterPeriodeDeviden.upsert({
|
||||
where: {
|
||||
@@ -127,6 +146,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterPeriodeDeviden success");
|
||||
}
|
||||
|
||||
async function masterStatusInvestasi() {
|
||||
for (let i of statusInvestasi) {
|
||||
await prisma.masterStatusInvestasi.upsert({
|
||||
where: {
|
||||
@@ -145,6 +168,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterStatusInvestasi success");
|
||||
}
|
||||
|
||||
async function masterNamaBank() {
|
||||
for (let i of master_nama_bank) {
|
||||
await prisma.masterBank.upsert({
|
||||
where: {
|
||||
@@ -164,7 +191,11 @@ export async function generate_seeder() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
console.log("masterNamaBank success");
|
||||
}
|
||||
|
||||
async function masterStatusTransaksiInvestasi() {
|
||||
for (let i of statusTransaksiInvestasi) {
|
||||
await prisma.masterStatusTransaksiInvestasi.upsert({
|
||||
where: {
|
||||
@@ -183,6 +214,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterStatusTransaksiInvestasi success");
|
||||
}
|
||||
|
||||
async function masterProgressInvestasi() {
|
||||
for (let i of jenisProgres) {
|
||||
await prisma.masterProgresInvestasi.upsert({
|
||||
where: {
|
||||
@@ -198,6 +233,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterProgressInvestasi success");
|
||||
}
|
||||
|
||||
async function masterStatusDonasi() {
|
||||
for (let d of donasi_status) {
|
||||
await prisma.donasiMaster_StatusDonasi.upsert({
|
||||
where: {
|
||||
@@ -213,6 +252,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterStatusDonasi success");
|
||||
}
|
||||
|
||||
async function masterKategoriDonasi() {
|
||||
for (let d of donasi_kategori) {
|
||||
await prisma.donasiMaster_Kategori.upsert({
|
||||
where: {
|
||||
@@ -228,6 +271,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterKategoriDonasi success");
|
||||
}
|
||||
|
||||
async function masterDurasiDonasi() {
|
||||
for (let d of donasi_durasi) {
|
||||
await prisma.donasiMaster_Durasi.upsert({
|
||||
where: {
|
||||
@@ -243,6 +290,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterDurasiDonasi success");
|
||||
}
|
||||
|
||||
async function masterDonasiNamaBank() {
|
||||
for (let i of donasi_namaBank) {
|
||||
await prisma.donasiMaster_Bank.upsert({
|
||||
where: {
|
||||
@@ -261,6 +312,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterDonasiBank success");
|
||||
}
|
||||
|
||||
async function masterDonasiStatusInvoice() {
|
||||
for (let d of donasi_status_invoice) {
|
||||
await prisma.donasiMaster_StatusInvoice.upsert({
|
||||
where: {
|
||||
@@ -276,6 +331,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterDonasiStatusInvoice success");
|
||||
}
|
||||
|
||||
async function masterEventStatus() {
|
||||
for (let e of event_status) {
|
||||
await prisma.eventMaster_Status.upsert({
|
||||
where: {
|
||||
@@ -291,6 +350,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterEventStatus success");
|
||||
}
|
||||
|
||||
async function masterEventTipeAcara() {
|
||||
for (let e of event_tipe_acara) {
|
||||
await prisma.eventMaster_TipeAcara.upsert({
|
||||
where: {
|
||||
@@ -306,6 +369,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterEventTipeAcara success");
|
||||
}
|
||||
|
||||
async function masterVotingStatus() {
|
||||
for (let v of voting_status) {
|
||||
await prisma.voting_Status.upsert({
|
||||
where: {
|
||||
@@ -321,6 +388,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterVotingStatus success");
|
||||
}
|
||||
|
||||
async function masterStatusProses() {
|
||||
for (let m of master_status) {
|
||||
await prisma.masterStatus.upsert({
|
||||
where: {
|
||||
@@ -336,6 +407,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterStatusProses success");
|
||||
}
|
||||
|
||||
async function masterForumKategoriReport() {
|
||||
for (let m of forum_kategori_report) {
|
||||
await prisma.forumMaster_KategoriReport.upsert({
|
||||
where: {
|
||||
@@ -352,6 +427,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterForumKategoriReport success");
|
||||
}
|
||||
|
||||
async function masterForumStatusPosting() {
|
||||
for (let s of forum_status_posting) {
|
||||
await prisma.forumMaster_StatusPosting.upsert({
|
||||
where: {
|
||||
@@ -366,6 +445,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterForumStatusPosting success");
|
||||
}
|
||||
|
||||
async function masterCollaborationIndustri() {
|
||||
for (let p of collaboration_industri) {
|
||||
await prisma.projectCollaborationMaster_Industri.upsert({
|
||||
where: {
|
||||
@@ -380,6 +463,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterCollaborationIndustri success");
|
||||
}
|
||||
|
||||
async function masterCollaborationStatus() {
|
||||
for (let p of collaboration_status) {
|
||||
await prisma.projectCollaborationMaster_Status.upsert({
|
||||
where: {
|
||||
@@ -394,6 +481,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterCollaborationStatus success");
|
||||
}
|
||||
|
||||
async function seederNomorAdmin() {
|
||||
for (let a of nomor_admin) {
|
||||
await prisma.nomorAdmin.upsert({
|
||||
where: {
|
||||
@@ -410,6 +501,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("seederNomorAdmin success");
|
||||
}
|
||||
|
||||
async function masterKategoriApp() {
|
||||
for (let a of master_kategori_app) {
|
||||
await prisma.masterKategoriApp.upsert({
|
||||
where: {
|
||||
@@ -426,6 +521,10 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterKategoriApp success");
|
||||
}
|
||||
|
||||
async function masterInvestasiNewTransaksiStatus() {
|
||||
for (let a of new_status_transaksi_investasi) {
|
||||
await prisma.investasiMaster_StatusInvoice.upsert({
|
||||
where: {
|
||||
@@ -442,5 +541,66 @@ export async function generate_seeder() {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterInvestasiNewTransaksiStatus success");
|
||||
}
|
||||
|
||||
async function masterStatusTransaksi() {
|
||||
for (let a of master_status_transaksi) {
|
||||
await prisma.masterStatusTransaksi.upsert({
|
||||
where: {
|
||||
id: a.id,
|
||||
},
|
||||
create: {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
},
|
||||
update: {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
console.log("masterStatusTransaksi success");
|
||||
}
|
||||
|
||||
const listSeederQueue = [
|
||||
masterUserRole,
|
||||
seederUser,
|
||||
masterBisnis,
|
||||
masterPencarianInvestor,
|
||||
masterPembagianDeviden,
|
||||
masterPeriodeDeviden,
|
||||
masterStatusInvestasi,
|
||||
masterNamaBank,
|
||||
masterStatusTransaksiInvestasi,
|
||||
masterProgressInvestasi,
|
||||
masterStatusDonasi,
|
||||
masterKategoriDonasi,
|
||||
masterDurasiDonasi,
|
||||
masterDonasiNamaBank,
|
||||
masterDonasiStatusInvoice,
|
||||
masterEventStatus,
|
||||
masterEventTipeAcara,
|
||||
masterVotingStatus,
|
||||
masterStatusProses,
|
||||
masterForumKategoriReport,
|
||||
masterForumStatusPosting,
|
||||
masterCollaborationIndustri,
|
||||
masterCollaborationStatus,
|
||||
seederNomorAdmin,
|
||||
masterKategoriApp,
|
||||
masterInvestasiNewTransaksiStatus,
|
||||
masterStatusTransaksi,
|
||||
];
|
||||
const limit = pLimit(1);
|
||||
|
||||
export async function generate_seeder() {
|
||||
try {
|
||||
await Promise.all(listSeederQueue.map((fn) => limit(fn)));
|
||||
} catch (error) {
|
||||
console.error("error generate seeder", error);
|
||||
}
|
||||
|
||||
return { status: 200, success: true };
|
||||
}
|
||||
|
||||
465
src/app_modules/_global/fun/generete_seeder.back.txt
Normal file
465
src/app_modules/_global/fun/generete_seeder.back.txt
Normal file
@@ -0,0 +1,465 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import bidangBisnis from "../../../bin/seeder/bidang_bisnis.json";
|
||||
import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
|
||||
import collaboration_status from "../../../bin/seeder/colab/master_status.json";
|
||||
import donasi_namaBank from "../../../bin/seeder/donasi/master_bank.json";
|
||||
import donasi_durasi from "../../../bin/seeder/donasi/master_durasi.json";
|
||||
import donasi_kategori from "../../../bin/seeder/donasi/master_kategori.json";
|
||||
import donasi_status from "../../../bin/seeder/donasi/master_status.json";
|
||||
import donasi_status_invoice from "../../../bin/seeder/donasi/master_status_invoice.json";
|
||||
import event_status from "../../../bin/seeder/event/master_status.json";
|
||||
import event_tipe_acara from "../../../bin/seeder/event/master_tipe_acara.json";
|
||||
import forum_kategori_report from "../../../bin/seeder/forum/master_report.json";
|
||||
import forum_status_posting from "../../../bin/seeder/forum/master_status.json";
|
||||
import jenisProgres from "../../../bin/seeder/investasi/master_progres.json";
|
||||
import pembagianDeviden from "../../../bin/seeder/investasi/pembagian_deviden.json";
|
||||
import pencarianInvestor from "../../../bin/seeder/investasi/pencarian_investor.json";
|
||||
import periodeDeviden from "../../../bin/seeder/investasi/periode_deviden.json";
|
||||
import statusInvestasi from "../../../bin/seeder/investasi/status_investasi.json";
|
||||
import statusTransaksiInvestasi from "../../../bin/seeder/investasi/status_transaksi_investasi.json";
|
||||
import master_status from "../../../bin/seeder/master_status.json";
|
||||
import nomor_admin from "../../../bin/seeder/nomor_admin.json";
|
||||
import userRole from "../../../bin/seeder/user_role.json";
|
||||
import userSeeder from "../../../bin/seeder/user_seeder.json";
|
||||
import voting_status from "../../../bin/seeder/voting/master_status.json";
|
||||
import { master_kategori_app } from "@/bin/seeder/master";
|
||||
import { new_status_transaksi_investasi } from "@/bin/seeder/investasi";
|
||||
import { master_nama_bank } from "@/bin/seeder/master";
|
||||
import pLimit from "p-limit";
|
||||
|
||||
// PAKEK p-limit
|
||||
|
||||
async function masterUserRole() {
|
||||
for (let i of userRole) {
|
||||
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,
|
||||
},
|
||||
});
|
||||
}
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000));
|
||||
console.log("masterUserRole success");
|
||||
}
|
||||
|
||||
async function user() {
|
||||
for (let i of userSeeder) {
|
||||
await prisma.user.upsert({
|
||||
where: {
|
||||
nomor: i.nomor,
|
||||
},
|
||||
create: {
|
||||
nomor: i.nomor,
|
||||
username: i.name,
|
||||
masterUserRoleId: i.masterUserRoleId,
|
||||
active: i.active,
|
||||
},
|
||||
update: {
|
||||
nomor: i.nomor,
|
||||
username: i.name,
|
||||
masterUserRoleId: i.masterUserRoleId,
|
||||
active: i.active,
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("user success");
|
||||
}
|
||||
|
||||
const listAntrean = [masterUserRole, user];
|
||||
const limit = pLimit(1);
|
||||
|
||||
(async () => {
|
||||
console.log("start generate seeder");
|
||||
await Promise.all(listAntrean.map((fn) => limit(fn)));
|
||||
console.log("success generate seeder");
|
||||
})();
|
||||
|
||||
export async function generate_seeder() {
|
||||
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 master_nama_bank) {
|
||||
await prisma.masterBank.upsert({
|
||||
where: {
|
||||
id: i.id.toString(),
|
||||
},
|
||||
create: {
|
||||
id: i.id.toString(),
|
||||
namaBank: i.namaBank,
|
||||
namaAkun: i.namaAkun,
|
||||
norek: i.norek.toString(),
|
||||
},
|
||||
update: {
|
||||
id: i.id.toString(),
|
||||
namaBank: i.namaBank,
|
||||
namaAkun: i.namaAkun,
|
||||
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,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let i of donasi_namaBank) {
|
||||
await prisma.donasiMaster_Bank.upsert({
|
||||
where: {
|
||||
id: i.id,
|
||||
},
|
||||
create: {
|
||||
id: i.id,
|
||||
name: i.name,
|
||||
norek: i.norek,
|
||||
},
|
||||
update: {
|
||||
id: i.id,
|
||||
name: i.name,
|
||||
norek: i.norek,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let d of donasi_status_invoice) {
|
||||
await prisma.donasiMaster_StatusInvoice.upsert({
|
||||
where: {
|
||||
id: d.id,
|
||||
},
|
||||
create: {
|
||||
id: d.id,
|
||||
name: d.name,
|
||||
},
|
||||
update: {
|
||||
name: d.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let e of event_status) {
|
||||
await prisma.eventMaster_Status.upsert({
|
||||
where: {
|
||||
id: e.id,
|
||||
},
|
||||
create: {
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
},
|
||||
update: {
|
||||
name: e.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let e of event_tipe_acara) {
|
||||
await prisma.eventMaster_TipeAcara.upsert({
|
||||
where: {
|
||||
id: e.id,
|
||||
},
|
||||
create: {
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
},
|
||||
update: {
|
||||
name: e.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let v of voting_status) {
|
||||
await prisma.voting_Status.upsert({
|
||||
where: {
|
||||
id: v.id,
|
||||
},
|
||||
create: {
|
||||
id: v.id,
|
||||
name: v.name,
|
||||
},
|
||||
update: {
|
||||
name: v.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let m of master_status) {
|
||||
await prisma.masterStatus.upsert({
|
||||
where: {
|
||||
id: m.id,
|
||||
},
|
||||
create: {
|
||||
id: m.id,
|
||||
name: m.name,
|
||||
},
|
||||
update: {
|
||||
name: m.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let m of forum_kategori_report) {
|
||||
await prisma.forumMaster_KategoriReport.upsert({
|
||||
where: {
|
||||
id: m.id as number,
|
||||
},
|
||||
create: {
|
||||
title: m.title,
|
||||
deskripsi: m.deskripsi,
|
||||
},
|
||||
update: {
|
||||
title: m.title,
|
||||
deskripsi: m.deskripsi,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let s of forum_status_posting) {
|
||||
await prisma.forumMaster_StatusPosting.upsert({
|
||||
where: {
|
||||
id: s.id,
|
||||
},
|
||||
create: {
|
||||
status: s.status,
|
||||
},
|
||||
update: {
|
||||
status: s.status,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let p of collaboration_industri) {
|
||||
await prisma.projectCollaborationMaster_Industri.upsert({
|
||||
where: {
|
||||
id: p.id,
|
||||
},
|
||||
create: {
|
||||
name: p.name,
|
||||
},
|
||||
update: {
|
||||
name: p.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let p of collaboration_status) {
|
||||
await prisma.projectCollaborationMaster_Status.upsert({
|
||||
where: {
|
||||
id: p.id,
|
||||
},
|
||||
create: {
|
||||
name: p.name,
|
||||
},
|
||||
update: {
|
||||
name: p.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let a of nomor_admin) {
|
||||
await prisma.nomorAdmin.upsert({
|
||||
where: {
|
||||
id: a.id,
|
||||
},
|
||||
create: {
|
||||
id: a.id,
|
||||
nomor: a.nomor,
|
||||
},
|
||||
update: {
|
||||
id: a.id,
|
||||
nomor: a.nomor,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let a of master_kategori_app) {
|
||||
await prisma.masterKategoriApp.upsert({
|
||||
where: {
|
||||
id: a.id,
|
||||
},
|
||||
create: {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
},
|
||||
update: {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (let a of new_status_transaksi_investasi) {
|
||||
await prisma.investasiMaster_StatusInvoice.upsert({
|
||||
where: {
|
||||
id: a.id,
|
||||
},
|
||||
create: {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
},
|
||||
update: {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return { status: 200, success: true };
|
||||
}
|
||||
19
src/app_modules/_global/lib/api_master.ts
Normal file
19
src/app_modules/_global/lib/api_master.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export { apiGetMasterBank };
|
||||
|
||||
const apiGetMasterBank = async () => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const respone = await fetch(`/api/master/bank`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
return await respone.json().catch(() => null);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export const apiGetUserId = async () => {
|
||||
},
|
||||
});
|
||||
|
||||
console.log("Ini di pemanggilan API",await response.json());
|
||||
console.log("Ini di pemanggilan API", await response.json());
|
||||
|
||||
if (!response.ok) return null;
|
||||
const data: Record<string, any> = await response.json();
|
||||
@@ -37,3 +37,24 @@ export const apiGetACtivationUser = async () => {
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
export const apiGetAllUserWithExceptId = async ({
|
||||
exceptId,
|
||||
}: {
|
||||
exceptId?: string;
|
||||
}) => {
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const isExceptId = exceptId ? `?except-id=${exceptId}` : "";
|
||||
|
||||
const response = await fetch(`/api/user/all${isExceptId}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function UIGlobal_Drawer({
|
||||
</Group>
|
||||
<SimpleGrid cols={component.length < 4 ? component.length : 4}>
|
||||
{component.map((e, i) => (
|
||||
<Stack key={i} align="center" spacing={"xs"}
|
||||
<Stack key={i} align="center" spacing={"xs"}
|
||||
onClick={() => {
|
||||
setPageId(e?.id);
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function UIGlobal_DrawerCustom({
|
||||
}: {
|
||||
opened: boolean;
|
||||
close: () => void;
|
||||
component: React.ReactNode;
|
||||
component: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { AdminColor } from '@/app_modules/_global/color/color_pallet';
|
||||
import { Group, Modal, Stack } from '@mantine/core';
|
||||
import React from 'react';
|
||||
|
||||
function Admin_ComponentModalPublish({ onClose, opened, title, buttonKiri, buttonKanan, }: {
|
||||
onClose: () => void;
|
||||
opened: any;
|
||||
title: string;
|
||||
buttonKiri: React.ReactNode;
|
||||
buttonKanan: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
styles={{ content: { backgroundColor: AdminColor.softBlue, }, header: { backgroundColor: AdminColor.softBlue }, title: { color: AdminColor.white } }}
|
||||
centered
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
title={title}
|
||||
size={"sm"}
|
||||
withCloseButton={false}
|
||||
>
|
||||
<Stack>
|
||||
<Group position="center">
|
||||
{buttonKiri}
|
||||
{buttonKanan}
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Admin_ComponentModalPublish;
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Group, Modal, Stack, Textarea } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
@@ -25,6 +26,8 @@ export function Admin_ComponentModalReport({
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
style={{ color: AdminColor.white}}
|
||||
styles={{ content: { backgroundColor: AdminColor.softBlue, }, header: { backgroundColor: AdminColor.softBlue }, title: { color: AdminColor.white } }}
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
title={title}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Skeleton, SkeletonProps, createStyles } from '@mantine/core';
|
||||
|
||||
interface CustomSkeletonProps extends SkeletonProps {
|
||||
isLoading?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const useStyles = createStyles((theme) => ({
|
||||
skeleton: {
|
||||
'&::before': {
|
||||
backgroundColor: "#1F5B9E",
|
||||
},
|
||||
'&::after': {
|
||||
backgroundColor: "#0F3055",
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
const CustomSkeletonAdmin: React.FC<CustomSkeletonProps> = ({
|
||||
isLoading = true,
|
||||
className,
|
||||
...props
|
||||
}) => {
|
||||
const { classes, cx } = useStyles();
|
||||
return (
|
||||
<Skeleton
|
||||
className={cx(classes.skeleton, className)}
|
||||
visible={isLoading}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default CustomSkeletonAdmin;
|
||||
@@ -0,0 +1,53 @@
|
||||
import { MainColor, AccentColor } from '@/app_modules/_global/color';
|
||||
import { AdminColor } from '@/app_modules/_global/color/color_pallet';
|
||||
import { Flex, Grid, Paper, Stack, Text, ThemeIcon, Title } from '@mantine/core';
|
||||
import React from 'react';
|
||||
import CustomSkeletonAdmin from './customSkeletonAdmin';
|
||||
import ComponentAdminGlobal_HeaderTamplate from '../../header_tamplate';
|
||||
import { IconFileText, IconUsers } from '@tabler/icons-react';
|
||||
|
||||
function MainDashboardSkeleton() {
|
||||
const listBox = [
|
||||
{
|
||||
id: 1,
|
||||
name: "User",
|
||||
jumlah: "",
|
||||
link: "",
|
||||
icon: <IconUsers size={18} color="#0066CCFF" />
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Portofolio",
|
||||
jumlah: "countPortofolio",
|
||||
link: "",
|
||||
icon: <IconFileText size={18} color={"#B6A22EFF"} />
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"sm"}>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Main Dashboard" />
|
||||
<Grid>
|
||||
{listBox.map((e) => (
|
||||
<Grid.Col md={4} lg={4} key={e.id}>
|
||||
<Paper style={{ borderColor: "transparent" }} bg={AdminColor.softBlue} withBorder shadow="md" radius="md" p="md">
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} c={MainColor.white}>{e.name}</Text>
|
||||
<Flex align={"center"} justify={"space-between"}>
|
||||
<CustomSkeletonAdmin w={40} h={50} />
|
||||
<ThemeIcon radius={"xl"} size={"md"} color={AccentColor.white}>{e.icon}</ThemeIcon>
|
||||
</Flex>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Grid.Col>
|
||||
))}
|
||||
|
||||
<Grid.Col md={4} lg={4}>
|
||||
{/* <PieChart /> */}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
export default MainDashboardSkeleton;
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Group, Title, TextInput } from "@mantine/core";
|
||||
import { IconSearch } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
@@ -17,11 +18,11 @@ export function ComponentAdminGlobal_TitlePage({
|
||||
<>
|
||||
<Group
|
||||
position="apart"
|
||||
bg={color ? color : "gray.4"}
|
||||
bg={color ? color : AdminColor.softBlue}
|
||||
p={"xs"}
|
||||
style={{ borderRadius: "6px" }}
|
||||
>
|
||||
<Title order={4}>{name}</Title>
|
||||
<Title c={"white"} order={4}>{name}</Title>
|
||||
{component ? component : ""}
|
||||
</Group>
|
||||
</>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { AccentColor, AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Group, Button, Loader } from "@mantine/core";
|
||||
import { IconChevronLeft } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -17,7 +18,7 @@ export default function AdminGlobal_ComponentBackButton({
|
||||
<>
|
||||
<Group>
|
||||
<Button
|
||||
c={"gray"}
|
||||
c={AccentColor.white}
|
||||
leftIcon={
|
||||
isLoading ? (
|
||||
<Loader size={"xs"} color={"gray"} />
|
||||
@@ -25,7 +26,7 @@ export default function AdminGlobal_ComponentBackButton({
|
||||
<IconChevronLeft />
|
||||
)
|
||||
}
|
||||
variant="white"
|
||||
style={{ backgroundColor: AdminColor.softBlue}}
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
// setTimeout(() => , 3000);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { Box, Title, Divider, Stack } from "@mantine/core";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Divider, Stack, Title } from "@mantine/core";
|
||||
|
||||
export default function ComponentAdminGlobal_HeaderTamplate({name}: {name: string}) {
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={5} >
|
||||
<Title>{name ? name : null}</Title>
|
||||
<Divider/>
|
||||
<Title mb={"md"} c={AdminColor.white}>{name ? name : null}</Title>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
AdminAppInformation_ViewInformasiWhatApps,
|
||||
AdminAppInformation_ViewKategoriPortofolio,
|
||||
} from "../view";
|
||||
import { AccentColor, AdminColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminAppInformation_UiMain({
|
||||
nomorAdmin,
|
||||
@@ -45,8 +46,8 @@ export default function AdminAppInformation_UiMain({
|
||||
<Button
|
||||
key={i}
|
||||
radius={"xl"}
|
||||
c={"white"}
|
||||
bg={selectPage === e.id ? "blue" : "gray.3"}
|
||||
c={selectPage === e.id ? AdminColor.white : "gray"}
|
||||
bg={selectPage === e.id ? AccentColor.blue : AccentColor.darkblue}
|
||||
onClick={() => {
|
||||
setSelectPage(e.id);
|
||||
}}
|
||||
|
||||
@@ -18,17 +18,18 @@ import {
|
||||
Title,
|
||||
Tooltip,
|
||||
} from "@mantine/core";
|
||||
import { IconCirclePlus, IconEdit } from "@tabler/icons-react";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||
import { AdminAppInformation_ComponentTitlePageBank } from "../component";
|
||||
import adminAppInformation_createBank from "../fun/create/fun_create_new_bank";
|
||||
import adminAppInformation_getMasterBank from "../fun/master/get_list_bank";
|
||||
import adminAppInformation_updateStatusBankById from "../fun/update/fun_udpate_status_bank";
|
||||
import adminAppInformation_updateDataBankById from "../fun/update/fun_update_data_bank";
|
||||
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
|
||||
import { AdminAppInformation_ComponentTitlePageBank } from "../component";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminAppInformation_ViewInfoBank({
|
||||
listBank,
|
||||
@@ -127,7 +128,7 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center w={150}>
|
||||
<Center c={AccentColor.white} w={150}>
|
||||
<Text>{e?.namaBank}</Text>
|
||||
</Center>
|
||||
</td>
|
||||
@@ -149,12 +150,12 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
<Text>{e?.namaAkun}</Text>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
<Text>{e?.norek}</Text>
|
||||
</Center>
|
||||
</td>
|
||||
@@ -176,7 +177,7 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
}}
|
||||
>
|
||||
<Tooltip label="Edit">
|
||||
<IconEdit color="green" />
|
||||
<IconEdit color={AccentColor.white} />
|
||||
</Tooltip>
|
||||
</ActionIcon>
|
||||
</Stack>
|
||||
@@ -199,32 +200,31 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
|
||||
<Grid>
|
||||
<Grid.Col span={9}>
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"65vh"}>
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} h={"65vh"}>
|
||||
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
||||
<Table
|
||||
verticalSpacing={"xs"}
|
||||
horizontalSpacing={"md"}
|
||||
p={"md"}
|
||||
w={1000}
|
||||
striped
|
||||
highlightOnHover
|
||||
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center w={150}>Bank</Center>
|
||||
<Center c={AdminColor.white} w={150}>Bank</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Status</Center>
|
||||
<Center c={AdminColor.white}>Status</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Nama Rekening</Center>
|
||||
<Center c={AdminColor.white}>Nama Rekening</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Nomor Rekening</Center>
|
||||
<Center c={AdminColor.white}>Nomor Rekening</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
<Center c={AdminColor.white}>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -236,14 +236,18 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
|
||||
<Grid.Col span={3}>
|
||||
{isCreate ? (
|
||||
<Paper p={"md"} withBorder shadow="lg">
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg">
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Tambah Daftar Bank</Title>
|
||||
<Title c={AccentColor.white} order={5}>Tambah Daftar Bank</Title>
|
||||
</Center>
|
||||
|
||||
<TextInput
|
||||
label={"Nama Bank"}
|
||||
styles={{
|
||||
label: {
|
||||
color: AdminColor.white,}
|
||||
}}
|
||||
placeholder="Masukan nama bank"
|
||||
onChange={(val) => {
|
||||
setNewData({
|
||||
@@ -255,6 +259,10 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
|
||||
<TextInput
|
||||
label={"Nama Rekening"}
|
||||
styles={{
|
||||
label: {
|
||||
color: AdminColor.white,}
|
||||
}}
|
||||
placeholder="Masukan nama rekening"
|
||||
onChange={(val) => {
|
||||
setNewData({
|
||||
@@ -266,6 +274,10 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
|
||||
<TextInput
|
||||
label={"Nomor Rekening Bank"}
|
||||
styles={{
|
||||
label: {
|
||||
color: AdminColor.white,}
|
||||
}}
|
||||
placeholder=" Masukan nomor rekening bank"
|
||||
type="number"
|
||||
onChange={(val) => {
|
||||
@@ -305,13 +317,17 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
)}
|
||||
|
||||
{isUpdate ? (
|
||||
<Paper p={"md"} withBorder shadow="lg">
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg">
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Update Data Bank</Title>
|
||||
<Title c={AdminColor.white} order={5}>Update Data Bank</Title>
|
||||
</Center>
|
||||
<TextInput
|
||||
label={"Nama Bank"}
|
||||
styles={{
|
||||
label: {
|
||||
color: AdminColor.white,}
|
||||
}}
|
||||
placeholder="Masukan nama bank"
|
||||
value={updateData.namaBank}
|
||||
onChange={(val) => {
|
||||
@@ -322,6 +338,10 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
|
||||
<TextInput
|
||||
label={"Nama Rekening"}
|
||||
styles={{
|
||||
label: {
|
||||
color: AdminColor.white,}
|
||||
}}
|
||||
placeholder="Masukan nama rekening"
|
||||
value={updateData.namaAkun}
|
||||
onChange={(val) => {
|
||||
@@ -332,6 +352,10 @@ export default function AdminAppInformation_ViewInfoBank({
|
||||
|
||||
<TextInput
|
||||
label={"Nomor Rekening Bank"}
|
||||
styles={{
|
||||
label: {
|
||||
color: AdminColor.white,}
|
||||
}}
|
||||
placeholder=" Masukan nomor rekening bank"
|
||||
type="number"
|
||||
value={updateData.norek}
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_
|
||||
import adminAppInformation_getNomorAdmin from "../fun/master/get_nomor_admin";
|
||||
import adminAppInformation_funUpdateNomorAdmin from "../fun/update/fun_update_nomor";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { AccentColor, AdminColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminAppInformation_ViewInformasiWhatApps({
|
||||
nomorAdmin,
|
||||
@@ -55,17 +55,17 @@ export default function AdminAppInformation_ViewInformasiWhatApps({
|
||||
<Stack spacing={"xs"}>
|
||||
<Group
|
||||
position="apart"
|
||||
bg={"gray.4"}
|
||||
bg={AdminColor.softBlue}
|
||||
p={"xs"}
|
||||
style={{ borderRadius: "6px" }}
|
||||
>
|
||||
<Title order={4}>Informasi WhatsApp</Title>
|
||||
<Title c={AdminColor.white} order={4}>Informasi WhatsApp</Title>
|
||||
</Group>
|
||||
</Stack>
|
||||
|
||||
<Paper w={"50%"} withBorder p={"md"}>
|
||||
<Paper w={"50%"} bg={AdminColor.softBlue} p={"md"}>
|
||||
<Stack>
|
||||
<Paper bg={"gray.4"} p={"xl"}>
|
||||
<Paper c={AdminColor.white} bg={AccentColor.darkblue} p={"xl"}>
|
||||
<Group position="apart">
|
||||
<Title order={2}>{`+${dataNomor.nomor}`}</Title>
|
||||
<Tooltip label={"Edit"}>
|
||||
@@ -82,7 +82,7 @@ export default function AdminAppInformation_ViewInformasiWhatApps({
|
||||
style={{
|
||||
transition: "0.2s",
|
||||
}}
|
||||
color={MainColor.darkblue}
|
||||
color={AdminColor.white}
|
||||
/>
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
adminAppInformation_funGetBidangBisnis,
|
||||
adminAppInformation_funUpdateBidangBisnis,
|
||||
} from "../fun";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export function AdminAppInformation_ViewKategoriPortofolio({
|
||||
dataBidangBisnis,
|
||||
@@ -128,7 +129,7 @@ export function AdminAppInformation_ViewKategoriPortofolio({
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>
|
||||
<Text>{e?.name}</Text>
|
||||
<Text c={AdminColor.white}>{e?.name}</Text>
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
@@ -164,7 +165,7 @@ export function AdminAppInformation_ViewKategoriPortofolio({
|
||||
}}
|
||||
>
|
||||
<Tooltip label="Edit">
|
||||
<IconEdit color="green" />
|
||||
<IconEdit color={AdminColor.white} />
|
||||
</Tooltip>
|
||||
</ActionIcon>
|
||||
</Stack>
|
||||
@@ -193,26 +194,25 @@ export function AdminAppInformation_ViewKategoriPortofolio({
|
||||
|
||||
<Grid>
|
||||
<Grid.Col span={9}>
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"65vh"}>
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} h={"65vh"}>
|
||||
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
||||
<Table
|
||||
verticalSpacing={"xs"}
|
||||
horizontalSpacing={"md"}
|
||||
p={"md"}
|
||||
w={"100%"}
|
||||
striped
|
||||
highlightOnHover
|
||||
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Kategori</Center>
|
||||
<Center c={AdminColor.white}>Kategori</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Status</Center>
|
||||
<Center c={AdminColor.white}>Status</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
<Center c={AdminColor.white}>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -225,10 +225,10 @@ export function AdminAppInformation_ViewKategoriPortofolio({
|
||||
<Grid.Col span={3}>
|
||||
{/* Form Create */}
|
||||
{isCreate ? (
|
||||
<Paper p={"md"} withBorder shadow="lg">
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg">
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Tambah Bidang Bisnis</Title>
|
||||
<Title c={AdminColor.white} order={5}>Tambah Bidang Bisnis</Title>
|
||||
</Center>
|
||||
|
||||
<TextInput
|
||||
@@ -269,10 +269,10 @@ export function AdminAppInformation_ViewKategoriPortofolio({
|
||||
)}
|
||||
{/* Form Update */}
|
||||
{isUpdate ? (
|
||||
<Paper p={"md"} withBorder shadow="lg">
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg">
|
||||
<Stack>
|
||||
<Center>
|
||||
<Title order={5}>Update Bidang Bisnis</Title>
|
||||
<Title c={AdminColor.white} order={5}>Update Bidang Bisnis</Title>
|
||||
</Center>
|
||||
<TextInput
|
||||
placeholder="Masukan bidang bisnis"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user