add notification create route, update permit update rotue

This commit is contained in:
2025-03-27 11:08:49 +05:30
parent 300e67bcb7
commit 3e68d594d2
7 changed files with 70 additions and 4 deletions

View File

@@ -1,10 +1,24 @@
import { getFilterObject, getSortObject, PageQueryParams } from "../pagination";
import { generateId } from "../utils/id";
import {
CreateNotificationInput,
notificationFields,
notificationModel,
UpdateNotificationInput,
} from "./notification.schema";
export async function createNotification(
input: CreateNotificationInput,
tenantId: string
) {
return await notificationModel.create({
...input,
pid: generateId(),
tenantId: tenantId,
createdAt: new Date(),
});
}
export async function updateNotification(
notifId: string,
input: UpdateNotificationInput,