created changes endpoint

This commit is contained in:
2025-05-23 10:06:37 +05:30
parent 5ff67b751c
commit 564bfc061e
4 changed files with 76 additions and 0 deletions

View File

@@ -156,6 +156,21 @@ const updatePermitInput = z.object({
export type CreatePermitInput = z.infer<typeof createPermitInput>;
export type UpdatePermitInput = z.infer<typeof updatePermitInput>;
export const changesModel = mongoose.model(
"change",
new mongoose.Schema({
tenantId: String,
permitId: String,
field: String,
value: String,
updatedBy: {
type: mongoose.Types.ObjectId,
ref: "user",
},
updatedAt: Date,
})
);
export const { schemas: permitSchemas, $ref: $permit } = buildJsonSchemas(
{
createPermitInput,