#Brokerage App - Requirements
- Your brokerage can have many clients
- A client can have many stocks
- Many clients can have the same stocks so you need to know everyone's holdings (e.g. Bob owns 15 Google Stocks but Joe owns 23 of them)
Create the usual Rails app for your brokerage - You will be acting as the brokerage manager, not as a client logging on the site
-
The homepage lists all the clients
-
Click on a client to show all their stock, their market value and the client's cash balance
-
A client can buy stocks at market rate; these stocks will be added to the client's holdings and the purchase amount subtracted from the cash balance.
-
Add checks and/or validations so that you cannot go to a negative cash balance
-
Consider creating methods in your models so that the controller can access them
-
A client can sell a stock. The proceeds go into his account and the stock is removed from the client's holdings
-
If you feel like it, add the possibility to create a new stock which is not in your seed data
##You need to create the following classes:
- name
- clients (through associations)
- name
- cash balance
- stocks (through associations)
- no_of_shares
- stock_name
- share_price (Here are is link to some stock prices to reference: http://www.eoddata.com/stockList/NASDAQ.htm)
Example Seed Data
- Available stocks: AAPL, GOOG, AMZN, US Bank, TD Bank, BofA, GE, SolarWinds, GreenEnergie
####Add portfolios to your brokerage. You can decide on how to organise the app, here is a suggestion
-
Portfolios are generated at the brokerage level
-
A client can have many portfolios (e.g. US portfolio, Tech portfolio, Financial sector portfolio, Green portfolio, etc)
-
A portfolio is made of one or more stocks
-
A stock can be present in many portfolios (e.g. Google can be present in the Tech portfolio as well as the US portfolio)
-
Many clients can have the same portfolio (e.g. you and I want to have exposure to Tech)
-
The homepage also has a link to list all your portfolios. From the portfolio page you can create a new portfolio for your brokerage, or add stocks to an existing portfolio
-
Depending on how you build it you might have to change your app so that clients do not buy/sell stocks anymore but they buy/sell units of a portfolio.