You are given an existing small script for an Order Management System.
The application currently allows:
- Creating orders
- Sending confirmation emails
The code needs to be refactored for several reasons.
Your task is to fix, improve and extend it. It's not too big, but try to showcase as much as possible, paying attention to what is important to you.
- PHP (any recent version)
- Laravel (any recent version)
- MySQL (any recent version)
- Define the architecture / structure
- Pay attention to performance
- Pay attention to scalability
- Add new features:
- Add a console command that allows creating new customers
- Allow orders for existing (premium) customers or guests (identified by email)
- If total order-price > 100 -> 10% discount
- If customer is premium -> extra 5% discount
- Max discount = 20%
- Must be extensible for future discount rules
- Add tests
- Implement a simple looking ordering form, so that orders can be placed.
- Add a Readme file