Files
agentic-dev/packages/marketing-pages/src/entities/models/page.ts
2026-07-12 08:15:46 +00:00

30 lines
816 B
TypeScript

import { z } from "zod";
export const pageStatusSchema = z.enum(["draft", "published"]);
export const heroSchema = z.object({
heading: z.string().min(1).max(255),
subheading: z.string().optional(),
imageId: z.string().optional(),
});
export const pageSchema = z.object({
id: z.string(),
title: z.string().min(1).max(255),
slug: z.string().min(1).max(255),
hero: heroSchema,
layout: z.array(z.unknown()),
status: pageStatusSchema.default("draft"),
publishedAt: z.date().nullable().default(null),
seo: z.object({
title: z.string().min(1),
description: z.string().optional(),
}),
createdAt: z.date(),
updatedAt: z.date(),
});
export type Page = z.infer<typeof pageSchema>;
export type PageStatus = z.infer<typeof pageStatusSchema>;
export type Hero = z.infer<typeof heroSchema>;