feat: make assignedTo field accept multiple values for all collections

This commit is contained in:
2025-11-18 13:32:47 +05:30
parent b7f63479a6
commit 8f5c0a1827
12 changed files with 202 additions and 108 deletions

View File

@@ -1,5 +1,5 @@
import { buildJsonSchemas } from "fastify-zod";
import mongoose from "mongoose";
import mongoose, { Schema } from "mongoose";
import z from "zod";
import { files } from "../file/file.schema";
import { pageQueryParams } from "../pagination";
@@ -51,7 +51,7 @@ const rtsSchema = new mongoose.Schema({
ref: "user",
},
assignedTo: {
type: mongoose.Types.ObjectId,
type: [Schema.Types.ObjectId],
ref: "user",
},
taggedUsers: Array,
@@ -85,7 +85,7 @@ const rtsCreateInput = z.object({
currentStage: z.number(),
})
.optional(),
assignedTo: z.string().optional(),
assignedTo: z.array(z.string()).optional(),
status: z.string().optional(),
});
@@ -109,7 +109,7 @@ const rtsUpdateInput = z.object({
currentStage: z.number(),
})
.optional(),
assignedTo: z.string().optional(),
assignedTo: z.array(z.string()).optional(),
status: z.string().optional(),
fileValidationStatus: z.string().optional(),
});