class AddEcoNewsDtoResponseMapper extends AbstractConverter<EcoNews, AddEcoNewsDtoResponse> {

    @Override
    protected AddEcoNewsDtoResponse convert(EcoNews ecoNews) {
        return AddEcoNewsDtoResponse.builder()
            .id(ecoNews.getId())
            .text(ecoNews.getText())
            .title(ecoNews.getTitle())
            .source(ecoNews.getSource())
            .imagePath(ecoNews.getImagePath())
            .creationDate(ecoNews.getCreationDate())
            .ecoNewsAuthorDto(EcoNewsAuthorDto.builder()
                .id(ecoNews.getAuthor().getId())
                .name(ecoNews.getAuthor().getName())
                .build())
            .tags(ecoNews.getTags()
                .stream()
                .map(Tag::getName)
                .collect(Collectors.toList()))
            .build();
    }

}