Esempio n. 1
0
        Product IPricer.DoPrice(ProductSpec product, IEnumerable <CompetitorProduct> compProducts)
        {
            var cpgInFrequentOrder = compProducts.GroupBy(cp => cp.Price)
                                     .OrderByDescending(cpg => cpg.Count())
                                     .ThenBy(cpg => cpg.Key)
                                     .FirstOrDefault();

            return(new Product(product, cpgInFrequentOrder == null? CompetitivePricer.PriceReplacementIfPriceNotFound : cpgInFrequentOrder.Key));
        }
Esempio n. 2
0
        public override Product DoPrice(ProductSpec product, IEnumerable <CompetitorProduct> compProducts)
        {
            var filtered = compProducts.Where(cp =>
                                              cp.Price <GetAvgPricePlus50PercentageOfAverage(compProducts)
                                                        &&
                                                        cp.Price> GetAvgPriceMinus50PercentageOfAverage(compProducts));

            return(base.DoPrice(product, filtered));
        }
Esempio n. 3
0
        public override Product DoPrice(ProductSpec productSpec, IEnumerable <CompetitorProduct> compProducts)
        {
            Product product = base.DoPrice(productSpec, compProducts);

            if (productSpec.Demand == SupplyDemandIndicator.High && productSpec.Supply == SupplyDemandIndicator.Low)
            {
                return(new Product(productSpec, product.Price + (product.Price * SupplyLowDemandHighDecorator.PercentageToAdd / 100)));
            }
            else
            {
                return(product);
            }
        }
Esempio n. 4
0
 public virtual Product DoPrice(ProductSpec product, IEnumerable <CompetitorProduct> compProducts)
 {
     return(pricer.DoPrice(product, compProducts));
 }
Esempio n. 5
0
        public override Product DoPrice(ProductSpec product, IEnumerable <CompetitorProduct> compProducts)
        {
            var filtered = compProducts.Where(cp => cp.Price > compProducts.Average(cpForAverage => cpForAverage.Price) / 2);

            return(base.DoPrice(product, filtered));
        }
Esempio n. 6
0
 public Product(ProductSpec spec, double price)
 {
     this.Spec  = spec;
     this.Price = price;
 }