public List <InsuranceQuoteViewModel> GetInsuranceQuotes(InsuranceQuoteRequest request) { // Get the quotes from all insurance companies as per given criteria // Solution can vary from simple configuration table to complex underwriting algorithms throw new NotImplementedException(); }
public IActionResult Quotes(int loanId, float coverageRequired) { // Get loan details using loanId. Can consider saving this in session for better performance // If required, we can validate that coverageRequired > Loan.RemainingAmount var loan = new InsuranceLoanViewModel(); var request = new InsuranceQuoteRequest { Area = loan.Property.Area, CoverageRequired = coverageRequired, PropertyType = loan.Property.PropertyType, ZipCode = loan.Property.ZipCode }; List <InsuranceQuoteViewModel> quotes = _insuranceService.GetInsuranceQuotes(request); // Show list of quotes along with select button // Select button should redirect to BuyInsurance action with necessary parameters return(View(quotes)); }