feat(patient-status schema updated)- applied changes

This commit is contained in:
2025-10-30 21:13:33 +05:30
parent 103142b2d3
commit 54f83ab398
9 changed files with 146 additions and 63 deletions

View File

@@ -1,5 +1,9 @@
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import {
PatientStatusSchema,
PatientUncheckedCreateInputObjectSchema,
} from "@repo/db/usedSchemas";
import { z } from "zod";
import { makeEnumOptions } from "../utils";
export type Patient = z.infer<typeof PatientUncheckedCreateInputObjectSchema>;
@@ -28,6 +32,17 @@ export const insuranceIdSchema = z.preprocess(
.nullable()
);
//patient status
export type PatientStatus = z.infer<typeof PatientStatusSchema>;
// enum → select options
export const patientStatusOptions =
makeEnumOptions<
typeof PatientStatusSchema extends z.ZodTypeAny
? z.infer<typeof PatientStatusSchema>
: string
>(PatientStatusSchema);
export const insertPatientSchema = (
PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)