On an e-commerce shop, during the checkout process you need to calculate the shipping costs, based on various information.
You work for a shipping company.
You receive a big message with plenty of data for one order from the online shop, and you must return the calculated shipping cost.
We gonna focus on the domain module that does the calculation.
We'll develop the code using modern software development techniques, e.g. TDD.
-
Fast: EUR 1.99 per shipment; Free from EUR 15
-
Priority: 7.99 EUR per shipment (only for books, CD, DVD, Blue-Rays)
-
1 day delivery: 7.99 EUR per shipment (This option is not available for the following postcodes: 17111; 17123; 17410; 17580; 17590; 17630 ; 17670 ; 17740; 17880; 17940; 29242; 29252; 29259; 29240; 50116; 56360; 56590; 56170; 56780; 56840; 83140; 83150; 83400; 85350)
-
"Free shipping" special offer: free shipping for every item eligible for "Free shipping"
-
Large items (any dimension over 30cm): 19.90 EUR
-
Kitchen, House, High-Tech, Computer & Office : 39.90 EUR
-
Games & Toys : 14,90 EUR
-
Sports & Leisure : 19.90 EUR
- Fast: EUR 9.00 EUR 1.90 / item
- Ultrafast: EUR 20.00 EUR 4.00 per kg
- Fast: EUR 3.90 + EUR 1.50 per kg Video games
- Ultrafast: EUR 9.90 + EUR 3.90 per kg
Always separate shipping
- Shipping address must be in France Métropolitaine / Monaco, excluded the following postcodes (17111; 17123; 17410; 17580; 17590; 17630 ; 17670 ; 17740; 17880; 17940; 29242; 29252; 29259; 29240; 50116; 56360; 56590; 56170; 56780; 56840; 83140; 83150; 83400; 85350) and post boxes
- Regular shipping cost
Shipping Method, Cost Per Shipment, Cost Per Item, Cost Per kg
Given an order with a book at 13.90 EUR and a dvd at 9.90 EUR
when I select the fast shipping method
then the shipping cost is 3.98