Skip to content

Commit

Permalink
FKS-609 #comment status updated by accountEnabled field from Azure fo…
Browse files Browse the repository at this point in the history
…r external users #done
  • Loading branch information
Erling Jahr committed Jan 10, 2024
1 parent ca1b72c commit ac51ce0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
26 changes: 1 addition & 25 deletions src/main/java/no/fintlabs/externalUser/ExternalUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,10 @@ public User toUser(){
.mainOrganisationUnitId(mainOrganisationUnitId)
.email(email)
.mobilePhone(mobilePhone)
.status(accountEnabled?"ACTIV" :"DISABLED")
.build();
}





public SimpelExternalUser toSimpleExternalUser() {
return SimpelExternalUser
.builder()
.id(id)
.fullName(firstName + " " + lastName)
.userType(userType)
.organisationUnitName(mainOrganisationUnitName)
.organisationUnitId(mainOrganisationUnitId)
.build();
}

public DetailedExternalUser toDetailedExternalUser(){
return DetailedExternalUser
.builder()
.id(id)
.fullName(firstName +" "+ lastName)
.organisationUnitName(mainOrganisationUnitName)
.mobilePhone(mobilePhone)
.email(email)
.build();
}
}


29 changes: 0 additions & 29 deletions src/main/java/no/fintlabs/externalUser/ExternalUserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,6 @@ public ExternalUserService(UserService userService) {
this.userService = userService;
}

// public void save(ExternalUser externalUser) {
// externalUserRepository
// .findExternalUserByIdentityProviderUserObjectId(externalUser.getIdentityProviderUserObjectId())
// .ifPresentOrElse(onSaveExistingExternalUser(externalUser), onSaveNewExternalUser(externalUser));
// }
//
// private Runnable onSaveNewExternalUser(ExternalUser externalUser){
// return ()-> {
// ExternalUser newExternalUser = externalUserRepository.save(externalUser);
// log.info("Created new external user" + newExternalUser.getUserName());
// };
// }
//
// private Consumer<ExternalUser> onSaveExistingExternalUser(ExternalUser externalUser){
// return existingExternalUser -> {
// externalUser.setId(existingExternalUser.getId());
// log.info("Updating external user " + externalUser.getUserName());
// externalUserRepository.save(externalUser);
// };
// }
//
// public Optional<ExternalUser> getExternalUserById(Long id){
// return externalUserRepository.findById(id);
// }
//
// public List<ExternalUser> getAllExternalUsers(){
// return null;
// }


public void convertAndSaveAsUser(ExternalUser externalUser) {
User convertedExternalUser = externalUser.toUser();
Expand Down

0 comments on commit ac51ce0

Please sign in to comment.