import { z } from 'zod/v4';

export const NutritionTargetSchema = z.object({
  dailyCalories: z.number().positive(),
  proteinG: z.number().min(0),
  carbsG: z.number().min(0),
  fatG: z.number().min(0),
  fiberG: z.number().min(0).optional(),
  sodiumMg: z.number().min(0).optional(),
  sugarG: z.number().min(0).optional(),
  isActive: z.boolean().default(true),
});

export const NutritionTargetResponseSchema = NutritionTargetSchema.extend({
  _id: z.string(),
  userId: z.string(),
  householdId: z.string(),
  createdAt: z.string(),
  updatedAt: z.string(),
});

export type SetNutritionTargetInput = z.infer<typeof NutritionTargetSchema>;
export type NutritionTargetResponse = z.infer<typeof NutritionTargetResponseSchema>;
