class UserSettingsService {

  public UserSettings getUserSettingsByUser(User user) {
    UserSettings userSettings = userSettingsRepository.findUserSettingsByUserId(user.getId());
    if (userSettings == null) {
      userSettings = new UserSettings();
      userSettings.setUserId(user.getId());
      userSettings.setDefaultOkrCompany(getDefaultCompany());
      userSettings.setDefaultTeam(getDefaultTeam(user, userSettings.getDefaultOkrCompany()));
      userSettings = userSettingsRepository.save(userSettings);
      activityService.createActivity(user, userSettings, Action.CREATED);
      logger.info(
          "Created User Settings "
              + userSettings.getName()
              + "(id: "
              + userSettings.getId()
              + ") ");
    }
    return userSettings;
  }

  @Autowired public  UserSettingsService(
      UserSettingsRepository userSettingsRepository,
      ActivityService activityService,
      CompanyService companyService);

}