permit and processed collection updates

This commit is contained in:
2025-04-29 13:46:11 +05:30
parent bf41bc9c7c
commit c2df46bdc1
6 changed files with 76 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
import z from "zod";
import mongoose from "mongoose";
import { pageQueryParams } from "../pagination";
import { buildJsonSchemas } from "fastify-zod";
@@ -74,9 +75,23 @@ export const processedModel = mongoose.model(
"processed"
);
const updateProcessedInput = z.object({
manualStatus: z
.enum(["Ready To Issue", "Issued", "Invoiced", "Paid", "Closed"])
.nullable()
.optional(),
utility: z
.enum(["Submitted", "Pending", "Applied", "Rejected", "Paid"])
.nullable()
.optional(),
});
export type UpdateProcessedInput = z.infer<typeof updateProcessedInput>;
export const { schemas: processedSchemas, $ref: $processed } = buildJsonSchemas(
{
pageQueryParams,
updateProcessedInput,
},
{ $id: "processed" }
);