Exemplo n.º 1
0
		public static CatalogPromotionBuilder BuildCartPromotion()
		{
			var catalogPromotion = new CatalogPromotion()
			{
				Name = "default",
				Description = "default_Description",
				Priority = 5,
				Status = PromotionStatus.Active.ToString(),
				StartDate = DateTime.Now.Date.AddDays(-5),
				EndDate = DateTime.Now.Date.AddDays(5)
			};

			return new CatalogPromotionBuilder(catalogPromotion);
		}
Exemplo n.º 2
0
		private CatalogPromotionBuilder(CatalogPromotion catalogPromotion)
		{
			_catalogPromotion = catalogPromotion;
		}
		private Promotion AddCatalogPromotion(string catalogId, string expression, string promotionName = "test")
		{
			var promotion = new CatalogPromotion
				{
					Name = promotionName,
					CatalogId = catalogId,
					PredicateSerialized = expression,
					Status = "Active",
					StartDate = DateTime.UtcNow,
					
				};

			MarketingRepository.Add(promotion);
			MarketingRepository.UnitOfWork.Commit();

			return promotion;
		}