Files
DentalManagementMH06/packages/db/shared/schemas/objects/AppointmentCreateWithoutFilesInput.schema.ts
Gitead 5e3cfef52b feat: label AI-rescheduled appointments and add manual confirm option
- Add movedByAi boolean column to Appointment table (default false)
- reschedule-graph: set movedByAi=true when AI moves an appointment
- PATCH /api/appointments/:id/confirm endpoint clears the movedByAi flag
- Schedule grid: show teal AI badge on appointment cards where movedByAi=true
- Right-click context menu: 'Manually Confirmed' removes the AI badge via the confirm endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 19:23:36 -04:00

30 lines
2.3 KiB
TypeScript

import * as z from 'zod';
import type { Prisma } from '../../../generated/prisma';
import { PatientStatusSchema } from '../enums/PatientStatus.schema';
import { PatientCreateNestedOneWithoutAppointmentsInputObjectSchema as PatientCreateNestedOneWithoutAppointmentsInputObjectSchema } from './PatientCreateNestedOneWithoutAppointmentsInput.schema';
import { UserCreateNestedOneWithoutAppointmentsInputObjectSchema as UserCreateNestedOneWithoutAppointmentsInputObjectSchema } from './UserCreateNestedOneWithoutAppointmentsInput.schema';
import { StaffCreateNestedOneWithoutAppointmentsInputObjectSchema as StaffCreateNestedOneWithoutAppointmentsInputObjectSchema } from './StaffCreateNestedOneWithoutAppointmentsInput.schema';
import { AppointmentProcedureCreateNestedManyWithoutAppointmentInputObjectSchema as AppointmentProcedureCreateNestedManyWithoutAppointmentInputObjectSchema } from './AppointmentProcedureCreateNestedManyWithoutAppointmentInput.schema';
import { ClaimCreateNestedManyWithoutAppointmentInputObjectSchema as ClaimCreateNestedManyWithoutAppointmentInputObjectSchema } from './ClaimCreateNestedManyWithoutAppointmentInput.schema'
const makeSchema = () => z.object({
title: z.string(),
date: z.coerce.date(),
startTime: z.string(),
endTime: z.string(),
type: z.string(),
notes: z.string().optional().nullable(),
procedureCodeNotes: z.string().optional().nullable(),
status: z.string().optional(),
movedByAi: z.boolean().optional(),
createdAt: z.coerce.date().optional(),
eligibilityStatus: PatientStatusSchema.optional(),
patient: z.lazy(() => PatientCreateNestedOneWithoutAppointmentsInputObjectSchema),
user: z.lazy(() => UserCreateNestedOneWithoutAppointmentsInputObjectSchema),
staff: z.lazy(() => StaffCreateNestedOneWithoutAppointmentsInputObjectSchema).optional(),
procedures: z.lazy(() => AppointmentProcedureCreateNestedManyWithoutAppointmentInputObjectSchema).optional(),
claims: z.lazy(() => ClaimCreateNestedManyWithoutAppointmentInputObjectSchema).optional()
}).strict();
export const AppointmentCreateWithoutFilesInputObjectSchema: z.ZodType<Prisma.AppointmentCreateWithoutFilesInput> = makeSchema() as unknown as z.ZodType<Prisma.AppointmentCreateWithoutFilesInput>;
export const AppointmentCreateWithoutFilesInputObjectZodSchema = makeSchema();