class CustomGoalServiceImpl implements CustomGoalService {

    @Transactional
    @Override
    public List<CustomGoalResponseDto> save(BulkSaveCustomGoalDto bulkSave, User user) {
        List<CustomGoalSaveRequestDto> dto = bulkSave.getCustomGoalSaveRequestDtoList();
        List<String> errorMessages = findDuplicates(dto, user);
        if (!errorMessages.isEmpty()) {
            throw new CustomGoalNotSavedException(CUSTOM_GOAL_WHERE_NOT_SAVED + errorMessages.toString());
        }
        customGoalRepo.saveAll(user.getCustomGoals());
        return user.getCustomGoals().stream()
            .map(customGoal -> modelMapper.map(customGoal, CustomGoalResponseDto.class))
            .collect(Collectors.toList());
    }

}