import { z } from 'zod';

export const UpdateAccountSchema = z.object({
  firstName: z
    .string({
      required_error: 'First name is required',
    })
    .nonempty(),
  lastName: z
    .string({
      required_error: 'Last name is required',
    })
    .nonempty(),
  personalCode: z
    .string({
      required_error: 'Personal code is required',
    })
    .nonempty(),
  email: z.string().email({
    message: 'Email is required',
  }),
  phone: z
    .string({
      required_error: 'Phone number is required',
    })
    .nonempty(),
  city: z.string().optional(),
  weight: z
    .number({
      required_error: 'Weight is required',
      invalid_type_error: 'Weight must be a number',
    })
    .gt(0, { message: 'Weight must be greater than 0' }),

  height: z
    .number({
      required_error: 'Height is required',
      invalid_type_error: 'Height must be a number',
    })
    .gt(0, { message: 'Height must be greater than 0' }),
  userConsent: z.boolean().refine((val) => val === true, {
    message: 'Must be true',
  }),
});
