import { CompactRecipeDto } from "../api/dtos/CompactRecipeDto.js";
import { RecipeEntity } from "../entities/RecipeEntity.js";
import { AbstractDtoEntityMapper } from "./AbstractDtoEntityMapper.js";

export class CompactRecipeDtoEntityMapper extends AbstractDtoEntityMapper<RecipeEntity,CompactRecipeDto>{

    toDto(entity: RecipeEntity): CompactRecipeDto {
        const dto = new CompactRecipeDto();
        this.mapBaseEntityToDto(entity, dto);

        dto.title = entity.title;

        return dto;
    }

  toEntity(dto: CompactRecipeDto): RecipeEntity {
    throw new Error("Mapping CompactRecipeDto to RecipeEntity is not allowed!");
  }

  createNewEntity() : RecipeEntity {
    throw new Error("Mapping CompactRecipeDto to RecipeEntity is not allowed!");
  }

  mergeDtoIntoEntity(dto: CompactRecipeDto, entity: RecipeEntity): RecipeEntity {
    throw new Error("Mapping CompactRecipeDto to RecipeEntity is not allowed!");
  }

  mergeDtoListIntoEntityList(dtos: CompactRecipeDto[], entities: RecipeEntity[]) : RecipeEntity[]{
    throw new Error("Mapping CompactRecipeDto to RecipeEntity is not allowed!");
  }

}