Files
DentalManagement09/packages/db/shared/schemas/results/PatientServiceHistoryGroupByResult.schema.ts
T

50 lines
1.6 KiB
TypeScript

import * as z from 'zod';
export const PatientServiceHistoryGroupByResultSchema = z.array(z.object({
id: z.number().int(),
patientId: z.number().int(),
procedureCode: z.string(),
description: z.string(),
toothQuadArchSurface: z.string(),
placeOfService: z.string(),
serviceDate: z.string(),
createdAt: z.date(),
_count: z.object({
id: z.number(),
patientId: z.number(),
procedureCode: z.number(),
description: z.number(),
toothQuadArchSurface: z.number(),
placeOfService: z.number(),
serviceDate: z.number(),
createdAt: z.number(),
patient: z.number()
}).optional(),
_sum: z.object({
id: z.number().nullable(),
patientId: z.number().nullable()
}).nullable().optional(),
_avg: z.object({
id: z.number().nullable(),
patientId: z.number().nullable()
}).nullable().optional(),
_min: z.object({
id: z.number().int().nullable(),
patientId: z.number().int().nullable(),
procedureCode: z.string().nullable(),
description: z.string().nullable(),
toothQuadArchSurface: z.string().nullable(),
placeOfService: z.string().nullable(),
serviceDate: z.string().nullable(),
createdAt: z.date().nullable()
}).nullable().optional(),
_max: z.object({
id: z.number().int().nullable(),
patientId: z.number().int().nullable(),
procedureCode: z.string().nullable(),
description: z.string().nullable(),
toothQuadArchSurface: z.string().nullable(),
placeOfService: z.string().nullable(),
serviceDate: z.string().nullable(),
createdAt: z.date().nullable()
}).nullable().optional()
}));