import { TransformNullOrUndefinedIntoEmptyArray } from '../../../shared/decorators/class-transformer/transform-null-or-undefined-into-empty-array.decorator';
import { MealFoodDto } from './meal-food.dto';
import { MealRecipeDto } from './meal-recipe.dto';

export class MealDto {
  id: number;
  mealTime: string;

  @TransformNullOrUndefinedIntoEmptyArray()
  foods: MealFoodDto[];

  @TransformNullOrUndefinedIntoEmptyArray()
  recipes: MealRecipeDto[];

  constructor(partial: Partial<MealDto>) {
    Object.assign(this, partial);
  }
}
