Problem statement
Design the object model and core APIs for composing configurable product bundles (kits, combos, build-your-own) from component products, validating a shopper's selection, and computing the bundle's price and availability, for a single catalogue.
Operating context. A bundle is made of slots: fixed components, choose-N-of-M option groups, quantity ranges, and optional add-ons, with cross-option compatibility constraints (choosing A forbids B, requires C). A slot may itself be filled by another bundle, so bundles nest. Building a bundle validates the proposed configuration against its slots and constraints, rolls up the price from the selected components (with a possible bundle-level discount), and derives availability from the components' stock. Configuration reads are heavy and concurrent, while stock is a shared resource behind a port. The whole thing is a single in-process component.
Out of scope. Checkout and payment, the inventory system of record (place it behind a stock port), the 3D/AR configurator UI, and persistence.
What to produce. The class hierarchy (Bundle, Slot/OptionGroup, Component, Constraint, Configuration, the pricer, and the service facade), the public API each exposes, and the flows for validation, price roll-up, and availability roll-up. Be explicit about: how nesting is handled by composition, how a new compatibility constraint is added without editing the validator, and how an invalid configuration is rejected before it can be priced.
Requirements
The requirements come with Premium
PremiumThe statement above is free to read.