diff --git a/src/lib/validations.ts b/src/lib/validations.ts index bdf4707..b8f9a90 100644 --- a/src/lib/validations.ts +++ b/src/lib/validations.ts @@ -203,6 +203,26 @@ export const KeywordCloudResponseSchema = z.object({ error: z.string().optional(), }) +// ================================ +// AI Timeline Schemas +// ================================ + +export const AIEventInputSchema = z.object({ + title: z.string().min(1).max(200), + titleEn: z.string().max(200).optional(), + eventDate: z.string().datetime(), + description: z.string().min(10).max(500), + descriptionEn: z.string().max(500).optional(), + imageUrl: z.string().url(), + sourceUrl: z.string().url().optional(), +}) + +export const AIEventQuerySchema = z.object({ + year: z.string().regex(/^\d{4}$/).optional(), + limit: z.string().regex(/^\d+$/).transform(Number).optional(), + offset: z.string().regex(/^\d+$/).transform(Number).optional(), +}) + // ================================ // Types // ================================ @@ -211,4 +231,6 @@ export type KeywordInput = z.infer export type BatchKeywordsRequest = z.infer export type Quarter = z.infer export type VisualStyleRule = z.infer +export type AIEventInput = z.infer +export type AIEventQuery = z.infer export type KeywordCloudResponse = z.infer