import { RecipeTag } from '../response/recipe.interface';

export interface NewRecipeIngredient {
  id: number;
  quantity: number;
}

export interface NewRecipe {
  name: string;
  servings: number;
  ingredients: NewRecipeIngredient[];
  stepBySteps: string[];
  tagsIds: RecipeTag['id'][];
}

export interface SaveRecipePicture {
  recipeId: number;
  picture: File;
}

export interface GetRecipeIngredients {
  recipeId: number;
}

export type RecipeOrder =
  | 'id.asc'
  | 'id.desc'
  | 'name.asc'
  | 'name.desc'
  | 'likes.asc'
  | 'likes.desc'
  | 'calories.asc'
  | 'calories.desc'
  | 'servings.asc'
  | 'servings.desc';

export interface RecipeFilters {
  page: number;
  items_per_page: number;
  self: boolean;
  from_user_id: number;
  from_username: string;
  liked_only: boolean;
  tags_ids: number[];
  min_calorie_content_per_portion: number;
  max_calorie_content_per_portion: number;
  servings: number;
  ingredients_ids: number[];
  order_by: RecipeOrder;
  search_by_name: string;
}

export interface LikeRecipe {
  recipeId: number;
}

export interface EditIngredient {
  id: number;
  quantity: number;
  delete?: boolean;
}

export interface EditStepByStep {
  lexoRank: string;
  description: string;
  delete?: boolean;
}

export interface EditRecipe {
  name?: string;
  servings?: number;
  ingredients?: EditIngredient[];
  stepBySteps?: EditStepByStep[];
  tagsIds?: number[];
}
