This is a fictional Stock Trading API project.
The project currently supports creating an account (with some less than perfect code).
You'll be adding support for making trades, and doing some light refactoring work on the existing code.
For the purposes of this exercise, a trade represents the Buying or Selling of a Stock. A trade includes the following properties:
- symbol (e.g. 'AAPL' for Apple)
- quantity
- side (buy or sell)
- price
- status (SUBMITTED, CANCELLED, COMPLETED, or FAILED)
Make sure to write tests (JUnit 5 or Spock). Create a branch for the following:
- Design the table(s) to store trades made for an account
- Create the associated flyway migrations.
- Create a ReSTful API that
- Submits a new trade.
- Quantity & price must be > 0
- Reads existing trades.
- Cancels a trade that's still in a SUBMITTED status.
- Submits a new trade.
- Refactor any poorly structured code you find in the Account related code.
- Fix the error handling so that the API doesn't return any 5xx responses.
./gradlew clean build
./gradlew bootRun
Please clone the repository and create a private repository on your own account. Then, create a new branch and submit a Pull Request with your proposed solution. Make sure to add and request review on the PR of the following github users:
- @ross-labardee
- @miguelcdpmarques
We'll be looking at the following criteria when assessing candidate submissions:
- Project architecture
- Code simplicity and clarity
- Git history, including comments in the PR
Good luck!