if(!alreadySentList.contains(investor.getId())) { if(paymentLogService.hasInvestorInvested(investor.getId())) { StartSingleKycResponseDTO initiateResponse = initiateKyc(investor.getId(), null); if (initiateResponse.getIsSuccess()) { kycStartedList.add(investor.getId()); } else { LOG.error("Error while initiating KYC for investor {}", investor.getId()); errorList.add(investor.getId());
@RabbitListener( bindings = @QueueBinding(value = @Queue(value = KYC_REMINDER_EMAIL_SENT_QUEUE, autoDelete = "false"), exchange = @Exchange( value = ICONATOR_ENTRY_EXCHANGE, type = ExchangeTypes.TOPIC, ignoreDeclarationExceptions = "true", durable = "true" ), key = KYC_REMINDER_EMAIL_SENT_ROUTING_KEY) ) public void receiveMessage(KycReminderEmailSentMessage message) { try { long investorId = investorService.getInvestorByEmail(message.getEmailAddress()).getId(); kycInfoService.increaseNumberOfRemindersSent(investorId); LOG.debug("Increased numberOfRemindersSent for investor with ID {} by 1", investorId); } catch (InvestorNotFoundException e) { LOG.error("Investor with address {} not found", message.getEmailAddress()); } }
@RabbitListener( bindings = @QueueBinding(value = @Queue(value = KYC_START_EMAIL_SENT_QUEUE, autoDelete = "false"), exchange = @Exchange( value = ICONATOR_ENTRY_EXCHANGE, type = ExchangeTypes.TOPIC, ignoreDeclarationExceptions = "true", durable = "true" ), key = KYC_START_EMAIL_SENT_ROUTING_KEY) ) public void receiveMessage(KycStartEmailSentMessage message) { try { long investorId = investorService.getInvestorByEmail(message.getEmailAddress()).getId(); kycInfoService.setKycStartEmailSent(investorId); LOG.debug("Set kycStartEmailSent for investor with ID {} to true", investorId); } catch (InvestorNotFoundException e) { LOG.error("Investor with address {} not found", message.getEmailAddress()); } }
@Test public void testGetInvestorByInvestorId() { try { Investor investorFromDb = investorService.getInvestorByInvestorId(investor.getId()); assertEquals(investor, investorFromDb); } catch(InvestorNotFoundException e) { fail(e.getMessage()); } }