Files
DentalManagementMHAprilgg/packages/db/shared/schemas/results/PaymentGroupByResult.schema.ts
2026-04-04 22:13:55 -04:00

89 lines
2.8 KiB
TypeScript

import * as z from 'zod';
export const PaymentGroupByResultSchema = z.array(z.object({
id: z.number().int(),
claimId: z.number().int(),
patientId: z.number().int(),
userId: z.number().int(),
updatedById: z.number().int(),
totalBilled: z.number(),
totalPaid: z.number(),
totalAdjusted: z.number(),
totalDue: z.number(),
notes: z.string(),
icn: z.string(),
createdAt: z.date(),
updatedAt: z.date(),
_count: z.object({
id: z.number(),
claimId: z.number(),
patientId: z.number(),
userId: z.number(),
updatedById: z.number(),
totalBilled: z.number(),
totalPaid: z.number(),
totalAdjusted: z.number(),
totalDue: z.number(),
status: z.number(),
notes: z.number(),
icn: z.number(),
createdAt: z.number(),
updatedAt: z.number(),
claim: z.number(),
patient: z.number(),
updatedBy: z.number(),
serviceLineTransactions: z.number(),
serviceLines: z.number()
}).optional(),
_sum: z.object({
id: z.number().nullable(),
claimId: z.number().nullable(),
patientId: z.number().nullable(),
userId: z.number().nullable(),
updatedById: z.number().nullable(),
totalBilled: z.number().nullable(),
totalPaid: z.number().nullable(),
totalAdjusted: z.number().nullable(),
totalDue: z.number().nullable()
}).nullable().optional(),
_avg: z.object({
id: z.number().nullable(),
claimId: z.number().nullable(),
patientId: z.number().nullable(),
userId: z.number().nullable(),
updatedById: z.number().nullable(),
totalBilled: z.number().nullable(),
totalPaid: z.number().nullable(),
totalAdjusted: z.number().nullable(),
totalDue: z.number().nullable()
}).nullable().optional(),
_min: z.object({
id: z.number().int().nullable(),
claimId: z.number().int().nullable(),
patientId: z.number().int().nullable(),
userId: z.number().int().nullable(),
updatedById: z.number().int().nullable(),
totalBilled: z.number().nullable(),
totalPaid: z.number().nullable(),
totalAdjusted: z.number().nullable(),
totalDue: z.number().nullable(),
notes: z.string().nullable(),
icn: z.string().nullable(),
createdAt: z.date().nullable(),
updatedAt: z.date().nullable()
}).nullable().optional(),
_max: z.object({
id: z.number().int().nullable(),
claimId: z.number().int().nullable(),
patientId: z.number().int().nullable(),
userId: z.number().int().nullable(),
updatedById: z.number().int().nullable(),
totalBilled: z.number().nullable(),
totalPaid: z.number().nullable(),
totalAdjusted: z.number().nullable(),
totalDue: z.number().nullable(),
notes: z.string().nullable(),
icn: z.string().nullable(),
createdAt: z.date().nullable(),
updatedAt: z.date().nullable()
}).nullable().optional()
}));