public void OnReceive(RecordLoanRateQuote message) { var bankLoanRateQuote = new BankLoanRateQuote( message.BankId, message.BankLoanRateQuoteId, message.InterestRate); bankLoanRateQuotes.Add(bankLoanRateQuote); loanBroker.Tell( new LoanRateQuoteRecorded( loanRateQuoteId, taxId, bankLoanRateQuote), Self); if (bankLoanRateQuotes.Count >= expectedLoanRateQuotes) { loanBroker.Tell( new LoanRateBestQuoteFilled( loanRateQuoteId, taxId, amount, termInMonths, creditRatingScore, BestBankLoanRateQuote()), Self); } }
public LoanRateQuoteRecorded( string loanRateQuoteId, string taxId, BankLoanRateQuote bankLoanRateQuote) { this.LoanRateQuoteId = loanRateQuoteId; this.TaxId = taxId; this.BankLoanRateQuote = BankLoanRateQuote; }
public LoanRateBestQuoteFilled( string loanRateQuoteId, string taxId, int amount, int termInMonths, int creditScore, BankLoanRateQuote bestBankLoanRateQuote) { this.LoanRateQuoteId = loanRateQuoteId; this.TaxId = taxId; this.Amount = amount; this.TermInMonths = termInMonths; this.CreditScore = creditScore; this.BestBankLoanRateQuote = bestBankLoanRateQuote; }