Class UserUtils
java.lang.Object
es.kukenan.smartfi.microservice.smartficore.util.UserUtils
User utilities.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UserDocumentgetActiveDocument(List<UserDocument> documents) Get the user active document given the list.static StringmapFullName(User user) Get user full name.static UserMongoMap Entity User to Document User for Mongo.static StringGet user phone.static es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDtomapToBackoffice(User user) Map the givenUserto aBasicUserDto.static List<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto>mapToBackoffice(List<User> users) Map the givenUserlist to aBasicUserDtolist.static es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.DetailUserDtomapToBackofficeDetail(User user) Map the givenUserto aDetailUserDto.static es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.BasicUserInfoDtomapToBasic(User user) Map the given User to Basic Dto.
-
Field Details
-
EFACTURAPTY_PHONE_REGEX
Invoice constant pais receptor - Panama.- See Also:
-
-
Constructor Details
-
UserUtils
public UserUtils()
-
-
Method Details
-
getActiveDocument
Get the user active document given the list.- Parameters:
documents- list of user documents- Returns:
- active document
-
mapToBasic
public static es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.BasicUserInfoDto mapToBasic(User user) Map the given User to Basic Dto.- Parameters:
user- from database.- Returns:
- Basic User Information Dto.
-
mapFullName
Get user full name.- Parameters:
user- user from databes.- Returns:
- user full name.
-
mapPhone
Get user phone.- Parameters:
user- user from databes.withPrefix- with prefix flag.- Returns:
- user phone.
-
mapToBackoffice
public static es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto mapToBackoffice(User user) Map the givenUserto aBasicUserDto.- Parameters:
user- a contract document.- Returns:
- the mapped BasicUserDto.
-
mapToBackoffice
public static List<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto> mapToBackoffice(List<User> users) Map the givenUserlist to aBasicUserDtolist.- Parameters:
users- a user backoffice document list.- Returns:
- the mapped BasicUserDto list.
-
mapToBackofficeDetail
public static es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.DetailUserDto mapToBackofficeDetail(User user) Map the givenUserto aDetailUserDto.- Parameters:
user- a contract document.- Returns:
- the mapped DetailUserDto.
-
mapMongo
Map Entity User to Document User for Mongo.- Parameters:
user- user document.- Returns:
- User mongo document.
-