class HabitFactServiceImpl implements HabitFactService {

    @Override
    public HabitFact update(HabitFactPostDTO fact, Long id) {
        return habitFactRepo.findById(id)
            .map(employee -> {
                employee.setHabitDictionary(habitDictionaryRepo.findById(fact.getHabitDictionary().getId()).get());
                return habitFactRepo.save(employee);
            })
            .orElseThrow(() -> new NotUpdatedException(ErrorMessage.HABIT_FACT_NOT_UPDATED_BY_ID));
    }

    @Autowired public  HabitFactServiceImpl(ModelMapper modelMapper, HabitFactRepo habitFactRepo,
                                HabitDictionaryRepo habitDictionaryRepo, FactTranslationRepo factTranslationRepo);

}