feat(blog): add Article entity with rich-text content + domain errors

This commit is contained in:
2026-05-04 22:11:08 +02:00
parent 161c858f32
commit 692ee58365
3 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { z } from "zod";
export const articleStatusSchema = z.enum(["draft", "published"]);
export const articleSchema = z.object({
id: z.string(),
title: z.string().min(1).max(255),
slug: z.string().min(1).max(255),
content: z.unknown(),
status: articleStatusSchema.default("draft"),
authorId: z.string(),
createdAt: z.date(),
updatedAt: z.date(),
});
export type Article = z.infer<typeof articleSchema>;
export type ArticleStatus = z.infer<typeof articleStatusSchema>;