import { z } from 'zod';

export const createProductColourSchema = z.object({
    code: z.string().min(1, 'Code is required').max(50, 'Code must be less than 50 characters'),
    name: z.string().min(1, 'Name is required').max(100, 'Name must be less than 100 characters'),
    hex: z.string().regex(/^#([0-9A-Fa-f]{6})$/, 'Hex must be a valid 6-digit HEX color (e.g., #FFFFFF)'),
});

export type CreateProductColourFormValues = z.infer<typeof createProductColourSchema>;

export const updateProductColourSchema = z.object({
    code: z.string().min(1, 'Code is required').max(50, 'Code must be less than 50 characters'),
    name: z.string().min(1, 'Name is required').max(100, 'Name must be less than 100 characters'),
    hex: z.string().regex(/^#([0-9A-Fa-f]{6})$/, 'Hex must be a valid 6-digit HEX color (e.g., #FFFFFF)'),
});

export type UpdateProductColourFormValues = z.infer<typeof updateProductColourSchema>;
