App built using Clean Architecture principles: https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html
Build and test:
mvn clean install
To execute:
java -jar target/fashion-store-cart-1.jar AnatwineBasket Jacket Trousers Tie
JulianoelinsMBP:fashion-store-cart juliano.cervelin$ java -jar target/fashion-store-cart-1.jar AnatwineBasket Jacket Trousers Tie
___ .__ __. ___ .___________.____ __ ____ __ .__ __. _______
/ \ | \ | | / \ | |\ \ / \ / / | | | \ | | | ____|
/ ^ \ | \| | / ^ \ `---| |----` \ \/ \/ / | | | \| | | |__
/ /_\ \ | . ` | / /_\ \ | | \ / | | | . ` | | __|
/ _____ \ | |\ | / _____ \ | | \ /\ / | | | |\ | | |____
/__/ \__\ |__| \__| /__/ \__\ |__| \__/ \__/ |__| |__| \__| |_______|
2018-08-26 19:15:59.164 INFO 14641 --- [ main] i.j.f.cart.FashionStoreCartApplication : Starting FashionStoreCartApplication v1 on JulianoelinsMBP with PID 14641 (/Users/juliano.cervelin/fashion-store-cart/target/fashion-store-cart-1.jar started by juliano.cervelin in /Users/juliano.cervelin/fashion-store-cart)
2018-08-26 19:15:59.170 INFO 14641 --- [ main] i.j.f.cart.FashionStoreCartApplication : No active profile set, falling back to default profiles: default
2018-08-26 19:16:00.467 INFO 14641 --- [ main] d.f.embed.process.runtime.Executable : start de.flapdoodle.embed.mongo.config.MongodConfigBuilder$ImmutableMongodConfig@25bbf683
2018-08-26 19:16:01.794 INFO 14641 --- [ main] i.j.f.cart.FashionStoreCartApplication : Started FashionStoreCartApplication in 3.039 seconds (JVM running for 3.627)
Subtotal: £94,90
Trousers 10% off: -£3,55
Total: £91,35
To add a new Campaign with different business rules: All you need to do is create a class and implement with the interface Campaign and Create a document CampaignAttributes for it
To add a new Campaign with the same business rules, but with different goods or values: All you need to do is add a new document in MongoDB. No change in code is required.