fix(persoenliche-ausruestung): save characteristics on create/edit and add editable eigenschaft fields to assignment page
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user