feat: add requests field to processed collection
This commit is contained in:
@@ -105,6 +105,7 @@ const processedSchema = new mongoose.Schema({
|
||||
taggedUsers: Array,
|
||||
noc: String,
|
||||
deed: String,
|
||||
requests: [String],
|
||||
}).index({ tenantId: 1, permitNumber: 1 }, { unique: true });
|
||||
|
||||
export const processedFields = Object.keys(processedSchema.paths).filter(
|
||||
@@ -129,6 +130,7 @@ const updateProcessedInput = z.object({
|
||||
assignedTo: z.string().nullable().optional(),
|
||||
noc: z.string().optional(),
|
||||
deed: z.string().optional(),
|
||||
requests: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export type UpdateProcessedInput = z.infer<typeof updateProcessedInput>;
|
||||
|
||||
@@ -195,6 +195,7 @@ export async function listProcessedPermits(
|
||||
taggedUsers: 1,
|
||||
noc: 1,
|
||||
deed: 1,
|
||||
requests: 1,
|
||||
assignedTo: {
|
||||
$let: {
|
||||
vars: { assigned: { $arrayElemAt: ["$assignedRec", 0] } },
|
||||
|
||||
Reference in New Issue
Block a user