class FavoritePlaceServiceImpl implements FavoritePlaceService {

    @Override
    public FavoritePlaceDto update(FavoritePlaceDto favoritePlaceDto, String userEmail) {
        log.info(LogMessage.IN_UPDATE, favoritePlaceDto);

        FavoritePlace favoritePlace = repo.findByPlaceIdAndUserEmail(favoritePlaceDto.getPlaceId(), userEmail);
        if (favoritePlace == null) {
            throw new WrongIdException(ErrorMessage.FAVORITE_PLACE_NOT_FOUND + favoritePlaceDto.getPlaceId());
        }
        favoritePlace.setName(favoritePlaceDto.getName());
        return modelMapper.map(repo.save(favoritePlace), FavoritePlaceDto.class);
    }

}