import { z } from 'zod'; import { WriterDocumentOutlineSchema } from './writer-document-outline.schema'; import { WriterDocumentTitlePageSchema } from './writer-document-title-page.schema'; import { USER_REACTION, WRITER_DOCUMENT_STAGE } from '../../constants'; export const WriterDocumentSchema = z.object({ uuid: z.string().uuid(), prompt: z.string(), topic: z.string(), typeId: z.string(), stage: z.nativeEnum(WRITER_DOCUMENT_STAGE), outline: WriterDocumentOutlineSchema, isTitlePageEnabled: z.boolean(), titlePage: WriterDocumentTitlePageSchema.nullable(), sourceMd: z.string().nullable(), finalMd: z.string().nullable(), skipSources: z.boolean(), userId: z.string().nullable(), unregisteredUserId: z.string().nullable(), modelId: z.string().nullable(), description: z.string().nullable(), error: z.string().nullable(), reaction: z.nativeEnum(USER_REACTION).nullable(), pages: z.number().nullable(), createdAt: z.date(), updatedAt: z.date(), completedAt: z.date().nullable(), }); export type WriterDocument = z.infer;