java.lang.Object
es.kukenan.smartfi.microservice.transfer.utils.UserUtils

@Component public class UserUtils extends Object
class for handler some util methods.
  • Field Details

    • userRepository

      @Autowired private UserRepository userRepository
      User repository.
  • Constructor Details

    • UserUtils

      public UserUtils()
  • Method Details

    • map

      public static List<UserBackoffice> map(User user, List<es.kukenan.smartfi.microservice.clients.events.common.UserBackoffice> userBackofficeEntities)
      Map the given UserBackoffice list to a UserBackoffice list.
      Parameters:
      user - event.
      userBackofficeEntities - a user backoffice entity list.
      Returns:
      the mapped user backoffice dto list.
    • extractUserId

      public static String extractUserId(es.kukenan.smartfi.common.security.WalletAuthentication kukenanWalletAuthentication)
      Extract user ID from kukenan authentication.
      Parameters:
      kukenanWalletAuthentication - received authentication.
      Returns:
      the user identifier.
    • extractCompanyId

      public static String extractCompanyId(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication)
      Extract user company value.
      Parameters:
      walletAuthentication - received authentication.
      Returns:
      the company value identifier.
    • extractSessionId

      public static String extractSessionId(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication)
      Extract Session ID from kukenan authentication.
      Parameters:
      walletAuthentication - received authentication.
      Returns:
      the Session identifier.
    • getUser

      public User getUser(String userId)
      Returns User from database.
      Parameters:
      userId - userId
      Returns:
      User