"feat: add EventItem, EventReview models with seed data and mock files, update User and Event schemas"

This commit is contained in:
louiscklaw
2025-06-03 15:29:05 +08:00
parent a0a4ffcb4e
commit 24920fb313
52 changed files with 2140 additions and 56 deletions

View File

@@ -0,0 +1,52 @@
// src/app/services/AppLog.service.ts
//
// REQ0047/T.B.A.
//
// PURPOSE:
// - AppLog example for handling AppLog Record
//
// RULES:
// - T.B.A.
//
import type { AppLog } from '@prisma/client';
import prisma from '../lib/prisma';
type CreateAppLog = {
level: number;
message: string;
};
// type UpdateAppLog = {
// level: number;
// message: string;
// };
async function listAppLogs(): Promise<AppLog[]> {
return prisma.appLog.findMany();
}
async function getAppLog(appLogId: string) {
return prisma.appLog.findFirst({ where: { id: appLogId } });
}
async function createNewAppLog(createForm: CreateAppLog) {
return prisma.appLog.create({ data: createForm });
}
// async function updateAppLog(appLogId: string, updateForm: UpdateAppLog) {
// return prisma.appLog.update({ where: { id: appLogId }, data: updateForm });
// }
async function deleteAppLog(appLogId: string) {
return prisma.appLog.delete({ where: { id: appLogId } });
}
export {
getAppLog,
listAppLogs,
// updateAppLog,
deleteAppLog,
createNewAppLog,
};