Open sko-grace opened 7 months ago
PurchaseStock
Requirements: userid, symbolName, numStocks)
Should do the following:
Determine if user exists and get their current liquidity
Call Finnhub to get current value of stock
Calculate value of current stock * num of shares the user wants to buy
Check available liquidity versus cost of purchase
Complete purchase if enough liquidity
Return liquidity after purchase with status code
SellStock
Requirements: userid, symbolName, numStocks)
Should do the following:
Determine if user exists and get their current liquidity
Call Finnhub to get current value of stock
Calculate value of current stock * num of shares the user wants to sell
Check that numStocks selling does not surpass current num owned
Complete purchase if enough shares owned
Return liquidity after sale with status code
User story: As a user, I should be able to sell and purchase stocks given my current liquidity and portfolio.
Acceptance criteria: Purchase and Sell modals created that have functionality to alter a user's portfolio within the constraints of how much they have available to purchase or sell.