fix(persoenliche-ausruestung): save characteristics on create/edit and add editable eigenschaft fields to assignment page

This commit is contained in:
Matthias Hochmeister
2026-04-15 20:06:02 +02:00
parent 260b71baf8
commit 3f8c4d151d
6 changed files with 141 additions and 51 deletions

View File

@@ -15,6 +15,12 @@ const isoDate = z.string().regex(
const ZustandEnum = z.enum(['gut', 'beschaedigt', 'abgaengig', 'verloren']);
const EigenschaftInput = z.object({
eigenschaft_id: z.number().int().positive().nullable().optional(),
name: z.string().min(1).max(200),
wert: z.string().max(500),
});
const CreateSchema = z.object({
bezeichnung: z.string().min(1).max(200),
kategorie: z.string().max(100).optional(),
@@ -27,6 +33,7 @@ const CreateSchema = z.object({
anschaffung_datum: isoDate.optional(),
zustand: ZustandEnum.optional(),
notizen: z.string().max(2000).optional(),
eigenschaften: z.array(EigenschaftInput).optional(),
});
const UpdateSchema = z.object({
@@ -41,6 +48,7 @@ const UpdateSchema = z.object({
anschaffung_datum: isoDate.nullable().optional(),
zustand: ZustandEnum.optional(),
notizen: z.string().max(2000).nullable().optional(),
eigenschaften: z.array(EigenschaftInput).nullable().optional(),
});
function isValidUUID(s: string): boolean {