Class AssistedChannelsUsersController

java.lang.Object
es.kukenan.smartfi.microservice.clients.controller.assistenchannels.AssistedChannelsUsersController

@RestController public class AssistedChannelsUsersController extends Object
Rest service exposed for Assisted Channels users endpoints.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    AGENT/SUPERVISOR API access authorities.
    static final String
    REST API onboarding processes resources base path.
    static final String
    REST API assisted login endpoint path.
    static final String
    REST API base path (assisted channels API).
    static final String
    REST API user generate OTP assisted-channel.
    static final String
    REST API user reset password.
    static final String
    REST API onboarding processes resources base path.
    private es.kukenan.smartfi.common.context.RequestContextManager
    Request context manager.
    private UserService
    Users service.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.AssistedChannelLoginResponseDto>
    assistedChannelLogin(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authenticationJwt)
    Post to login an Assited Channel agent.
    es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.clients.dto.UserDto>
    findUsers(String name, String surname, String documentNumber, Integer pageNumber, Integer pageSize, String sortedBy, es.kukenan.smartfi.common.service.jwt.enums.EntityBankEnum companyId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Find users based on the given search criteria.
    org.springframework.http.ResponseEntity<Void>
    generateOtp(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Generate OTP and create firm.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.LoginResponseDto>
    impersonateUser(es.kukenan.smartfi.microservice.clients.dto.ImpersonateRequestDto userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Impersonate the user with a given identifier.
    org.springframework.http.ResponseEntity<Void>
    resetUserPassword(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Reset and send new provisional password.
    org.springframework.http.ResponseEntity<Void>
    Unlock user.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • API_AGENT_AUTHORITIES

      private static final String API_AGENT_AUTHORITIES
      AGENT/SUPERVISOR API access authorities.
      See Also:
    • API_PATH

      public static final String API_PATH
      REST API base path (assisted channels API).
      See Also:
    • API_LOGIN_PATH

      public static final String API_LOGIN_PATH
      REST API assisted login endpoint path.
      See Also:
    • API_IMPERSONATION_PATH

      public static final String API_IMPERSONATION_PATH
      REST API onboarding processes resources base path.
      See Also:
    • API_USERS_PATH

      public static final String API_USERS_PATH
      REST API onboarding processes resources base path.
      See Also:
    • API_USER_RESET_PASSWORD

      public static final String API_USER_RESET_PASSWORD
      REST API user reset password.
      See Also:
    • API_USER_GENERATE_OTP

      public static final String API_USER_GENERATE_OTP
      REST API user generate OTP assisted-channel.
      See Also:
    • userService

      @Autowired private UserService userService
      Users service.
    • contextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManager
      Request context manager.
  • Constructor Details

    • AssistedChannelsUsersController

      public AssistedChannelsUsersController()
  • Method Details

    • assistedChannelLogin

      @PostMapping(value="/api/v1/assisted-channels/login", consumes="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.AssistedChannelLoginResponseDto> assistedChannelLogin(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authenticationJwt)
      Post to login an Assited Channel agent.
      Parameters:
      authenticationJwt - Authentication generated by user "LDAP" information data
      Returns:
      Authentication in Base64
    • findUsers

      @GetMapping(path="/api/v1/assisted-channels/users", produces="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')") public es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.clients.dto.UserDto> findUsers(@RequestParam(name="name",required=false) String name, @RequestParam(name="surname",required=false) String surname, @RequestParam(name="documentNumber",required=false) String documentNumber, @RequestParam(name="pageNumber",required=false) Integer pageNumber, @RequestParam(name="pageSize",required=false) Integer pageSize, @RequestParam(name="sortedBy",required=false) String sortedBy, @RequestParam(name="companyId") es.kukenan.smartfi.common.service.jwt.enums.EntityBankEnum companyId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Find users based on the given search criteria.
      • All search criteria parameters are optional.
      • All text criteria are use to search as case insensitive substring in the given field.
      Parameters:
      name - user name.
      surname - user surname.
      documentNumber - user identification document number.
      pageNumber - results page number. Optional, default 0.
      pageSize - results page size. Optional, with configured default value and configured absolute maximum.
      sortedBy - allows the client to specify the field name to sort, default in ascending order. Add ASC or DESC keyword to specify sorting direction.
      companyId - Identifier company.
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      the users found wrapped in a page DTO.
    • unlockUser

      @PatchMapping(path="/api/v1/assisted-channels/users/{userId}/unlock", produces="application/json", consumes="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')") public org.springframework.http.ResponseEntity<Void> unlockUser(@PathVariable("userId") String userId)
      Unlock user.
      Parameters:
      userId - User identifier
      Returns:
      a ResponseEntity empty.
    • impersonateUser

      @PostMapping(path="/api/v1/assisted-channels/impersonations", produces="application/json", consumes="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.LoginResponseDto> impersonateUser(@RequestBody es.kukenan.smartfi.microservice.clients.dto.ImpersonateRequestDto userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Impersonate the user with a given identifier.
      Parameters:
      userId - the user identifier.
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      new credentials if the impersonation was successful.
    • resetUserPassword

      @PatchMapping(path="/api/v1/assisted-channels/users/resetPassword", produces="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')") public org.springframework.http.ResponseEntity<Void> resetUserPassword(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Reset and send new provisional password.
      Parameters:
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      a ResponseEntity empty.
    • generateOtp

      @PostMapping(path="/api/v1/assisted-channels/users/generateOtp", produces="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')") public org.springframework.http.ResponseEntity<Void> generateOtp(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Generate OTP and create firm.
      Parameters:
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      a ResponseEntity empty.