import { z } from 'zod';
import { TouchBaseSchema } from '@isa/common/data-access';
import { FoodLabelSchema } from './food-label.schema';
import { AllergeneTypeSchema } from './allergene-type.schema';
import { DeclarableFoodAdditivesSchema } from './declarable-food-additives.schema';
import { NutritionFactsSchema } from './nutrition-facts.schema';

export const FoodSchema = TouchBaseSchema.extend({
  alcohol: z.number().describe('Alcohol').optional(),
  foodLabel: FoodLabelSchema.describe('Food label information').optional(),
  allergenes: AllergeneTypeSchema.describe('Allergenes').optional(),
  allergenesDescription: z.string().describe('Allergenes description').optional(),
  mayContainTracesOf: AllergeneTypeSchema.describe('May contain traces of').optional(),
  mayContainTracesOfDescription: z.string().describe('May contain traces of description').optional(),
  declarableFoodAdditives: DeclarableFoodAdditivesSchema.describe('Declarable food additives').optional(),
  nutritionFacts: NutritionFactsSchema.describe('Nutrition facts information').optional(),
});

export type Food = z.infer<typeof FoodSchema>;
