/** * Sets the KYC process completion in the database entry for the specified investor * @param investorId The id of the investor * @param isKycComplete * @return The KYC info that was changed * @throws InvestorNotFoundException if the investor does not exist in the database */ @Transactional public KycInfo setKycComplete(long investorId, boolean isKycComplete) throws InvestorNotFoundException { Optional<KycInfo> kycInfoFromDb = kycInfoRepository.findOptionalByInvestorId(investorId); if(kycInfoFromDb.isPresent()) { KycInfo kycInfo = kycInfoFromDb.get().setKycComplete(isKycComplete); kycInfoFromDb = Optional.of(kycInfoRepository.save(kycInfo)); } return kycInfoFromDb.orElseThrow(InvestorNotFoundException::new); }
/** * Sets the KYC process completion in the database entry for the specified investor * @param uuid UUID of the investor * @param isKycComplete * @return The KYC info that was changed * @throws InvestorNotFoundException if the investor does not exist in the database */ @Transactional public KycInfo setKycCompleteByUuid(UUID uuid, boolean isKycComplete) throws InvestorNotFoundException { Optional<KycInfo> kycInfoFromDb = kycInfoRepository.findOptionalByKycUuid(uuid); if(kycInfoFromDb.isPresent()) { KycInfo kycInfo = kycInfoFromDb.get().setKycComplete(isKycComplete); kycInfoFromDb = Optional.of(kycInfoRepository.save(kycInfo)); } return kycInfoFromDb.orElseThrow(InvestorNotFoundException::new); }