コード例 #1
0
 private void BankLoanRateQuotedHandler(BankLoanRateQuoted message)
 {
     _logger.Info("LoanBroker received BankLoanRateQuoted message:\n{0}",
                  JsonConvert.SerializeObject(message));
     ProcessOf(message.LoanQuoteReferenceId).Tell(
         new RecordLoanRateQuote(message.BankId,
                                 message.BankLoanRateQuoteId,
                                 message.InterestRate));
 }
コード例 #2
0
        private void QuoteLoanRateHandler(QuoteLoanRate message)
        {
            _logger.Info("Bank: {0} recieved QuoteLoanRate message:\n{1}",
                         _bankId,
                         JsonConvert.SerializeObject(message));
            var interestRate =
                CalculateInterestRate(
                    (double)message.Amount,
                    (double)message.TermInMonths,
                    (double)message.CreditScore);
            var quoted =
                new BankLoanRateQuoted(
                    this._bankId,
                    this._randomQuoteId.Next(1000).ToString(),
                    message.LoadQuoteReferenceId,
                    message.TaxId,
                    interestRate);

            Sender.Tell(quoted);
        }