Class ContractService
java.lang.Object
es.kukenan.smartfi.microservice.contracts.service.ContractService
Contract service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringAdvance constant.private BackofficeClientManagerBack office clients manager.private ConnectedContractCacheOperationConnected Contract Cache Operation.private ContractCacheOperationContract Cache Operation.private static final StringCredit constant.private EbContractRepositoryEb contract DB repository.protected es.kukenan.smartfi.common.service.jwt.JwtServiceJWT service for create a bearer to call products.private UserBackofficeRepositoryUser backoffice repository.private UserRepositoryUser repository. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.CountInfoDto>>countApplications(String userId, String userToken) Application count.private BackofficeClientfindBackofficeClient(String userId) Find backoffice client from User Identifier.getCompanyLogo(String userId, String userJwtToken, Integer companyId, javax.servlet.http.HttpServletResponse response) Get company logo.getContract(String contractId) Get contract by id.es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.ContractgetContractDetail(String userId, String userToken, String contractId) get contract detail.voidgetContractDocumentFile(String userId, String userToken, String contractDocumentId, javax.servlet.http.HttpServletResponse response) Get contract document file.es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>getContracts(String userId, String sessionId, String parentSessionId, String userToken, Integer pageNumber, Integer pageSize, String sortedBy, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.GetApplicationsRequestDto getApplicationsRequestDto) get contracts.List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.ContractStateDto>getContractStates(String userId, String userToken, String type) get contract staes.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>saveAppointment(String userId, String userToken, String contractId, es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentAndBankRequest appointmentAndBankRequest) Create appointment for application.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>saveContract(String userId, String userToken, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.NewApplicationRequestDto newApplicationRequestDto, String userIp, String userAgent) Create new application.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>uploadFile(String contractId, String userId, List<org.springframework.web.multipart.MultipartFile> files, String userToken) Upload files.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>uploadFile(String contractDocumentId, String userId, org.springframework.web.multipart.MultipartFile file, String userToken) Upload files.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Boolean>>validNewContract(String userId, String userToken, String type) Validation if user can create Contract.
-
Field Details
-
CREDIT_PRODUCT
Credit constant.- See Also:
-
ADVANCE_PRODUCT
Advance constant.- See Also:
-
jwtService
@Autowired protected es.kukenan.smartfi.common.service.jwt.JwtService jwtServiceJWT service for create a bearer to call products. -
ebContractRepository
Eb contract DB repository. -
userBackofficeRepository
User backoffice repository. -
userRepository
User repository. -
backofficeClientManager
Back office clients manager. -
connectedContractCacheOperation
Connected Contract Cache Operation. -
contractCacheOperation
Contract Cache Operation.
-
-
Constructor Details
-
ContractService
public ContractService()
-
-
Method Details
-
getContracts
public es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract> getContracts(String userId, String sessionId, String parentSessionId, String userToken, Integer pageNumber, Integer pageSize, String sortedBy, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.GetApplicationsRequestDto getApplicationsRequestDto) get contracts.- Parameters:
userId- user identifier.sessionId- session identifier.parentSessionId- parent session identifier.userToken- user bearer token.pageNumber- number of page to get.pageSize- size of list to return.sortedBy- sort param.getApplicationsRequestDto- body for filtering.- Returns:
- ContractResponseDto.
-
getContractDetail
public es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract getContractDetail(String userId, String userToken, String contractId) get contract detail.- Parameters:
userId- user identifier.userToken- user bearer token.contractId- contract identifier.- Returns:
- ContractResponseDto.
-
getContract
Get contract by id.- Parameters:
contractId- id.- Returns:
- contract.
-
getContractStates
public List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.ContractStateDto> getContractStates(String userId, String userToken, String type) get contract staes.- Parameters:
userId- user identifier.userToken- user bearer token.type- type for filtering.- Returns:
- ContractResponseDto.
-
validNewContract
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Boolean>> validNewContract(String userId, String userToken, String type) Validation if user can create Contract.- Parameters:
userId- user identifier.userToken- user bearer token.type- contract type.- Returns:
- the contract validation.
-
saveContract
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> saveContract(String userId, String userToken, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.NewApplicationRequestDto newApplicationRequestDto, String userIp, String userAgent) Create new application.- Parameters:
userId- user identifier.userToken- user bearer token.newApplicationRequestDto- new application data.userIp- user real ipuserAgent- user-agent header- Returns:
- ContractResponseDto.
-
uploadFile
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> uploadFile(String contractId, String userId, List<org.springframework.web.multipart.MultipartFile> files, String userToken) Upload files.- Parameters:
contractId- application identifier.userId- user identifier.files- files uploaded.userToken- user token.- Returns:
- upload files response.
-
uploadFile
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> uploadFile(String contractDocumentId, String userId, org.springframework.web.multipart.MultipartFile file, String userToken) Upload files.- Parameters:
contractDocumentId- application identifier.userId- user identifier.file- file uploaded.userToken- user token.- Returns:
- upload files response.
-
saveAppointment
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> saveAppointment(String userId, String userToken, String contractId, es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentAndBankRequest appointmentAndBankRequest) Create appointment for application.- Parameters:
userId- user identifier.userToken- user bearer token.contractId- contract identifier.appointmentAndBankRequest- appointment data.- Returns:
- ContractResponseDto.
-
countApplications
public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.CountInfoDto>> countApplications(String userId, String userToken) Application count.- Parameters:
userId- user identifier.userToken- user credentials.- Returns:
- count object.
-
findBackofficeClient
Find backoffice client from User Identifier.- Parameters:
userId- user identifier.- Returns:
- backoffice client found.
-
getContractDocumentFile
public void getContractDocumentFile(String userId, String userToken, String contractDocumentId, javax.servlet.http.HttpServletResponse response) throws IOException Get contract document file.- Parameters:
userId- user identifier.userToken- user credentials.contractDocumentId- contract document identifier.response- response.- Throws:
IOException- file to write response.
-
getCompanyLogo
public String getCompanyLogo(String userId, String userJwtToken, Integer companyId, javax.servlet.http.HttpServletResponse response) throws IOException Get company logo.- Parameters:
userId- user identifier.userJwtToken- user credentials.companyId- company identifier.response- response.- Returns:
- Base64 logo image.
- Throws:
IOException- file to write response.
-