import type { Prisma } from "@prisma/client";
import { z } from "zod";
import { AppointmentCreateWithoutCustomerInputSchema } from "./AppointmentCreateWithoutCustomerInputSchema";
import { AppointmentUncheckedCreateWithoutCustomerInputSchema } from "./AppointmentUncheckedCreateWithoutCustomerInputSchema";
import { AppointmentWhereUniqueInputSchema } from "./AppointmentWhereUniqueInputSchema";
export const AppointmentCreateOrConnectWithoutCustomerInputSchema: z.ZodType<Prisma.AppointmentCreateOrConnectWithoutCustomerInput> =
z
.object({
where: z.lazy(() => AppointmentWhereUniqueInputSchema),
create: z.union([
z.lazy(() => AppointmentCreateWithoutCustomerInputSchema),
z.lazy(() => AppointmentUncheckedCreateWithoutCustomerInputSchema),
]),
})
.strict();
export default AppointmentCreateOrConnectWithoutCustomerInputSchema;
Error
Type 'ZodObject<{ where: ZodLazy<ZodType<AppointmentWhereUniqueInput, ZodTypeDef, AppointmentWhereUniqueInput>>; create: ZodUnion<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<AppointmentCreateOrConnectWithoutCustomerInput, ZodTypeDef, AppointmentCreateOrConnectWithoutCustomerInput>'.
The types of '_type.create' are incompatible between these types.
Type '(AppointmentCreateWithoutCustomerInput | AppointmentUncheckedCreateWithoutCustomerInput) & (AppointmentCreateWithoutCustomerInput | ... 1 more ... | undefined)' is not assignable to type '(Without<AppointmentCreateWithoutCustomerInput, AppointmentUncheckedCreateWithoutCustomerInput> & AppointmentUncheckedCreateWithoutCustomerInput) | (Without<...> & AppointmentCreateWithoutCustomerInput)'.
Type 'AppointmentCreateWithoutCustomerInput & AppointmentUncheckedCreateWithoutCustomerInput' is not assignable to type '(Without<AppointmentCreateWithoutCustomerInput, AppointmentUncheckedCreateWithoutCustomerInput> & AppointmentUncheckedCreateWithoutCustomerInput) | (Without<...> & AppointmentCreateWithoutCustomerInput)'.
Type 'AppointmentCreateWithoutCustomerInput & AppointmentUncheckedCreateWithoutCustomerInput' is not assignable to type 'Without<AppointmentUncheckedCreateWithoutCustomerInput, AppointmentCreateWithoutCustomerInput> & AppointmentCreateWithoutCustomerInput'.
Type 'AppointmentCreateWithoutCustomerInput & AppointmentUncheckedCreateWithoutCustomerInput' is not assignable to type 'Without<AppointmentUncheckedCreateWithoutCustomerInput, AppointmentCreateWithoutCustomerInput>'.
Types of property 'id' are incompatible.
Type 'number | undefined' is not assignable to type 'undefined'.
Type 'number' is not assignable to type 'undefined'.
schema.prisma (simplified)
model Customer {
id Int @id @default(autoincrement())
fullName String
email String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
appointments Appointment[]
}
model Appointment {
id Int @id @default(autoincrement())
start DateTime
end DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
customerId Int
}
AppointmentCreateOrConnectWithoutCustomerInputSchema.ts (generated)
Error
schema.prisma (simplified)