/**
 * @ai-summary Request validation schemas for user profile API
 * @ai-context Uses Zod for runtime validation and type safety
 */

import { z } from 'zod';

export const updateProfileSchema = z.object({
  displayName: z.string().max(100, 'Display name must be 100 characters or less').optional(),
  notificationEmail: z.string().email('Invalid email format').optional(),
}).refine(
  (data) => data.displayName !== undefined || data.notificationEmail !== undefined,
  {
    message: 'At least one field (displayName or notificationEmail) must be provided',
  }
);

export type UpdateProfileInput = z.infer<typeof updateProfileSchema>;

export const requestDeletionSchema = z.object({
  confirmationText: z.string().refine((val) => val === 'DELETE', {
    message: 'Confirmation text must be exactly "DELETE"',
  }),
});

export type RequestDeletionInput = z.infer<typeof requestDeletionSchema>;
