feat: full site build — Project/Melody schema (Option A), admin CRUD, public sections, uploads, email+SMTP, internal analytics, legal pages, docs
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const categoryKindSchema = z.enum(["PROJECT", "MELODY"]);
|
||||
|
||||
export const categorySchema = z.object({
|
||||
kind: categoryKindSchema,
|
||||
slug: z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1, "Slug is required.")
|
||||
.max(80, "Slug must be 80 characters or fewer.")
|
||||
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Use lowercase letters, numbers, and hyphens only."),
|
||||
nameAr: z.string().trim().min(1, "Arabic name is required.").max(120),
|
||||
nameEn: z.string().trim().min(1, "English name is required.").max(120),
|
||||
order: z.number().int().min(0).max(9999),
|
||||
});
|
||||
|
||||
export const categoryIdSchema = z.string().cuid("Invalid category id.");
|
||||
|
||||
export type CategoryInput = z.infer<typeof categorySchema>;
|
||||
Reference in New Issue
Block a user