Java Assignment for Fidelity High Income group
a Java REST service that will consume a collection of trade orders, and perform some asynchronous order summary analysis on them.
- API to add trades (POST)
- API to fetch summary of all trades (GET)
- API to fetch summary based on specific security (GET)
- API to fetch summary based on specific fund (GET)
- order summary analysis done asynchronously, at a pre-defined interval of 1 minute.
- API to fetch all the trades (GET)
- API to fetch tades based on specific security (GET)
- API to fetch tades based on specific fund (GET)
An order contains the following fields which has to be sent during a POST
call.
- order id (optional)
- side (buy or sell) (required)
- security (required)
- fund name (required)
- quantity (required)
- price (required)
https://fid-trade.herokuapp.com/
The REST service should provide a number of endpoints, as follows:
POST api/trade
@required body (example) :
{ "side":"BUY", "security":"AAPL", "fundName":"MAG", "quantity":2000, "price":100}
consume a trade order which will be stored in memory (not in a database)
GET api/summary
returns total number of orders, with the total quantity and average price. It should also return the total number of combinable orders
GET api/summary/security/{securityName}
@required path variable (example) :
AAPL
returns total number of orders, with the total quantity and average price of that specific security
GET api/summary/fund/{fundName}
@required path variable (example) :
MAG
returns total number of orders, with the total quantity and average price of that specific fund
GET api/trades
returns list of all the trades
GET api/trades/security/{securityName}
@required path variable (example) :
AAPL
returns list of all the trades for that specific security
GET api/trades/fund/{fundName}
@required path variable (example) :
MAG
returns list of all the trades for that specific fund
-
Install STS or Eclipse for running the server
-
Open Terminal/ Command Prompt and type in the following command
git clone https://github.com/sougatadafader/Fidelity.git
-
Open the Fidelity inside the STS or Eclipse application
-
Find the port inside the application.properties file. Change the port based on your suitability.
example:
server.port = 9000
-
Update the client services to point the updated port.
If you successfully followed the instructions, you're now ready for taking off! ๐