Files
leim-tools/models/World.ts
2025-03-05 20:03:52 +01:00

28 lines
764 B
TypeScript

import { z } from "zod"
import type { Calendar } from "./CalendarConfig"
import { rpgColorSchema, type RPGColor } from "./Color"
import type { ContentState } from "./Entity"
export interface World {
id?: number
name: string
description?: string
color?: RPGColor
calendars?: Calendar[]
gmId?: string
state?: ContentState
createdAt?: string
updatedAt?: string
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WorldChannelPayload = World & Record<string, any>
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"),
})