Dynamics Retail Discount Interface – IDiscountUsingMarginalValueRanking


We have talked about marginal value ranking algorithm as a backup plan for dynamic programming best deal algorithm. IDiscountUsingMarginalValueRanking is the interface that the discount needs to implement.

        public interface IDiscountUsingMarginalValueRanking
        {
            /// <summary>
            /// Gets the discount deal estimate.
            /// </summary>
            /// <param name="discountableItemGroups">The valid sales line items on the transaction to consider.</param>
            /// <param name="remainingQuantities">The remaining quantities of each of the sales lines to consider.</param>
            /// <param name="appliedDiscountApplications">Applied discount applications.</param>
            /// <param name="itemsWithOverlappingDiscounts">Items with overlapping discounts.</param>
            /// <param name="itemsWithOverlappingDiscountsCompoundedOnly">Hash set of overlapped item group indices, compounded only.</param>
            /// <param name="priceContext">Price Context.</param>
            /// <returns>Discount deal estimate.</returns>
            DiscountDealEstimate GetDiscountDealEstimate(
                DiscountableItemGroup[] discountableItemGroups,
                decimal[] remainingQuantities,
                List<AppliedDiscountApplication> appliedDiscountApplications,
                HashSet<int> itemsWithOverlappingDiscounts,
                HashSet<int> itemsWithOverlappingDiscountsCompoundedOnly,
                PriceContext priceContext);
            /// <summary>
            /// Get discount application multiples fast.
            /// </summary>
            /// <param name="discountableItemGroups">Discountable item groups.</param>
            /// <param name="remainingQuantities">Remaining quantities.</param>
            /// <param name="appliedDiscountApplications">Applied discount applications.</param>
            /// <param name="priceContext">Price context.</param>
            /// <returns>A collection of discount application multiples.</returns>
            List<DiscountApplicationMultiple> GetDiscountApplicationMultiplesFastMode(
                DiscountableItemGroup[] discountableItemGroups,
                decimal[] remainingQuantities,
                List<AppliedDiscountApplication> appliedDiscountApplications,
                PriceContext priceContext);
        }

Related: Retail Discount Knapsack – Marginal Value Ranking Algorithm I

Related: Dynamics Retail Discount Concepts: Discount Deal Estimate

Related: Dynamics Retail Discount Concepts: Discountable Item Group

Related: Dynamics Retail Discount Concepts: Discount Application I

Comments (0)

Skip to main content