https://github.com/dcoxall/marketplace
https://github.com/dcoxall/marketplace
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcoxall/marketplace
- Owner: dcoxall
- Created: 2016-10-06T21:31:41.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-06T22:17:30.000Z (over 9 years ago)
- Last Synced: 2026-01-26T13:28:58.671Z (5 months ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Marketplace
===========
Developed to demonstrate a way to approach a promotions engine in Ruby. This project demonstrates
the use of ruby duck typing to support multiple types of promotions whilst also using `BigDecimal`
and `Rational` to handle more complex arithmetic (requiring better precision and rounding
capabilities).
Development
-----------
To execute the test suite simply run
$ bin/rspec -c
Considerations
--------------
If I spent more time on this I would like to make a `ProductCatalog` that allows other classes to
query the entire range of available products. This would then remove the need to have the `Cart`
fetch product data on behalf of the promotions.
The cart should probably track the applied promotions for receipts as well as then supporting
promotions that can only be supplied with no other promotion.