Class StockViewCLI
java.lang.Object
com.truebubo.maniflow.stock.StockViewCLI
CLI Frontend for stock portion of the application
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Buys the stock with given infovoid
Sells the stock with given infovoid
Displays the list of all the expenses for the user
-
Constructor Details
-
StockViewCLI
Created CLI frontend for stocks- Parameters:
stockService
- Service for stocks
-
-
Method Details
-
showOwnedStocks
public void showOwnedStocks()Displays the list of all the expenses for the user -
buyStock
public void buyStock(@NonNull Stock stock) throws StockNotFoundException, NotEnoughMoneyToBuyException Buys the stock with given info- Parameters:
stock
- Stock bought- Throws:
StockNotFoundException
- If stock was not found by APINotEnoughMoneyToBuyException
-
sellStock
public void sellStock(@NonNull Stock stock) throws StockNotFoundException, TooFewStocksOwnedException Sells the stock with given info- Parameters:
stock
- Stock sold- Throws:
StockNotFoundException
- If stock was not found by APITooFewStocksOwnedException
- If wanted to sell more than owned
-