Added tabs to form

This commit is contained in:
Alexis
2024-06-24 18:01:39 +02:00
parent 008ec4fcef
commit 12bf5139da
10 changed files with 444 additions and 49 deletions

View File

@@ -1,15 +1,23 @@
import { z } from 'zod'
import type { CalendarEvent } from "./CalendarEvent"
import type { CalendarMonth } from "./CalendarMonth"
import type { RPGDate } from "./Date"
import { type CalendarMonth } from "./CalendarMonth"
import { dateSchema, type RPGDate } from "./Date"
export interface CalendarConfig {
months: CalendarMonth[]
daysPerMonth: number
today: RPGDate
}
export interface Calendar extends CalendarConfig {
id: number
id?: number
name: string
events: CalendarEvent[]
color?: string,
}
export const postCalendarSchema = z.object({
name: z.string(),
today: dateSchema.optional().nullable(),
color: z.string().optional().nullable(),
worldId: z.number().int(),
})

View File

@@ -1,6 +1,14 @@
import { z } from 'zod'
export interface CalendarMonth {
id: number
id?: number
days: number,
name: string,
position: number,
}
export const calendarMonthSchema = z.object({
name: z.string().max(64),
days: z.number().int().min(12),
calendarId: z.number().int()
})

View File

@@ -2,7 +2,7 @@ import { z } from "zod"
export interface RPGDate {
day: number
month: number
month: number | string
year: number
}