add notification create route, update permit update rotue
This commit is contained in:
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user