feat(patient-status schema updated)- applied changes
This commit is contained in:
@@ -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>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user