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