Commit 4: Kategorien-API (CRUD + Reorder) und Favoriten-Toggle im Frontend

This commit is contained in:
2026-07-19 02:10:08 +02:00
parent f963f7eb4e
commit 129b4253b5
9 changed files with 261 additions and 19 deletions

View File

@@ -46,3 +46,22 @@ export const ServiceUpdateSchema = ServiceCreateSchema.omit({
deviceId: true,
}).partial();
export type ServiceUpdateInput = z.infer<typeof ServiceUpdateSchema>;
export const CategoryCreateSchema = z.object({
name: z.string().min(1, "name darf nicht leer sein"),
});
export type CategoryCreateInput = z.infer<typeof CategoryCreateSchema>;
export const CategoryUpdateSchema = CategoryCreateSchema.partial();
export type CategoryUpdateInput = z.infer<typeof CategoryUpdateSchema>;
/** Für Drag & Drop: neue Reihenfolge mehrerer Kategorien auf einmal setzen. */
export const CategoryReorderSchema = z
.array(
z.object({
id: z.string().min(1),
order: z.number(),
})
)
.min(1, "mindestens ein Eintrag erforderlich");
export type CategoryReorderInput = z.infer<typeof CategoryReorderSchema>;