feat: add address field to metaFields in alerts
This commit is contained in:
@@ -15,6 +15,7 @@ export const alertsModel = mongoose.model(
|
|||||||
client: { type: String, ref: "organization" },
|
client: { type: String, ref: "organization" },
|
||||||
county: { type: String, ref: "organization" },
|
county: { type: String, ref: "organization" },
|
||||||
permitType: String,
|
permitType: String,
|
||||||
|
address: String,
|
||||||
},
|
},
|
||||||
recipientType: {
|
recipientType: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -41,6 +42,7 @@ const alertResponse = z.object({
|
|||||||
client: z.any().optional(),
|
client: z.any().optional(),
|
||||||
county: z.any().optional(),
|
county: z.any().optional(),
|
||||||
permitType: z.string().optional(),
|
permitType: z.string().optional(),
|
||||||
|
address: z.string().optional(),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
recipientType: z.enum(["user", "team"]),
|
recipientType: z.enum(["user", "team"]),
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export async function createAlert(
|
|||||||
client?: String;
|
client?: String;
|
||||||
county?: String;
|
county?: String;
|
||||||
permitType?: String;
|
permitType?: String;
|
||||||
|
address?: String;
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
const newAlert = await alertsModel.create({
|
const newAlert = await alertsModel.create({
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ export async function updatePayment(
|
|||||||
{
|
{
|
||||||
client: updatedPayment.client.toString(),
|
client: updatedPayment.client.toString(),
|
||||||
county: updatedPayment.county.id.toString(),
|
county: updatedPayment.county.id.toString(),
|
||||||
|
address: updatedPayment.address.full_address,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,6 +322,7 @@ export async function updatePermit(
|
|||||||
{
|
{
|
||||||
client: updatePermitResult.client.toString(),
|
client: updatePermitResult.client.toString(),
|
||||||
county: updatePermitResult.county.id.toString(),
|
county: updatePermitResult.county.id.toString(),
|
||||||
|
address: updatePermitResult.address,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -365,6 +366,7 @@ export async function updatePermit(
|
|||||||
{
|
{
|
||||||
client: updatePermitResult.client.toString(),
|
client: updatePermitResult.client.toString(),
|
||||||
county: updatePermitResult.county.id.toString(),
|
county: updatePermitResult.county.id.toString(),
|
||||||
|
address: updatePermitResult.address.full_address,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ export async function updateProcessed(
|
|||||||
{
|
{
|
||||||
client: updateProcessedResult.client.toString(),
|
client: updateProcessedResult.client.toString(),
|
||||||
county: updateProcessedResult.county.id.toString(),
|
county: updateProcessedResult.county.id.toString(),
|
||||||
|
address: updateProcessedResult.address.full_address,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user