Exemplo n.º 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;
        }
        List<ProductSummary> IMortgageProductService.ListSuitableProduct(RateSwitchRequirement 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}", requirement.AccountToSwitch),
                                                          string.Format("Description for product {0}", x));
              summaries.Add(productSummary);
            }

            return summaries;
        }
        public List<ProductSummary> ListSuitableProduct(RateSwitchRequirement 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 rate switch product {0}", x));
              summaries.Add(productSummary);
            }

            return summaries;
        }
        /// <summary>
        /// return a requirement based on a rate switch
        /// </summary>
        /// <param name="domainRequirement"></param>
        /// <returns></returns>
        RequirementDto IMortgageAdaptor.AdaptRequirement(RateSwitchRequirement domainRequirement)
        {
            var mortgageRequirement = domainRequirement;

              var dtoRequirement = new MortgageRequirementDto(mortgageRequirement.AccountToSwitch, mortgageRequirement.Id, mortgageRequirement.CreatedDate);

              return dtoRequirement;
        }