added permitType field
This commit is contained in:
@@ -13,6 +13,7 @@ const notificationSchema = new mongoose.Schema({
|
||||
permitNumber: String,
|
||||
link: String,
|
||||
status: String,
|
||||
permitType: String,
|
||||
accelaStatus: String,
|
||||
changes: Object,
|
||||
county: Object,
|
||||
|
||||
@@ -85,6 +85,7 @@ export async function listNotifications(
|
||||
permitNumber: 1,
|
||||
link: 1,
|
||||
status: 1,
|
||||
permitType: 1,
|
||||
accelaStatus: 1,
|
||||
changes: 1,
|
||||
county: 1,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
import mongoose from 'mongoose';
|
||||
import { buildJsonSchemas } from 'fastify-zod';
|
||||
import { pageMetadata, pageQueryParams } from '../pagination';
|
||||
import { z } from "zod";
|
||||
import mongoose from "mongoose";
|
||||
import { buildJsonSchemas } from "fastify-zod";
|
||||
import { pageMetadata, pageQueryParams } from "../pagination";
|
||||
|
||||
const permitSchema = new mongoose.Schema({
|
||||
tenantId: {
|
||||
@@ -16,7 +16,7 @@ const permitSchema = new mongoose.Schema({
|
||||
county: Object,
|
||||
client: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'organization',
|
||||
ref: "organization",
|
||||
},
|
||||
clientData: Object,
|
||||
permitDate: Date,
|
||||
@@ -30,10 +30,11 @@ const permitSchema = new mongoose.Schema({
|
||||
status: String,
|
||||
manualStatus: String,
|
||||
cleanStatus: String,
|
||||
permitType: String,
|
||||
utility: String,
|
||||
assignedTo: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'user',
|
||||
ref: "user",
|
||||
},
|
||||
link: String,
|
||||
address: Object,
|
||||
@@ -51,7 +52,7 @@ const permitSchema = new mongoose.Schema({
|
||||
createdAt: Date,
|
||||
createdBy: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'user',
|
||||
ref: "user",
|
||||
},
|
||||
newProcessingStatus: Array,
|
||||
newPayment: Array,
|
||||
@@ -66,9 +67,9 @@ const permitSchema = new mongoose.Schema({
|
||||
}).index({ tenantId: 1, permitNumber: 1 }, { unique: true });
|
||||
|
||||
export const permitFields = Object.keys(permitSchema.paths).filter(
|
||||
(path) => path !== '__v'
|
||||
(path) => path !== "__v"
|
||||
);
|
||||
export const permitModel = mongoose.model('permit', permitSchema);
|
||||
export const permitModel = mongoose.model("permit", permitSchema);
|
||||
|
||||
const permitCore = {
|
||||
permitNumber: z.string(),
|
||||
@@ -131,11 +132,11 @@ const listPermitResponse = z.object({
|
||||
|
||||
const updatePermitInput = 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(),
|
||||
assignedTo: z.string().optional(),
|
||||
@@ -154,5 +155,5 @@ export const { schemas: permitSchemas, $ref: $permit } = buildJsonSchemas(
|
||||
updatePermitInput,
|
||||
pageQueryParams,
|
||||
},
|
||||
{ $id: 'permit' }
|
||||
{ $id: "permit" }
|
||||
);
|
||||
|
||||
@@ -91,6 +91,7 @@ export async function listPermits(
|
||||
status: 1,
|
||||
manualStatus: 1,
|
||||
cleanStatus: 1,
|
||||
permitType: 1,
|
||||
utility: 1,
|
||||
link: 1,
|
||||
address: 1,
|
||||
@@ -258,6 +259,7 @@ export async function searchPermit(
|
||||
status: 1,
|
||||
manualStatus: 1,
|
||||
cleanStatus: 1,
|
||||
permitType: 1,
|
||||
utility: 1,
|
||||
link: 1,
|
||||
address: 1,
|
||||
|
||||
@@ -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,
|
||||
@@ -30,10 +30,11 @@ const processedSchema = new mongoose.Schema({
|
||||
status: String,
|
||||
manualStatus: String,
|
||||
cleanStatus: String,
|
||||
permitType: String,
|
||||
utility: String,
|
||||
assignedTo: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'user',
|
||||
ref: "user",
|
||||
},
|
||||
link: String,
|
||||
address: Object,
|
||||
@@ -51,7 +52,7 @@ const processedSchema = new mongoose.Schema({
|
||||
createdAt: Date,
|
||||
createdBy: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'user',
|
||||
ref: "user",
|
||||
},
|
||||
newProcessingStatus: Array,
|
||||
newPayment: Array,
|
||||
@@ -67,22 +68,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(),
|
||||
});
|
||||
@@ -94,5 +95,5 @@ export const { schemas: processedSchemas, $ref: $processed } = buildJsonSchemas(
|
||||
pageQueryParams,
|
||||
updateProcessedInput,
|
||||
},
|
||||
{ $id: 'processed' }
|
||||
{ $id: "processed" }
|
||||
);
|
||||
|
||||
@@ -86,6 +86,7 @@ export async function listProcessedPermits(
|
||||
status: 1,
|
||||
manualStatus: 1,
|
||||
cleanStatus: 1,
|
||||
permitType: 1,
|
||||
utility: 1,
|
||||
link: 1,
|
||||
address: 1,
|
||||
|
||||
@@ -11,6 +11,7 @@ const rtsSchema = new mongoose.Schema({
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
permitType: String,
|
||||
documents: [
|
||||
new mongoose.Schema(
|
||||
{
|
||||
@@ -61,6 +62,7 @@ const rtsCreateInput = z.object({
|
||||
county: z.string(),
|
||||
client: z.string().optional(),
|
||||
files: z.array(files).optional(),
|
||||
permitType: z.string().optional(),
|
||||
stage: z
|
||||
.object({
|
||||
pipeline: z.array(
|
||||
@@ -80,6 +82,7 @@ const rtsCreateInput = z.object({
|
||||
const rtsUpdateInput = z.object({
|
||||
county: z.string().optional(),
|
||||
client: z.string().optional(),
|
||||
permitType: z.string().optional(),
|
||||
stage: z
|
||||
.object({
|
||||
pipeline: z.array(
|
||||
|
||||
@@ -95,6 +95,7 @@ export async function listRts(
|
||||
$project: {
|
||||
_id: 1,
|
||||
pid: 1,
|
||||
permitType: 1,
|
||||
documents: 1,
|
||||
statusPipeline: 1,
|
||||
createdAt: 1,
|
||||
|
||||
Reference in New Issue
Block a user