import { model, Schema, Model, Document } from "mongoose";

export interface IFoodItem extends Document {
  title: string;
  kategorie: string;
  kalorien: string;
  fett: string;
  cholesterin: string;
  kohlenhydrate: string;
  zucker: string;
  staerke: string;
  protein: string;
  salz: string;
  alkohol: string;
  wasser: string;
  kalium: string;
  natrium: string;
  chlorid: string;
  calcium: string;
  magnesium: string;
  phosphor: string;
  eisen: string;
  jod: string;
  zink: string;
  selen: string;
}

const FoodItemSchema: Schema = new Schema({
  title: { type: String, required: true, unique: true },
  Kategorie: { type: String },
  kalorien: { type: String },
  fett: { type: String },
  cholesterin: { type: String },
  kohlenhydrate: { type: String },
  zucker: { type: String },
  staerke: { type: String },
  protein: { type: String },
  salz: { type: String },
  alkohol: { type: String },
  wasser: { type: String },
  kalium: { type: String },
  natrium: { type: String },
  chlorid: { type: String },
  calcium: { type: String },
  magnesium: { type: String },
  phosphor: { type: String },
  eisen: { type: String },
  jod: { type: String },
  zink: { type: String },
  selen: { type: String },
});

export const FoodItem: Model<IFoodItem> = model("fooditem", FoodItemSchema);
