add assignedTo field to notifications
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { buildJsonSchemas } from "fastify-zod";
|
||||
import mongoose from "mongoose";
|
||||
import { TypeOf, z } from "zod";
|
||||
import { z } from "zod";
|
||||
import { pageQueryParams } from "../pagination";
|
||||
|
||||
const notificationSchema = new mongoose.Schema({
|
||||
@@ -20,6 +20,10 @@ const notificationSchema = new mongoose.Schema({
|
||||
clientData: Object,
|
||||
createdAt: Date,
|
||||
updatedAt: Date,
|
||||
assignedTo: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: "user",
|
||||
},
|
||||
});
|
||||
|
||||
export const notificationFields = Object.keys(notificationSchema.paths).filter(
|
||||
@@ -41,10 +45,12 @@ const createNotificationInput = z.object({
|
||||
county: z.object({}).passthrough(),
|
||||
client: z.string(),
|
||||
clientData: z.object({}).passthrough(),
|
||||
assignedTo: z.string().optional(),
|
||||
});
|
||||
|
||||
const updateNotificationInput = z.object({
|
||||
status: z.string(),
|
||||
status: z.string().optional(),
|
||||
assignedTo: z.string().optional(),
|
||||
});
|
||||
|
||||
export type CreateNotificationInput = z.infer<typeof createNotificationInput>;
|
||||
|
||||
Reference in New Issue
Block a user