import { z } from 'zod'; import { SlideOutlineSchema } from './slide-outline.schema'; import { SlideSchema } from './slide.schema'; import { PRESENTATION_STAGE, USER_REACTION } from '../../constants'; import { PresentationTitlePageSchema } from './presentation-title-page.schema'; export const PresentationSchema = z.object({ uuid: z.string().uuid(), prompt: z.string(), stage: z.nativeEnum(PRESENTATION_STAGE), title: z.string(), thumbnail: z.string(), accentColor: z.string(), languageId: z.string(), templateId: z.string(), downloadUrl: z.string().nullable(), reaction: z.nativeEnum(USER_REACTION).nullable(), dislikeReason: z.string().nullable(), slideCount: z.number(), lastContentUpdateAt: z.date().nullable(), lastPptxExportedAt: z.date().nullable(), titlePage: PresentationTitlePageSchema.nullable(), createdAt: z.date(), updatedAt: z.date(), }); export type Presentation = z.infer; export const PresentationWithSlidesSchema = PresentationSchema.extend({ outline: z.array(SlideOutlineSchema), slides: z.array(SlideSchema), }); export type PresentationWithSlides = z.infer; export const PresentationUpdateSchema = PresentationSchema.pick({ title: true, templateId: true, accentColor: true, titlePage: true, }).partial(); export type PresentationUpdate = z.infer;