import { z } from '../zod' import { Answer as AnswerPrisma, Prisma } from '@typebot.io/prisma' export const answerSchema = z.object({ createdAt: z.date(), resultId: z.string(), blockId: z.string(), groupId: z.string(), variableId: z.string().nullable(), content: z.string(), storageUsed: z.number().nullable(), // TO-DO: remove once itemId is removed from database schema }) satisfies z.ZodType> export const answerInputSchema = answerSchema .omit({ createdAt: true, resultId: true, variableId: true, storageUsed: true, }) .extend({ variableId: z.string().nullish(), storageUsed: z.number().nullish(), }) satisfies z.ZodType export const statsSchema = z.object({ totalViews: z.number(), totalStarts: z.number(), totalCompleted: z.number(), }) export type Stats = z.infer export type Answer = z.infer export type AnswerInput = z.infer