expose cleanStatus field
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import z from "zod";
|
||||
import mongoose from "mongoose";
|
||||
import { pageQueryParams } from "../pagination";
|
||||
import { buildJsonSchemas } from "fastify-zod";
|
||||
import z from 'zod';
|
||||
import mongoose from 'mongoose';
|
||||
import { pageQueryParams } from '../pagination';
|
||||
import { buildJsonSchemas } from 'fastify-zod';
|
||||
|
||||
const processedSchema = new mongoose.Schema({
|
||||
tenantId: {
|
||||
@@ -16,7 +16,7 @@ const processedSchema = new mongoose.Schema({
|
||||
county: Object,
|
||||
client: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: "organization",
|
||||
ref: 'organization',
|
||||
},
|
||||
clientData: Object,
|
||||
permitDate: Date,
|
||||
@@ -29,10 +29,11 @@ const processedSchema = new mongoose.Schema({
|
||||
),
|
||||
status: String,
|
||||
manualStatus: String,
|
||||
cleanStatus: String,
|
||||
utility: String,
|
||||
assignedTo: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: "user",
|
||||
ref: 'user',
|
||||
},
|
||||
link: String,
|
||||
address: Object,
|
||||
@@ -50,7 +51,7 @@ const processedSchema = new mongoose.Schema({
|
||||
createdAt: Date,
|
||||
createdBy: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: "user",
|
||||
ref: 'user',
|
||||
},
|
||||
newProcessingStatus: Array,
|
||||
newPayment: Array,
|
||||
@@ -66,22 +67,22 @@ const processedSchema = new mongoose.Schema({
|
||||
}).index({ tenantId: 1, permitNumber: 1 }, { unique: true });
|
||||
|
||||
export const processedFields = Object.keys(processedSchema.paths).filter(
|
||||
(path) => path !== "__v"
|
||||
(path) => path !== '__v'
|
||||
);
|
||||
|
||||
export const processedModel = mongoose.model(
|
||||
"processed",
|
||||
'processed',
|
||||
processedSchema,
|
||||
"processed"
|
||||
'processed'
|
||||
);
|
||||
|
||||
const updateProcessedInput = z.object({
|
||||
manualStatus: z
|
||||
.enum(["Ready To Issue", "Issued", "Invoiced", "Paid", "Closed"])
|
||||
.enum(['Ready To Issue', 'Issued', 'Invoiced', 'Paid', 'Closed'])
|
||||
.nullable()
|
||||
.optional(),
|
||||
utility: z
|
||||
.enum(["Submitted", "Pending", "Applied", "Rejected", "Paid"])
|
||||
.enum(['Submitted', 'Pending', 'Applied', 'Rejected', 'Paid'])
|
||||
.nullable()
|
||||
.optional(),
|
||||
});
|
||||
@@ -93,5 +94,5 @@ export const { schemas: processedSchemas, $ref: $processed } = buildJsonSchemas(
|
||||
pageQueryParams,
|
||||
updateProcessedInput,
|
||||
},
|
||||
{ $id: "processed" }
|
||||
{ $id: 'processed' }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user