bug fixes
This commit is contained in:
@@ -42,6 +42,16 @@ export interface Veranstaltung {
|
||||
kategorie_farbe?: string | null;
|
||||
kategorie_icon?: string | null;
|
||||
erstellt_von_name?: string | null;
|
||||
// Recurrence fields
|
||||
wiederholung?: WiederholungConfig | null;
|
||||
wiederholung_parent_id?: string | null;
|
||||
}
|
||||
|
||||
export interface WiederholungConfig {
|
||||
typ: 'wöchentlich' | 'zweiwöchentlich' | 'monatlich_datum' | 'monatlich_erster_wochentag' | 'monatlich_letzter_wochentag';
|
||||
intervall?: number;
|
||||
bis: string;
|
||||
wochentag?: number;
|
||||
}
|
||||
|
||||
/** Lightweight version for calendar and list views */
|
||||
@@ -60,6 +70,9 @@ export interface VeranstaltungListItem {
|
||||
zielgruppen: string[];
|
||||
abgesagt: boolean;
|
||||
anmeldung_erforderlich: boolean;
|
||||
// Recurrence fields
|
||||
wiederholung?: WiederholungConfig | null;
|
||||
wiederholung_parent_id?: string | null;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -119,6 +132,12 @@ const VeranstaltungBaseSchema = z.object({
|
||||
.transform((s) => new Date(s))
|
||||
.optional()
|
||||
.nullable(),
|
||||
wiederholung: z.object({
|
||||
typ: z.enum(['wöchentlich', 'zweiwöchentlich', 'monatlich_datum', 'monatlich_erster_wochentag', 'monatlich_letzter_wochentag']),
|
||||
intervall: z.number().int().min(1).max(52).optional(),
|
||||
bis: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'bis muss ein Datum (YYYY-MM-DD) sein'),
|
||||
wochentag: z.number().int().min(0).max(6).optional(),
|
||||
}).optional().nullable(),
|
||||
});
|
||||
|
||||
export const CreateVeranstaltungSchema = VeranstaltungBaseSchema.refine(
|
||||
|
||||
Reference in New Issue
Block a user