https://github.com/dmarrazzo/dmn-multiple-products
Multiple products DMN Project for Red Hat Decision Manager
https://github.com/dmarrazzo/dmn-multiple-products
Last synced: 3 months ago
JSON representation
Multiple products DMN Project for Red Hat Decision Manager
- Host: GitHub
- URL: https://github.com/dmarrazzo/dmn-multiple-products
- Owner: dmarrazzo
- Created: 2020-01-14T10:44:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T18:50:20.000Z (over 4 years ago)
- Last Synced: 2025-01-22T20:51:19.340Z (5 months ago)
- Language: Java
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Multiple Products DMN project
=============================## Scenario
Each product has its own configuration parameters which are used to calculate a list of Price Point objects.
A customer can add multiple products to their basket.If there are mulitple products in the basket, we want to return one set of Price Points for the entire basket.
There is a heirarchy within the products which we want to define in order to determine which product's configuration to use.There are two categories of Products defined below:
CORE PRODUCTS hierarchy:
1) Product A
2) Product B
3) Product C
4) Product DANCILLARY PRODUCTS hierarchy:
Product E, Product F, Product G
The heirarchy for Ancillary Products is based on the product’s cost, from largest to smallest.
Core Products will always take priority over Ancillary Products, and are regardless of the price.
### Example scenarios
Basket: Product A, Product B
Result: Use configuration from Product A
----------------------------------------
Basket: Product B, Product D
Result: Use configuration from Product B
----------------------------------------
Basket: Product D, Product E (price: £20)
Result: Use configuration from Product D
----------------------------------------
Basket: Product E (price: £5), Product F (price: £10), Product G (price: £20)
Result: Use configuration from Product G
----------------------------------------
Basket: Product B, Product D
Result: Use configuration from Product B
------------------------------------
## Point calculation logic:
1) Identify the priority product in the basket
2) Take the configuration from that product and loop through logic to calculate the Price Points for each product in the basket
3) Sum all Price Points for each product and return one set of Price Points