25 lines
810 B
JavaScript
25 lines
810 B
JavaScript
import { z } from 'zod';
|
|
|
|
export const createInventoryImageSchema = z.object({
|
|
storageKey: z.string().trim().min(1).max(500),
|
|
originalFilename: z.string().trim().min(1).max(255),
|
|
mimeType: z.enum(['image/jpeg', 'image/png', 'image/webp']),
|
|
fileSize: z.int().positive(),
|
|
width: z.int().positive(),
|
|
height: z.int().positive(),
|
|
altText: z.string().trim().max(1000).optional(),
|
|
sortOrder: z.int().nonnegative().optional(),
|
|
isPrimary: z.boolean().optional(),
|
|
}).strict();
|
|
export const moveInventoryImageSchema = z.object({
|
|
direction: z.enum(['up', 'down']),
|
|
}).strict();
|
|
|
|
export const updateImageOrderSchema = z.object({
|
|
sortOrder: z.int().min(0).max(2147483647),
|
|
}).strict();
|
|
|
|
export const updateImageAltTextSchema = z.object({
|
|
altText: z.string().trim().max(1000).nullable(),
|
|
}).strict();
|