fix(05-01): add imageFilename to Zod validation schemas

- Root cause: Zod schemas for createItem and createCandidate did not
  include imageFilename field, so @hono/zod-validator silently stripped
  it from validated payloads before reaching the service layer
- Images uploaded successfully but filename was never persisted to DB
- Added imageFilename as optional string to both createItemSchema and
  createCandidateSchema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 17:09:59 +01:00
parent a52fa3b24c
commit 8c0529cd60

View File

@@ -7,6 +7,7 @@ export const createItemSchema = z.object({
categoryId: z.number().int().positive(),
notes: z.string().optional(),
productUrl: z.string().url().optional().or(z.literal("")),
imageFilename: z.string().optional(),
});
export const updateItemSchema = createItemSchema.partial().extend({
@@ -43,6 +44,7 @@ export const createCandidateSchema = z.object({
categoryId: z.number().int().positive(),
notes: z.string().optional(),
productUrl: z.string().url().optional().or(z.literal("")),
imageFilename: z.string().optional(),
});
export const updateCandidateSchema = createCandidateSchema.partial();