Class BackofficeService
java.lang.Object
es.kukenan.smartfi.microservice.onboarding.service.BackofficeService
Backoffice management service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringAdvance constant.private static final StringDocument state approved payment pending name.private static final StringDocument state company affiliation name.private static final StringCredit constant.private intDefault page size in paginated request where page size is not specified.private DocumentTypeRepositoryDocument Type repository.private final org.springframework.data.domain.ExampleMatcherExample matcher configuration.private InternalProductsApiClientCore api client.private KafkaControllerKafka Controller.private final es.kukenan.smartfi.logger.WalletLoggerWallet logger.private OnboardingInitiatedEventMapperUser created Event mapper.private OnboardingServiceOnboarding service.(package private) OnboardingUpdateEventMapperUser updated Event mapper.private OtpServiceOtp service.private static final StringError message for ian invalid sorting criteria specification.private SourceFundsRepositorySource Funds repository.private UserBackofficeRepositoryUser Backoffice repository.private UserEntityMapperUser entity mapper.private UserRepositoryUsers repository.private WorkerTypeRepositoryWorker Type repository. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiones.kukenan.smartfi.microservice.backoffice.dtos.core.contract.NewApplicationRequestDtobuildApplicationRequest(User user, es.kukenan.smartfi.dto.onboarding.OtpRequestDto otpRequestDto, String product, Boolean isOnboarding) Create new application request.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.dto.backoffice.UserDetailBackofficeDTO>>getUser(es.kukenan.smartfi.dto.backoffice.UserBackofficeRequestDTO userBackofficeRequest) Search if user exist.org.springframework.http.ResponseEntity<Object>getUsers(es.kukenan.smartfi.dto.backoffice.UserBackofficeRequestDTO userBackofficeRequest, Integer pageNumber, Integer pageSize, String sortedBy) getting all users.private org.springframework.data.domain.PageRequestCreate aPageableinstance from the given paging specification.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>saveUserFromPromotor(User newUser, Job job, Address address, es.kukenan.smartfi.microservice.onboarding.events.common.CompanyDto company, String product, es.kukenan.smartfi.dto.onboarding.OtpRequestDto otpRequestDto, Boolean createRequest, es.kukenan.smartfi.microservice.onboarding.events.common.BankAccountDto bankAccount, Boolean firstDataCheck, String userIp, String userAgent) Save User from backoffice.private org.springframework.data.domain.SortCreate aSortinstance from the given sorting specification.
-
Field Details
-
CREDIT_PRODUCT
Credit constant.- See Also:
-
ADVANCE_PRODUCT
Advance constant.- See Also:
-
APPROVED_PAYMENT_PENDING_NAME
Document state approved payment pending name.- See Also:
-
COMPANY_AFFILIATION_NAME
Document state company affiliation name.- See Also:
-
log
private final es.kukenan.smartfi.logger.WalletLogger logWallet logger. -
SORT_ERROR
Error message for ian invalid sorting criteria specification.- See Also:
-
exampleMatcher
private final org.springframework.data.domain.ExampleMatcher exampleMatcherExample matcher configuration. -
defaultPageSize
@Value("${query.pagination.pageSize.default}") private int defaultPageSizeDefault page size in paginated request where page size is not specified. -
userEntityMapper
User entity mapper. -
userRepository
Users repository. -
workerTypeRepository
Worker Type repository. -
sourceFundsRepository
Source Funds repository. -
documentTypeRepository
Document Type repository. -
userBackofficeRepository
User Backoffice repository. -
kafkaController
Kafka Controller. -
onboardingInitiatedEventMapper
User created Event mapper. -
onboardingUpdateEventMapper
User updated Event mapper. -
onboardingService
Onboarding service. -
otpService
Otp service. -
internalProductsApiClient
Core api client.
-
-
Constructor Details
-
BackofficeService
public BackofficeService()
-
-
Method Details
-
getUser
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.dto.backoffice.UserDetailBackofficeDTO>> getUser(es.kukenan.smartfi.dto.backoffice.UserBackofficeRequestDTO userBackofficeRequest) Search if user exist.- Parameters:
userBackofficeRequest- filtered request fields- Returns:
- user dto.
-
getUsers
public org.springframework.http.ResponseEntity<Object> getUsers(es.kukenan.smartfi.dto.backoffice.UserBackofficeRequestDTO userBackofficeRequest, Integer pageNumber, Integer pageSize, String sortedBy) getting all users.- Parameters:
userBackofficeRequest- filtered request fieldspageNumber- page number for searchpageSize- size of each pagesortedBy- parameter to be sorted- Returns:
- user dto.
-
sortedBy
Create aSortinstance from the given sorting specification.- Parameters:
sortedByClause- the sorting specification.- Returns:
- the
Sortinstance from the given sorting specification.
-
page
private org.springframework.data.domain.PageRequest page(Integer pageNumber, Integer pageSize, org.springframework.data.domain.Sort sort) Create aPageableinstance from the given paging specification.- Parameters:
pageNumber- page number, optional default 0.pageSize- page size, optional defaultdefaultPageSize.sort- sorting, optional.- Returns:
- the page request for the given paging specification.
-
saveUserFromPromotor
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> saveUserFromPromotor(User newUser, Job job, Address address, es.kukenan.smartfi.microservice.onboarding.events.common.CompanyDto company, String product, es.kukenan.smartfi.dto.onboarding.OtpRequestDto otpRequestDto, Boolean createRequest, es.kukenan.smartfi.microservice.onboarding.events.common.BankAccountDto bankAccount, Boolean firstDataCheck, String userIp, String userAgent) Save User from backoffice.- Parameters:
newUser- User entity.job- Job entity.address- Address entity.company- Company Dtoproduct- Product Type.otpRequestDto- Otp Request Dto with Credit/Advance data.createRequest- flag for create or not a request.bankAccount- user bank account details.firstDataCheck- flag to check data on first login.userIp- user real ipuserAgent- user-agent header- Returns:
- User created.
-
buildApplicationRequest
public es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.NewApplicationRequestDto buildApplicationRequest(User user, es.kukenan.smartfi.dto.onboarding.OtpRequestDto otpRequestDto, String product, Boolean isOnboarding) Create new application request.- Parameters:
user- user entity.otpRequestDto- product data.product- product type.isOnboarding- flag for change request initial status.- Returns:
- new application request object.
-