コード例 #1
0
        /// <summary>
        /// Get the solution for this case
        /// </summary>
        /// <param name="solutionId"></param>
        /// <returns></returns>
        Solution ICaseRepository.GetSolution(Guid solutionId)
        {
            var hpSolution = new Guid("1F86D309-EAE1-47CD-BE03-1064E3CC5AE8");
              var btlSolution = new Guid("2386D309-EAE1-47CD-BE03-1064E3CC5AE8");
              var rateSwitchSolution = new Guid("4486D309-EAE1-47CD-BE03-1064E3CC5AE8");

              MortgageRequirement requirement = null;

              if (solutionId == hpSolution)
              {
            // we would go to a database and get all these, ensuring user and the owner match
            requirement = new HousePurchaseRequirement(Guid.NewGuid(), 250000, 90, 400000, false,
                                                   DateTime.Now.AddDays(-45));
              }
              else if (solutionId == btlSolution)
              {
            requirement = new BuyToLetRequirement(Guid.NewGuid(), 1000, DateTime.Now.AddDays(-3));
              }
              else if (solutionId == rateSwitchSolution)
              {
            requirement = new RateSwitchRequirement(Guid.NewGuid(), "122222", DateTime.Now.AddDays(-5));
              }

              var product = _ProductService.GetProductDetails(Guid.NewGuid());

              var productList = new List<Product> { product };

              var solution = new MortgageSolution(productList, requirement);

              return solution;
        }
コード例 #2
0
        public List<ProductSummary> ListSuitableProduct(HousePurchaseRequirement requirement)
        {
            var summaries = new List<ProductSummary>();

            for (int x = 0; x < 10; x++) {
              var productSummary = new MortgageProductSummary((x % 2) == 0, x, Guid.NewGuid(), string.Format("Name {0}", x),
                                                          string.Format("Description for house purchase product {0}", x));
              summaries.Add(productSummary);
            }

            return summaries;
        }
コード例 #3
0
        List<ProductSummary> IMortgageProductService.ListSuitableProduct(HousePurchaseRequirement requirement)
        {
            var unseenRequirement = (UnseenMortgageRequirement)requirement;

            var summaries = new List<ProductSummary>();

            for (int x = 0; x < 10; x++) {
              var productSummary = new MortgageProductSummary((x % 2) == 0, x, Guid.NewGuid(), string.Format("ShoeSize {0}", unseenRequirement.ShoeSize),
                                                          string.Format("Description for product {0}", x));
              summaries.Add(productSummary);
            }

            return summaries;
        }
コード例 #4
0
        /// <summary>
        /// this needs to change to create the correct items based on the information passed in, implies we need a type on the dto
        /// </summary>
        /// <param name="dtoRequirement"></param>
        /// <returns></returns>
        Requirement IAdaptor.AdaptRequirement(RequirementDto dtoRequirement)
        {
            var mortgageRequirementDto = (MortgageRequirementDto)dtoRequirement;

              var requirement = new HousePurchaseRequirement( mortgageRequirementDto.Id, mortgageRequirementDto.LoanAmount, mortgageRequirementDto.TermInMonths,
                                                      mortgageRequirementDto.PurchasePrice, mortgageRequirementDto.Recommended,
                                                      mortgageRequirementDto.CreatedDate,_productService);

              return requirement;
        }
コード例 #5
0
        /// <summary>
        /// Return a requirement based on HP
        /// </summary>
        /// <param name="domainRequirement"></param>
        /// <returns></returns>
        RequirementDto IMortgageAdaptor.AdaptRequirement(HousePurchaseRequirement domainRequirement)
        {
            var mortgageRequirement = domainRequirement;

              var dtoRequirement = new MortgageRequirementDto(mortgageRequirement.Id, mortgageRequirement.LoanAmount, mortgageRequirement.TermInMonths,
                                                      mortgageRequirement.PurchasePrice, mortgageRequirement.Recommended,
                                                      mortgageRequirement.CreatedDate);

              return dtoRequirement;
        }