awesominat / stonks Goto Github PK
View Code? Open in Web Editor NEWThe ideal investment platform
The ideal investment platform
see #92
tl:dr I originally misspelled _ViewModel and wrote _View (auto completion).
if you were to pass any controller through to the View, you'd need to first create the Interactor, but you can't create the interaction without the presenter, but you can't create the presenter without the View, but you can't create the View without the controller, but you can't ...
I noticed we are still hanging on to the old signup/login feature as we are still saving usernames in views and use cases. we need to get rid of them
Fix the implementation for dashboard view buttons so that they actually switch view properly. Thus, we also need to add the various views models to the attributes and constructor parameters. Finally, we can remove the quit button.,
This component would be responsible for rendering the views, handling user interactions, and ensuring that the UI is in sync with the data from the View Model and the entities.
should be thrown every time the API is called on a non-existent ticker
when a user searches a stock, I think it is very good to show the user how much of the stock they already own.
how to do it:
Hashmap<String, Double>
for any file that doesn't have Javadoc, we should open PRs with the intention of documenting our code for future clarity.
Create and Implement the Presenter, DashboardState and DashboardOutputBoundary such that the necessary data is relayed to the view (the user's stats and the stocks currently owned).
contents:
not all of them should be created at once. PRs created to resolve this issue can tackle one of the contents, not necessarily all. however, the readme is an important part of the project
the dashboard use case should:
on execution, pass the user's:
see #63
currently the file needs methods extracted so it looks cleaner as it doesn't look the best right now, but this is sufficient for purposes of getting the program working
completed by #110
in the PR, you can find the specifications
in a list format, allow the user to get a certain company's information (maybe cap it at 5 stories sorted by newest for now)
a possible design pattern we could implement is to build the CompanyInformation instead of passing all the arguments in at once.
This will allow us to input as many arguments as we want without creating at most 6 constructors.
However, now that our code has been developed further, I see that we don't have a case where we'd pass in less than 6 arguments.
As such, I am willing to close this issue.
Add to DashboardView the two following features:
currently, login was altered to allow one user instead of being completely removed.
as a result of this issue,
Allow the user to create a User with their username and password, and save it locally to a file called users.csv
Create the interface to allow for getting, saving, checking if a username exists
Create the skeleton for in memory data access for future tests.
Allow the user to input a username and a password that is cross-checked with the users in users.csv
Usernames are the unique identifier.
After signing up, the user should be transferred to their dashboard view
If the password is incorrect or the username doesn't exist, prompt an error.
Allow the user to input a username and a password to later have an account stored in user.csv
Usernames are the unique identifier.
Default values should be given upon signing up found in the default User constructor / User factory
After signing up, the user should be transferred to the dashboard view
Login is not an essential feature and is too much of a headache.
This use case gives the user the option to reset their balance back to the initial $10,000 given that their current balance is less than $500. If the user has more than $500, then a Fail View should pop up with a message along the line of "You have too much money." If there is a successful reset of the balance, then this should be noted in the user's history.
Performs the following:
ResetBalanceInputData
Class should have an input of the user's username. (This is the type the controller wraps the User Input data in)ResetBalanceInteractor
(which implements the ResetBalanceInputBoundary
) should have an execute method with an input of the type ResetBalanceInputData
.ResetBalancePresenter
with the current way the data access objects are created, only the user's username and password are saved, so their portfolio, user history, and balance are discarded.
Performs the following functions:
SellController
.SellController
creates a SellInputData
object to bundle together this information and pass to an object that implements the SellInputBoundary
.SellInteractor
class implemented the SellInputBoundary
and handles communication with the API drivers and data access objects. It bundles together the output data in a SellOutputData
. It also instantiates an object that implements SellOutputBoundary
and passes the output data to it.SellPresenter
implements the SellOutputBoundary
, taking the SellOutputData
and updating the SellState
.Mimic the approach Gursi took in SellView to handle invalid inputs. Handle error at the View/ViewState level but also pass it down to the controller and the interactor and the input data so that it can be passed out to the prepare fail view.
implement the necessary enterprise business rules by creating the following entities,
enum OrderType
BUY,
SELL,
TOPUP
Transaction:
Public int amountBought
Public int identifier
Public OrderType orderType
Public LocalDate timeBought
Public double priceBought
Public Double priceSold
PricePoint:
Public LocalDate timeStamp
Public Double price
Stock:
Public Double lastSeenPrice
Public List priceHistory
Public String fullName
Public String ticker
TransactionHistory:
Public Stock stock
Public List transactions
User:
private TransactionHistory[] portfolio
Private String username
Private String password
private Hashmap<String, TransactionHistory> history
Private Double balance = 10000.0
any issues that come throughout the project might warrant entities to change to fit the changing specification. but for now, these entities work fine
we currently rely on Mockito to mock the file user data access object.
however, we also want fresh tests that use an in-memory version of the DAO to reduce the complexity of future tests and improve readability
our tests should be comprehensive and test almost every class and have a high coverage.
As indicated in the title, creating use case factories that initialize multiple objects like the Controller, Interactor, State, View Model, Presenter and View will make for easier and quicker testing and a simpler Main.java file when the app is completed.
when buying/selling a stock, take 3% of the users money and give them the number of the stock 97% of their money would've bought/sold.
this class should return placeholder values instead of querying the actual api.
creating tests is a problem using real-time data as the data we're collecting may change at any second, causing prices to sometimes fluctuate and throwing the tests off because of the randomness.
thus, the 'fake' API should return placeholder values when its methods are called and should be injected during testing instead of our current driver.
View names should be lower case, as seen in @gursi26's SellView, where the title is "sell" (lowercase). I believe multiple views may be affected by this.
GitHub artifact to carry over built project and separately run times
a user should be able to view a company's info as per the company info entity in a separate screen.
The buy stock interactor should be able to take info from the client such as their username, the stock ticker they want to buy, and how much they want to buy.
the interactor should check if they have enough money to purchase the stock by querying the api
The interactor should be able to get the user's history, add a BuyTransaction to it, update the balance, and update the portfolio accordingly. finally, it should return a success view
in the dashboard, the user should be able to view basic info on their portfolio in a LIST format such as:
As of right now, there is no main "operation" that is executed on the dashboard, so there is no button that triggers a DashboardController.execute call.
This is a problem because the SellView grabs owned stocks from the DashboardState, which will not be updated without a DashboardController.execute call.
Proposed solution: Add a refresh button on the Dashboard that refreshes the Dashboard view with latest stock prices (by executing the DashboardController). This should update DashboardState. Also, if the user buys or sells a stock and returns to the Dashboard, they would press the refresh button to see their most recent action reflected on the dashboard.
upon clicking the "View More" in any of the portfolio items in the dashboard, the user can view more detailed information about their stock such as:
if you have any ideas, write them down here as well
To begin, we need to create an API interface. To adhere to the Dependency Inversion Principle, we put this interface under use_cases
.
We then need to implement a Finnhub
driver in order to access the Finnhub API. We must implement various entities for the purposes of storing data that we access from the API, such as PricePoint
, CompanyInformation
, CompanyNews
, Stock
, etc. The Finnhub
driver will get and then store information retrieved from the API, implementing the APIAccessInterface
and aggregating the aforementioned entities.
Create the TransactionHistory view which allows the user to view their investment history from the DashboardView.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.