Feature: Implement discounted bundles for product combinations #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the requested bundle discount feature that allows customers to receive 10% off when purchasing all items in a product bundle.
What this PR does
This PR adds a new type of special offer - bundles - that provides discounts when customers buy complete sets of products together. When all items in a bundle are purchased, customers receive a 10% discount on the total price of those bundled items.
Key Features
Example Usage
Implementation Details
The solution introduces minimal changes while maintaining backward compatibility:
Bundleenum value toSpecialOfferTypeBundleandBundleOfferclasses for bundle data structuresTellerwithaddBundleOffer()methodhandleBundleOffers()method toShoppingCartfor discount calculationTest Coverage
All existing tests continue to pass, plus 5 new test cases covering:
The implementation exactly matches the requirements in the original Dutch issue: "Wanneer je alle items in een productbundel koopt, krijg je 10% korting op het totaalbedrag voor die items."
Fixes #19
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.