Files
leim-tools/models/World.ts
Alexis 922bcdc64b Added a bunch of mini features
Sorted worlds, add preview and add cards, added timestamps...
2025-03-03 22:27:42 +01:00

26 lines
652 B
TypeScript

import { z } from "zod"
import type { Calendar } from "./CalendarConfig"
import { rpgColorSchema, type RPGColor } from "./Color"
export type WorldState = "published" | "draft" | "archived"
export interface World {
id?: number
name: string
description?: string
color?: RPGColor
calendars?: Calendar[]
gmId?: string
state?: WorldState
createdAt?: string
updatedAt?: string
}
export const postWorldSchema = z.object({
name: z.string(),
description: z.string().optional().nullable(),
color: rpgColorSchema.default("white"),
gmId: z.string().optional().nullable(),
state: z.string().optional().nullable().default("draft"),
})