Class ContractController

java.lang.Object
es.kukenan.smartfi.microservice.smartficore.controller.AbstractController
es.kukenan.smartfi.microservice.smartficore.controller.ContractController

@RestController public class ContractController extends AbstractController
Controller to reply Core contract endpoints definition.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Advance constant.
    static final String
    Authority (role) required in order to be able to invoke greeting API.
    static final String
    Authority (role) required in order to be able to invoke change application status.
    private static final String
    Password change API access authorities.
    private es.kukenan.smartfi.common.context.RequestContextManager
    Request context manager.
    private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl
    JWT service for create a bearer to call products.
    Contract service.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>>
    changeAdvanceToPaymentReturn(es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.UpdateListOfContractsRequestDto updateListOfContractsRequestDto, String userId)
    Change a list of application identifier from APPROVED_PAYMENT_PENDING_NAME (advance) to PAYED (advance).
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>>
    changeCreditToActive(es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.UpdateListOfContractsRequestDto updateListOfContractsRequestDto, String userId)
    Change a list of application identifier from PAYMENT_PENDING (credit) to ACTIVE (credit).
    void
    generateContractFile(String contractId, String userId, javax.servlet.http.HttpServletResponse response)
    Generate PDF contract for application PENDING_SIGNATURE (credit) or APPROVED (advance).
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>>
    Retrieve Approved Contracts list.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<Object>>
    getContractDetail(String contractId, String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Retrieve Contracts Detail.
    void
    getContractDocumentFile(String contractDocumentId, String userId, javax.servlet.http.HttpServletResponse response)
    Get contract document file.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.clients.dto.ContractCompanyInfoDto>>
    Retrieve Contracts and Company information for user.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.CountInfoDto>>
    getContractsCount(String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Retrieve Contracts count.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<Object>>
    getContractsFiltered(Integer pageNumber, Integer pageSize, String sortedBy, String userId, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.GetApplicationsRequestDto getApplicationsRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Retrieve Contracts list with filters.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<Object>>
    Retrieve Contract state list.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    saveContract(es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.NewApplicationRequestDto newApplicationRequestDto, String userIp, String userAgent)
    Create Contract.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    updateContractAppointment(String contractId, String userId, es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentDto appointmentDto)
    Update contract with appointment.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    updateContractDocumentStatus(String contractDocumentId, String userId, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.UpdateContractDocumentRequestDto requestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Update contract document status.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    updateContractDocumentStatus(String contractDocumentId, String userId, org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Save specific contract document file.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    updateContractStatus(String contractId, String userId, es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.ContractStatusRequestDto contractStatusRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Change application status.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    uploadFiles(String contractId, String userId, List<org.springframework.web.multipart.MultipartFile> files, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Upload files.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    uploadPaymentProofFile(String contractId, String userId, org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Change application from PAYMENT_PENDING (credit) or APPROVED_PAYMENT_PENDING_NAME (advance) to PAYED (advance) or ACTIVE (credit).
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>
    uploadSignedContractFile(String contractId, String userId, org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Change application from PENDING_SIGNATURE (credit) or APPROVED (advance) to PAYMENT_PENDING (credit) and APPROVED_PAYMENT_PENDING (advance).
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Boolean>>
    Validation if user can create Contract.

    Methods inherited from class es.kukenan.smartfi.microservice.smartficore.controller.AbstractController

    fillResponseOk, fillResponseOk

    Methods inherited from class java.lang.Object

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

    • ADVANCE_PRODUCT

      private static final String ADVANCE_PRODUCT
      Advance constant.
      See Also:
    • service

      @Autowired private ContractService service
      Contract service.
    • jwtService

      @Autowired private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl jwtService
      JWT service for create a bearer to call products.
    • contextManager

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

      public static final String API_AUTHORITIES
      Authority (role) required in order to be able to invoke greeting API.
      See Also:
    • API_BACKOFFICE_AUTHORITIES

      public static final String API_BACKOFFICE_AUTHORITIES
      Authority (role) required in order to be able to invoke change application status.
      See Also:
    • API_PWD_CHANGE_AUTHORITIES

      private static final String API_PWD_CHANGE_AUTHORITIES
      Password change API access authorities.
      See Also:
  • Constructor Details

    • ContractController

      public ContractController()
  • Method Details

    • validNewContract

      @GetMapping(path="/api-contracts/new-contract", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Boolean>> validNewContract(@RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestParam(name="type",required=false,defaultValue="advance") String type)
      Validation if user can create Contract.
      Parameters:
      userId - user identifier.
      type - contract type.
      Returns:
      the contract validation.
    • saveContract

      @PostMapping(path="/api-contracts/new-contract", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> saveContract(@RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.NewApplicationRequestDto newApplicationRequestDto, @RequestHeader(name="X-SKYLINE-USER-IP",defaultValue="N/A") String userIp, @RequestHeader(name="X-USER-AGENT",defaultValue="N/A") String userAgent)
      Create Contract.
      Parameters:
      newApplicationRequestDto - application info.
      userIp - user real ip
      userAgent - user-agent header
      Returns:
      the created contract.
    • getContractStates

      @GetMapping(path="/api-contracts/contracts/states", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<Object>> getContractStates(@RequestParam(name="type",required=false) String type)
      Retrieve Contract state list.
      Parameters:
      type - application type.
      Returns:
      the contracts.
    • getContractsCount

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(path="/api-contracts/contracts", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.CountInfoDto>> getContractsCount(@RequestHeader(name="X-USER-PROFILE-ID") String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Retrieve Contracts count.
      Parameters:
      userId - user id.
      authentication - user credentials.
      Returns:
      the contracts.
    • getContractsFiltered

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @PostMapping(path="/api-contracts/contracts", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<Object>> getContractsFiltered(@RequestParam(name="pageNumber",required=false) Integer pageNumber, @RequestParam(name="pageSize",required=false) Integer pageSize, @RequestParam(name="sortedBy",required=false,defaultValue="createDate DESC") String sortedBy, @RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId, @RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.GetApplicationsRequestDto getApplicationsRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Retrieve Contracts list with filters.
      Parameters:
      pageNumber - number of page to get.
      pageSize - size of list to return.
      sortedBy - sort param.
      userId - user id.
      getApplicationsRequestDto - body for filtering.
      authentication - user credentials.
      Returns:
      the contracts.
    • getContractDetail

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(path="/api-contracts/contracts/{contractId}", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<Object>> getContractDetail(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Retrieve Contracts Detail.
      Parameters:
      contractId - contract id.
      userId - user id.
      authentication - user credentials.
      Returns:
      the contracts.
    • uploadFiles

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @PostMapping(path="/api-contracts/contracts/{contractId}/upload-file", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> uploadFiles(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestPart("file") List<org.springframework.web.multipart.MultipartFile> files, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Upload files.
      Parameters:
      contractId - contract id.
      userId - user id.
      files - list of files received.
      authentication - user credentials.
      Returns:
      ok.
    • getApprovedContracts

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(path="/api-contracts/approved-contracts", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>> getApprovedContracts(@RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId)
      Retrieve Approved Contracts list.
      Parameters:
      userId - user id.
      Returns:
      the contracts.
    • getContractsAndCompanyInfo

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\')) or (hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_RESTRICTED\') or hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\')))") @GetMapping(path="/api-contracts/contract-company-info", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.clients.dto.ContractCompanyInfoDto>> getContractsAndCompanyInfo(@RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId)
      Retrieve Contracts and Company information for user.
      Parameters:
      userId - user id.
      Returns:
      the information.
    • updateContractAppointment

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @PutMapping(path="/api-contracts/contracts/{contractId}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> updateContractAppointment(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentDto appointmentDto)
      Update contract with appointment.
      Parameters:
      contractId - contract id.
      userId - user id.
      appointmentDto - appointment information.
      Returns:
      ok.
    • updateContractStatus

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PutMapping(path="/api-contracts/contracts/{contractId}/status", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> updateContractStatus(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.ContractStatusRequestDto contractStatusRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Change application status.
      Parameters:
      contractId - contract id.
      userId - user id.
      contractStatusRequestDto - list of files received.
      authentication - user credentials.
      Returns:
      ok.
    • updateContractDocumentStatus

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PutMapping(path="/api-contracts/contracts/document/{contractDocumentId}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> updateContractDocumentStatus(@PathVariable(name="contractDocumentId") String contractDocumentId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.UpdateContractDocumentRequestDto requestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Update contract document status.
      Parameters:
      contractDocumentId - contract document id.
      userId - user id.
      requestDto - Update contract document information.
      authentication - user credentials.
      Returns:
      ok.
    • updateContractDocumentStatus

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @PostMapping(path="/api-contracts/contracts/document/{contractDocumentId}", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> updateContractDocumentStatus(@PathVariable(name="contractDocumentId") String contractDocumentId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Save specific contract document file.
      Parameters:
      contractDocumentId - contract document id.
      userId - user id.
      file - file received.
      authentication - user credentials.
      Returns:
      contract updated.
    • getContractDocumentFile

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(path="/api-contracts/contracts/document/{contractDocumentId}") public void getContractDocumentFile(@PathVariable(name="contractDocumentId") String contractDocumentId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, javax.servlet.http.HttpServletResponse response) throws IOException
      Get contract document file.
      Parameters:
      contractDocumentId - contract document id.
      userId - user id.
      response - response.
      Throws:
      IOException - file to write response.
    • uploadSignedContractFile

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PutMapping(path="/api-contracts/contracts/{contractId}/sign-contract", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> uploadSignedContractFile(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Change application from PENDING_SIGNATURE (credit) or APPROVED (advance) to PAYMENT_PENDING (credit) and APPROVED_PAYMENT_PENDING (advance).
      Parameters:
      contractId - contract id.
      userId - user id.
      file - file received.
      authentication - user credentials.
      Returns:
      ok.
    • uploadPaymentProofFile

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PutMapping(path="/api-contracts/contracts/{contractId}/payment-proof", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>> uploadPaymentProofFile(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Change application from PAYMENT_PENDING (credit) or APPROVED_PAYMENT_PENDING_NAME (advance) to PAYED (advance) or ACTIVE (credit).
      Parameters:
      contractId - contract id.
      userId - user id.
      file - file received.
      authentication - user credentials.
      Returns:
      ok.
    • generateContractFile

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @GetMapping(path="/api-contracts/contracts/{contractId}/contract", produces="application/json") public void generateContractFile(@PathVariable(name="contractId") String contractId, @RequestHeader(name="X-USER-PROFILE-ID") String userId, javax.servlet.http.HttpServletResponse response) throws IOException
      Generate PDF contract for application PENDING_SIGNATURE (credit) or APPROVED (advance).
      Parameters:
      contractId - contract id.
      userId - user id.
      response - response.
      Throws:
      IOException - if response already sent.
    • changeAdvanceToPaymentReturn

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PutMapping(path="/api-contracts/contracts/advance/set-payment-return", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>> changeAdvanceToPaymentReturn(@RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.UpdateListOfContractsRequestDto updateListOfContractsRequestDto, @RequestHeader(name="X-USER-PROFILE-ID") String userId)
      Change a list of application identifier from APPROVED_PAYMENT_PENDING_NAME (advance) to PAYED (advance).
      Parameters:
      updateListOfContractsRequestDto - contract id list.
      userId - user id.
      Returns:
      ok.
    • changeCreditToActive

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PutMapping(path="/api-contracts/contracts/credit/set-active", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<List<es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.Contract>>> changeCreditToActive(@RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.core.contract.UpdateListOfContractsRequestDto updateListOfContractsRequestDto, @RequestHeader(name="X-USER-PROFILE-ID") String userId)
      Change a list of application identifier from PAYMENT_PENDING (credit) to ACTIVE (credit).
      Parameters:
      updateListOfContractsRequestDto - contract id list.
      userId - user id.
      Returns:
      ok.