feat: add noc, deed fields to permits, processed collections
This commit is contained in:
@@ -103,6 +103,8 @@ const processedSchema = new mongoose.Schema({
|
||||
startDate: Date,
|
||||
history: Array,
|
||||
taggedUsers: Array,
|
||||
noc: String,
|
||||
deed: String,
|
||||
}).index({ tenantId: 1, permitNumber: 1 }, { unique: true });
|
||||
|
||||
export const processedFields = Object.keys(processedSchema.paths).filter(
|
||||
@@ -124,6 +126,8 @@ const updateProcessedInput = z.object({
|
||||
jobNumber: z.string().nullable().optional(),
|
||||
startDate: z.date().nullable().optional(),
|
||||
assignedTo: z.string().nullable().optional(),
|
||||
noc: z.string().optional(),
|
||||
deed: z.string().optional(),
|
||||
});
|
||||
|
||||
export type UpdateProcessedInput = z.infer<typeof updateProcessedInput>;
|
||||
|
||||
@@ -180,6 +180,8 @@ export async function listProcessedPermits(
|
||||
block: 1,
|
||||
jobNumber: 1,
|
||||
taggedUsers: 1,
|
||||
noc: 1,
|
||||
deed: 1,
|
||||
assignedTo: {
|
||||
$let: {
|
||||
vars: { assigned: { $arrayElemAt: ["$assignedRec", 0] } },
|
||||
|
||||
Reference in New Issue
Block a user