class HabitStatisticServiceImpl implements HabitStatisticService {

    @Transactional
    @CacheEvict(value = CacheConstants.HABIT_ITEM_STATISTIC_CACHE, allEntries = true)
    @Override
    public UpdateHabitStatisticDto update(Long habitStatisticId, UpdateHabitStatisticDto dto) {
        HabitStatistic updatable = findById(habitStatisticId);

        updatable.setAmountOfItems(dto.getAmountOfItems());
        updatable.setHabitRate(dto.getHabitRate());
        return modelMapper.map(habitStatisticRepo.save(updatable),
            UpdateHabitStatisticDto.class);
    }

    @Autowired public  HabitStatisticServiceImpl(HabitStatisticRepo habitStatisticRepo,
                                     HabitRepo habitRepo,
                                     HabitService habitService, ModelMapper modelMapper,
                                     DateService dateService);

}