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