class ConfigurationService {

  public Configuration updateConfigurationById(Configuration configuration, User user) {
    Configuration dbConfiguration = configurationRepository.findByIdOrThrow(configuration.getId());
    dbConfiguration.setValue(configuration.getValue());
    dbConfiguration.setName(configuration.getName());
    logger.info(
        "Updated configuration "
            + dbConfiguration.getName()
            + " (id: "
            + dbConfiguration.getId()
            + ")");
    activityService.createActivity(user, dbConfiguration, Action.EDITED);
    publishConfigurationChangedEvent(dbConfiguration);
    return configurationRepository.save(dbConfiguration);
  }

}