bug fixes, schema updates
This commit is contained in:
@@ -125,17 +125,15 @@ const updatePermitInput = z.object({
|
||||
permitDate: z.date().optional(),
|
||||
stage: z
|
||||
.object({
|
||||
pipeline: z
|
||||
.array(
|
||||
z.object({
|
||||
name: z.string(),
|
||||
date: z.date().nullable().optional(),
|
||||
description: z.string().optional(),
|
||||
comment: z.string().optional(),
|
||||
})
|
||||
)
|
||||
.optional(),
|
||||
currentStage: z.number().optional(),
|
||||
pipeline: z.array(
|
||||
z.object({
|
||||
name: z.string(),
|
||||
date: z.date().nullable().optional(),
|
||||
description: z.string().optional(),
|
||||
comment: z.string().optional(),
|
||||
})
|
||||
),
|
||||
currentStage: z.number(),
|
||||
})
|
||||
.optional(),
|
||||
status: z.string().optional(),
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
UpdatePermitInput,
|
||||
} from "./permit.schema";
|
||||
import { ChangeEvent, dbEvents } from "../realtime";
|
||||
import { pipeline } from "../utils/pipeline";
|
||||
import { permitPipeline } from "../utils/pipeline";
|
||||
import { AuthenticatedUser } from "../auth";
|
||||
|
||||
export async function createPermit(
|
||||
@@ -18,7 +18,7 @@ export async function createPermit(
|
||||
) {
|
||||
if (!input.stage) {
|
||||
input.stage = {
|
||||
pipeline: pipeline,
|
||||
pipeline: permitPipeline,
|
||||
currentStage: 0,
|
||||
};
|
||||
}
|
||||
@@ -297,6 +297,8 @@ export async function searchPermit(params: PageQueryParams, tenantId: string) {
|
||||
permitDate: 1,
|
||||
stage: 1,
|
||||
status: 1,
|
||||
address: 1,
|
||||
description: 1,
|
||||
county: {
|
||||
$let: {
|
||||
vars: { county: { $arrayElemAt: ["$countyRec", 0] } },
|
||||
|
||||
Reference in New Issue
Block a user