Shopping cart

It is a partial implementation of a shopping till system, which you might find at a supermarket. This implementation was done by a Junior developer, you as a Senior Software Engineer have been requested to refactor this project. You may make any technical decisions you would like, but must not change the given abstract class (abc.ShoppingCart) which is used by the shopping till hardware and cannot be easily updated. Please treat this code as an element of a larger production system. The code is being refactored to ensure reliability and testability.

Tasks requested:

  • Make the receipt print items in the order that they were added
  • Add a 'Total' line to the receipt. This should be the full price we should charge the customer
  • Be able to fetch product prices from an external source (json file, database ...)
  • Be able to display the product prices in different currencies (not only Euro).
  • Update the test suite to extend coverage and limit the number of tests which need changing when changes are introduced
  • Any other changes which improve the reliability of this code in production

If you do not have enough information, make any assumptions you would like and note them down with TODO comments. Feel free to make comments that highlight completion of the tasks listed above.

Please budget 3 hours to complete, and your code should be production ready, clean and tested! Please ensure the code is version controlled also, and make sure to make several commits with sensile commit messages while working on this. When submitting please either: