Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
a71aeb0
Logout finished
R31y Oct 21, 2024
81dd674
lab 5
Kevin-Xiaoran Oct 21, 2024
a4fc69d
Merge remote-tracking branch 'origin/usecase_logout' into main
Kevin-Xiaoran Oct 21, 2024
f5eddd8
Update README.md
Kevin-Xiaoran Nov 4, 2024
c528689
test
ryanjin333 Nov 4, 2024
ec1bb01
Merge pull request #3 from Kevin-Xiaoran/ryanjin1
Kevin-Xiaoran Nov 4, 2024
5a79dd2
Merge pull request #2 from Kevin-Xiaoran/Kevin-Xiaoran-update-readme
zifanguo2004 Nov 4, 2024
e10fe60
Test
R31y Nov 4, 2024
31fb9ba
Merge pull request #4 from Kevin-Xiaoran/Ziming-Huang
zifanguo2004 Nov 4, 2024
dfc348e
Update README.md
Kevin-Xiaoran Nov 4, 2024
758dfd4
Merge pull request #5 from Kevin-Xiaoran/Kevin-Xiaoran-patch-1
Kevin-Xiaoran Nov 4, 2024
8ddb5e5
Update README.md
Kevin-Xiaoran Nov 4, 2024
0581005
Merge pull request #6 from Kevin-Xiaoran/Kevin-Xiaoran-patch-2
ryanjin333 Nov 4, 2024
9206962
finish early version of home view
Kevin-Xiaoran Nov 7, 2024
e4cf0ea
Complete the view of WatchList Demo
R31y Nov 8, 2024
7334dfa
Merge pull request #7 from Kevin-Xiaoran/Ziming-Huang
R31y Nov 8, 2024
e575cc4
Deleted unused codes
R31y Nov 8, 2024
0fe5d0c
Merge pull request #8 from Kevin-Xiaoran/Ziming-Huang
R31y Nov 8, 2024
afbd82b
Add the return button to home page for WatchList
R31y Nov 8, 2024
25e0c84
Merge pull request #9 from Kevin-Xiaoran/Ziming-Huang
R31y Nov 8, 2024
3610af5
Logout Feature
Ta0p1 Nov 10, 2024
ec432c8
Merge pull request #10 from Kevin-Xiaoran/huan4066-logout
Ta0p1 Nov 10, 2024
cbf53f5
Adjust UI of homepage(Especially sign up).
Ta0p1 Nov 10, 2024
cf3b587
Merge pull request #11 from Kevin-Xiaoran/huan4066-signup
Ta0p1 Nov 10, 2024
f247a43
Improve the logout function.
Ta0p1 Nov 10, 2024
ebd22b9
Merge pull request #12 from Kevin-Xiaoran/huan4066-logout
Ta0p1 Nov 10, 2024
6a192d7
Add cancel button for signup and login
R31y Nov 11, 2024
ac4333e
Merge pull request #13 from Kevin-Xiaoran/Ziming-Huang
R31y Nov 11, 2024
95a8a41
configure .gitignore file
Kevin-Xiaoran Nov 11, 2024
0851346
Add AbstractViewWithBackButton view
Kevin-Xiaoran Nov 11, 2024
a91676e
Merge pull request #14 from Kevin-Xiaoran/kairanzh-home-view
Ta0p1 Nov 11, 2024
9761d0f
first demo
zifanguo2004 Nov 11, 2024
04ba0eb
part of stock view done
zifanguo2004 Nov 11, 2024
d791397
first demo
zifanguo2004 Nov 14, 2024
319a8b3
Finish GetStock method to get today stock information. source from ap…
R31y Nov 14, 2024
b9c3b4b
Merge pull request #15 from Kevin-Xiaoran/Ziming-Huang
Kevin-Xiaoran Nov 15, 2024
ff91b1f
Modify watchlist database
Kevin-Xiaoran Nov 15, 2024
d6104c0
Update .gitignore
Kevin-Xiaoran Nov 15, 2024
81a751d
Merge branch 'main' into kairanzh-home-view
Kevin-Xiaoran Nov 15, 2024
d5f55b2
fix stock entity data types
Kevin-Xiaoran Nov 15, 2024
d29f782
Portfolio view finished design
ryanjin333 Nov 15, 2024
5050e1c
add get/set watchlist method for DataAccess
Kevin-Xiaoran Nov 16, 2024
9953e87
fix bugs for watchListDataAccessObject
Kevin-Xiaoran Nov 16, 2024
cecd1af
Merge pull request #16 from Kevin-Xiaoran/kairanzh-home-view
R31y Nov 16, 2024
1f6b687
Merge pull request #17 from Kevin-Xiaoran/guozifan-stock-view
Kevin-Xiaoran Nov 16, 2024
4a9dcf7
Merge pull request #18 from Kevin-Xiaoran/ryanjin1-portfolio
Kevin-Xiaoran Nov 16, 2024
17f3c74
add portfolio data getter/setter
Kevin-Xiaoran Nov 16, 2024
dd1466e
push missing files
Kevin-Xiaoran Nov 16, 2024
79271ac
fix conflicts
Kevin-Xiaoran Nov 16, 2024
3e25a01
Merge pull request #20 from Kevin-Xiaoran/kairanzh-home-view
R31y Nov 16, 2024
9370a63
Pass data from HomeView to StockView
Kevin-Xiaoran Nov 16, 2024
37fd94f
Merge pull request #21 from Kevin-Xiaoran/kairanzh-home-view
R31y Nov 16, 2024
1db2cfe
Sign in
Ta0p1 Nov 17, 2024
14546d8
Merge pull request #23 from Kevin-Xiaoran/huan4066-account
R31y Nov 17, 2024
7bd06da
fix main.java bug
Kevin-Xiaoran Nov 18, 2024
fec5461
Merge branch 'main' into kairanzh-home-view
Kevin-Xiaoran Nov 18, 2024
bd7fc5b
Account function.
Ta0p1 Nov 18, 2024
19d1b8e
add fake data to prevent api usage
Kevin-Xiaoran Nov 18, 2024
c61412f
Merge pull request #25 from Kevin-Xiaoran/kairanzh-home-view
zifanguo2004 Nov 18, 2024
f334766
Merge pull request #24 from Kevin-Xiaoran/huan4066-account
Kevin-Xiaoran Nov 18, 2024
4136821
fix stock view UI bugs
Kevin-Xiaoran Nov 18, 2024
ce15a87
Update README.md
Kevin-Xiaoran Nov 18, 2024
d6d3b27
Merge pull request #26 from Kevin-Xiaoran/kairanzh-home-view
zifanguo2004 Nov 18, 2024
0dec0aa
back and value
zifanguo2004 Nov 18, 2024
ebe33bc
Update README.md
zifanguo2004 Nov 18, 2024
63042e6
Merge pull request #28 from Kevin-Xiaoran/zifanguo2004-patch-1
Kevin-Xiaoran Nov 18, 2024
e4f8fd2
star and back
zifanguo2004 Nov 18, 2024
63aa879
Merge pull request #27 from Kevin-Xiaoran/Zifan-StockView
Ta0p1 Nov 18, 2024
065c765
panel
zifanguo2004 Nov 18, 2024
e5a1dc7
update search test case
Kevin-Xiaoran Nov 18, 2024
e4bb66d
test
ryanjin333 Nov 18, 2024
0460f3f
Merge branch 'main' into ryanjin1-portfolio
Kevin-Xiaoran Nov 18, 2024
088cc40
Merge pull request #30 from Kevin-Xiaoran/ryanjin1-portfolio
Kevin-Xiaoran Nov 18, 2024
43be538
Merge pull request #31 from Kevin-Xiaoran/Zifan-StockView
Ta0p1 Nov 18, 2024
4d98a21
Merge pull request #29 from Kevin-Xiaoran/kairanzh-home-view
zifanguo2004 Nov 18, 2024
d59a840
add getDailyChange and getDailyPercentage method in Stock
R31y Nov 18, 2024
fca0dbf
add listener to watchlist that can update the watchlist and also can …
R31y Nov 18, 2024
76b2401
Merge branch 'main' into Ziming-Huang
R31y Nov 18, 2024
4f4845e
Update CommonStock.java
R31y Nov 18, 2024
a47f8d5
Display and update watch list in home page
Kevin-Xiaoran Nov 18, 2024
c9eb73b
Merge pull request #33 from Kevin-Xiaoran/kairanzh-home-view
R31y Nov 18, 2024
cf7e426
Merge pull request #32 from Kevin-Xiaoran/Ziming-Huang
Kevin-Xiaoran Nov 18, 2024
e349fc8
Improve home page UI, add error message label and related functions
Kevin-Xiaoran Nov 19, 2024
0b0f90b
Merge pull request #34 from Kevin-Xiaoran/kairanzh-home-view
Kevin-Xiaoran Nov 19, 2024
38ee5b3
pass data from home view to watchlist view
Kevin-Xiaoran Nov 19, 2024
c93e592
Update README.md
Kevin-Xiaoran Nov 19, 2024
76d641c
Update WatchListView.java
R31y Nov 19, 2024
8566a25
Merge pull request #35 from Kevin-Xiaoran/kairanzh-home-view
R31y Nov 19, 2024
5e85e19
Buy user case.
Ta0p1 Nov 21, 2024
e808d88
Merge pull request #36 from Kevin-Xiaoran/huan4066-buy
zifanguo2004 Nov 21, 2024
9470866
stock use case partly done
zifanguo2004 Nov 23, 2024
51a6b51
stock use case partly done
zifanguo2004 Nov 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
out/
!**/src/main/**/out/
!**/src/test/**/out/
.idea
.idea/easycode.ignore
homework-5.iml

target/

Expand All @@ -29,4 +31,4 @@ bin/
.vscode/

### Mac OS ###
.DS_Store
.DS_Store
7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

205 changes: 49 additions & 156 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,181 +1,74 @@
# Lab 5: Logout
# Course Project Blueprint

## Preamble
## Domain

In the current homework, you added code to the login use case to save the currently-logged-in
user by saving the user in the Data Access Layer. You also added a unit test for this.
Stock MarketPlace

In this lab, you will complete a logout use case as a team. You will also begin to discuss your project
and the use cases that need to be implemented.
## Project Description
Introducing our Stock Marketplace Application, a user-friendly platform designed for both casual viewers and active investors. With this app, users can quickly look up stock information by entering ticker symbols without needing to log in, providing immediate access to essential market data. For personalized experience, users can create an account to build a watchlist of their favorite stocks, making it easy to track preferred investments. Additionally, the application features a simulated holdings section where logged-in users can add stocks along with their purchase amounts and prices, allowing for real-time calculations of day gains and total gains.

We have created all the Clean Architecture classes necessary for the logout use case.
## User Stories
- As a visitor, I want to view stock information by entering a ticker symbol, so that I can quickly access market data without needing to create an account. (kairanzh)
- As a registered user, I want to log in to my account, so that I can save my favorite stocks in a personalized watchlist. (huan4000)
- As a registered user, I want to log in to my account, so that I can access my watchlist and view my favourite stocks’ information. (guozifa1)
- As a registered user, I want to log in to my account, so that I can access add any stock in my simulated holding. (huan4066)
- As a registered user, I want to log in to my account, so that I can access my simulated holding and view day’s gain and total gain. (jinryan1)
- As a registered user, I want to log out of my account, so that my information remains secure when I’m not using the application. (huan4066)

By Friday, your team will submit:
- your completed lab code [for credit]
- a draft of your project blueprint proposal. [required, but not for credit]
## Proposed Entities
`User`
- Name string
- Password string
- Watchlist array of string
- SimulatedHoldings array of `SimulatedHolding`

# Phase 2 [for credit]
_(recall, Phase 1 was your solo task of adding the storage of the currently-logged-in user)_
`SimulatedHolding (Stock)`
- Amount int
- Purchased Price int

## Task 0: Fork this repo on GitHub
**To get started, one team member should fork this repo on GitHub and share it with the team.
All of you should then clone it.**
`Stock`
- Symbol string
- OpenPrice int
- ClosePrice int
- Volume int
- High int
- Low int

* * *
## External APIs
- User related: http://vm003.teach.cs.toronto.edu:20112/user
- Stock information: https://api.marketstack.com/v1/eod?symbols=AAPL

Suggested logistics: One of you should invite the others to collaborate on their fork of the
original repo on GitHub. You can do this in your repo on GitHub under `Settings -> Collaborators`.
This will allow you to push branches to a common repo and then use pull requests to contribute
your code and review. To prevent others from pushing directly to the main branch,
we recommend you set branch protection rules on GitHub. Below are how the settings might look if you
add branch protection rules:
## Documentation
`Link`: https://marketstack.com/documentation

![image of branch protection rules for main with the
requirement of two approvers to merge in pull requests.
](images/branch_protection_rules.png)
`access_key`: 3847d86b56ca461a0da759024332c06a

* * *
## Project Blueprint
<img width="608" alt="image" src="https://github.com/user-attachments/assets/75412420-525b-4fe8-a10f-3af5050c23f7">
<img width="615" alt="image" src="https://github.com/user-attachments/assets/ba9ca85d-26af-459e-ab74-78589e492665">
<img width="616" alt="image" src="https://github.com/user-attachments/assets/21524f80-0551-479e-b4c2-cf6b4931dfeb">
<img width="627" alt="image" src="https://github.com/user-attachments/assets/0de461eb-0d80-4fea-be2c-ca984dc633ef">
<img width="681" alt="image" src="https://github.com/user-attachments/assets/2e19935d-d932-47de-83b0-42a14ded0a93">

Open the project in IntelliJ and make sure you can successfully run `app/Main.java`.
Note: you may need to set the Project SDK in the `Project Structure...` menu, and possibly
also manually link the Maven project, as you did in Phase 1.
## Week 2 Progress
`Home Page`
<img width="340" alt="image" src="https://github.com/user-attachments/assets/a4a52458-5be6-4bef-8e1f-18776d97f362">

## Task 1: Understanding the Program
`Stock View`
<img width="340" alt="image" src="https://github.com/user-attachments/assets/dd2d7e3a-3e26-4a15-b1c7-5071d5b148b6">

You may notice that we have refactored the CA engine code _slightly_ since Phase 1, but the
way we build the engine is drastically different: we have switched from using Factories to
using the Builder design pattern, which we'll be discussing in lecture soon.
`Portfolio`
<img width="340" alt="image" src="https://github.com/user-attachments/assets/ccbf28cd-9192-4c75-a00d-ad7ec0d45395">

Open up `app.Main` and read it as a team.
- What are the Views and what are the current Use Cases?
- Which Uses Cases are triggered from each View?
- Which version of the DAO is `app.Main` using?
`Watchlist`
<img width="340" alt="image" src="https://github.com/user-attachments/assets/aa932f8c-9820-49d0-a0d8-dcbb53094d30">

The major change since Phase 1 is that we have added the `app.AppBuilder` class which makes
it easier to understand how our CA engine is being constructed — it also makes `app.Main` nice and concise!
- Why do all those `addX` methods end in `return this;`?

Run the program and make sure the signup and login Use Cases work.

Currently, you'll notice that the "Log Out" button still doesn't actually log you out. It's time to fix
that button, which is part of the `LoggedInView`.
We have created all the classes for you, but some of the code is missing.
As a team, your task is to fill in the missing code so that the Logout Use Case is implemented.
**The next part of the readme describes how your team will do this.**

* * *

**Your team will know when you are done when:**

- Clicking the "Log Out" button takes the user back to the Login View when you use the program.
- The provided `LogoutInteractorTest` test passes.

The "Log Out" button is an instance variable in class `LoggedInVew`. Go find it.
Also look at the `interface_adapter.change_password.LoggedInViewModel`, which contains any
data showing on the `LoggedInVew`.

* * *

## Task 2: Dividing up the work

There are `TODO` comments left in the files
Recall that you can use the TODO tool window to conveniently pull up a complete list.

Once the TODOs are all complete, the "Log Out" button _should_ work!

As a team, split up the TODOs (see below) between the members of your team.

There are TODOs in seven of the files.
Make sure each member has at least one TODO which they will be responsible for completing.
If your team prefers to work in pairs, that is fine too. Your individual branches
will not be graded for this — only the final, working version.

The TODOs are summarized below (by file) to help your team decide how to split them up:

* * *

- `Main.java`

- [ ] TODO: add the Logout Use Case to the app using the appBuilder

* * *

- `LoggedInView.java` (tip: refer to the other views for similar code)

- [ ] TODO: save the logout controller in the instance variable.
- [ ] TODO: execute the logout use case through the Controller

* * *

- `LogoutController.java` (tip: refer to the other controllers for similar code)

- [ ] TODO: Save the interactor in the instance variable.
- [ ] TODO: run the use case interactor for the logout use case

* * *

- `LogoutInputData.java` (should be done with the LogoutInteractor TODOs below)

- [ ] TODO: save the current username in an instance variable and add a getter.

- `LogoutInteractor.java` (tip: refer to `ChangePasswordInteractor.java` for similar code)

- [ ] TODO: save the DAO and Presenter in the instance variables.
- [ ] TODO: implement the logic of the Logout Use Case

* * *

- `LogoutOutputData.java`

- [ ] TODO: save the parameters in the instance variables.

* * *

- `LogoutPresenter.java` (tip: refer to `SignupPresenter.java` for similar code)

- [ ] TODO: assign to the three instance variables.
- [ ] TODO: have prepareSuccessView update the LoggedInState
- [ ] TODO: have prepareSuccessView update the LoginState

* * *

1. Make a branch named the first part of your UofT email address, everything before the `@`.
For example, if your email address is `paul.gries@mail.utoronto.ca`, then the branch name would
be `paul.gries`.

Make sure you switch to the new branch.

In the terminal, this would look like below, but replaced with your own information:
```
git branch paul.gries
git switch paul.gries
```

2. Complete your assigned TODOs and make a pull request on GitHub. In your pull request,
briefly describe what your TODOs were and how you implemented them. If you aren't sure
about part of it, include this in your pull request so everyone knows what to look
for when reviewing — or you can of course discuss with your team before making your
pull request since you are physically working in the same space.
- **Important: don't push any changes to the `.idea` folder, as that
may cause issues for your other teammates, as some files contain
configurations specific to your individual IntelliJ projects.**

3. Review each other's pull requests to ensure each TODO is correctly implemented and that
there are no Checkstyle issues in the files that were modified.

4. Once all TODOs are completed, your team should debug as needed to ensure the
correctness of the code. Setting a breakpoint where the log-out use case
interactor starts its work will likely be a great place to start when debugging.

And that's it; you now have a working Logout Use Case! Instructions for
how to submit your work on MarkUs will be posted later.

Your team should spend the rest of the lab working on your project blueprint.

* * *

# Project Blueprint

See Quercus for details about the project blueprint! By the end of the week,
the goal is for your team to have a fully drafted blueprint so that your team
will be ready to get started on your project after Reading Week.
6 changes: 6 additions & 0 deletions homework-5.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="CheckStyle-IDEA-Module" serialisationVersion="2">
<option name="activeLocationsIds" />
</component>
</module>
Loading