## Deskripsi:
- Cek notif
## No Issue
This commit is contained in:
2024-08-26 17:18:09 +08:00
parent a6bb993b0d
commit 916c5c7d85
183 changed files with 720 additions and 584 deletions

View File

@@ -0,0 +1,32 @@
"use server";
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
interface Model_Invoice_Masuk {
total: number;
jumlah: number;
pilihBank: string;
investasiId: string;
}
export async function investasi_funCreateInvoice({
data,
}: {
data: Model_Invoice_Masuk;
}) {
const authorId = await user_getOneUserId();
const create = await prisma.investasi_Invoice.create({
data: {
nominal: "" + data.total,
lembarTerbeli: "" + data.jumlah ,
masterBankId: data.pilihBank,
authorId: authorId,
investasiId: data.investasiId,
statusInvoiceId: "3",
},
});
if (!create) return { status: 400, message: "Gagal membuat invoice" };
return { status: 201, data: create, message: "Berhasil membuat invoice" };
}

View File

@@ -0,0 +1,21 @@
"use server";
import prisma from "@/app/lib/prisma";
export async function investasi_funGetInvoiceById({
invoiceId,
}: {
invoiceId: string;
}) {
const data = await prisma.investasi_Invoice.findFirst({
where: {
id: invoiceId,
},
include: {
MasterBank: true,
StatusInvoice: true,
},
});
return data;
}