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,6 +1,6 @@
import { buildJsonSchemas } from "fastify-zod";
import mongoose from "mongoose";
import { z } from "zod";
import { TypeOf, z } from "zod";
import { pageQueryParams } from "../pagination";
const notificationSchema = new mongoose.Schema({
@@ -31,15 +31,29 @@ export const notificationModel = mongoose.model(
notificationSchema
);
const createNotificationInput = z.object({
permitId: z.string(),
permitNumber: z.string(),
link: z.string(),
status: z.string(),
accelaStatus: z.string(),
changes: z.object({}).passthrough(),
county: z.object({}).passthrough(),
client: z.string(),
clientData: z.object({}).passthrough(),
});
const updateNotificationInput = z.object({
status: z.string(),
});
export type CreateNotificationInput = z.infer<typeof createNotificationInput>;
export type UpdateNotificationInput = z.infer<typeof updateNotificationInput>;
export const { schemas: notificationSchemas, $ref: $notification } =
buildJsonSchemas(
{
createNotificationInput,
updateNotificationInput,
pageQueryParams,
},