class TechnologySettingService {

    @Transactional
    public void update(Long projectId, String code, Technology technology, String newValue) throws BadRequestException {
        String message = String.format(Messages.NOT_FOUND_TECHNOLOGY_SETTING, code);
        SettingDTO setting = getSettingDefinitionFromTechnologyAndCode(technology, code)
                .orElseThrow(() -> new NotFoundException(message, Entities.TECHNOLOGY_SETTING));

        settingService.validateNewValue(newValue, setting);

        TechnologySetting settingToSave = technologySettingRepository.findByProjectIdAndCodeAndTechnology(projectId, code, technology)
                .orElse(
                        new TechnologySetting()
                                .withProjectId(projectId)
                                .withCode(code)
                                .withTechnology(technology)
                );
        settingToSave.setValue(newValue);
        technologySettingRepository.save(settingToSave);
    }

}