diff --git a/shared/src/file/file.schema.ts b/shared/src/file/file.schema.ts index 273b44172..253a2ea16 100644 --- a/shared/src/file/file.schema.ts +++ b/shared/src/file/file.schema.ts @@ -14,6 +14,17 @@ import { z } from 'zod'; const nullableIdField = z.union([z.string(), z.number()]).nullable().optional(); +/** + * Multipart text fields riding along with the upload — always strings on the + * wire (multipart/form-data has no other type), so no numeric coercion here. + */ +export const fileUploadRequestSchema = z.object({ + place_id: z.string().optional(), + description: z.string().optional(), + reservation_id: z.string().optional(), +}); +export type FileUploadRequest = z.infer; + export const fileUpdateRequestSchema = z.object({ description: z.string().optional(), place_id: nullableIdField,