Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update on DG #184

Merged
merged 110 commits into from
Nov 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
d115f8b
update on test and welcome message
Oct 30, 2018
dd573a8
change login page
Oct 30, 2018
619dc40
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Oct 30, 2018
431630f
added event call to change logic
Oct 31, 2018
2457824
fixed the bug regarding mutiplle subsribe of event after login logout
Oct 31, 2018
028646f
Merge branch 'master' into master
LIU-TIANHANG Oct 31, 2018
553c82b
remove debug sentence
Oct 31, 2018
dd4de8e
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Oct 31, 2018
c127249
change command into their respective model
Nov 1, 2018
ba8b6af
EOF
Nov 1, 2018
e3a06c7
update ppp ug dg
Nov 1, 2018
5a0a3ae
update on logout login bug
Nov 1, 2018
71cc391
Update loginInfoManager.json
Nov 1, 2018
3a369e5
Merge branch 'master' into master
LIU-TIANHANG Nov 1, 2018
b57e462
update on the ug dg bug
Nov 1, 2018
e43c613
Merge branch 'master' into master
LIU-TIANHANG Nov 1, 2018
1b2b0e7
Update docs/team/tianhang.adoc
Nov 1, 2018
62134f0
Merge branch 'master' into master
LIU-TIANHANG Nov 1, 2018
bb69f50
update on bottom list confirmation message and "import" to sell command
Nov 1, 2018
41eebdc
Merge branch 'master' of https://github.com/LIU-TIANHANG/main
Nov 1, 2018
1a10d12
let coder choose to have confirmation or not
Nov 1, 2018
f550ff2
move help window from docs to help
Nov 1, 2018
9870f15
new line eof
Nov 1, 2018
23d9e48
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Nov 2, 2018
06125fc
last minute check
Nov 2, 2018
94bd7b0
Added newline at EOF
Lunastryke Nov 2, 2018
d85161f
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/mai…
LIU-TIANHANG Nov 3, 2018
d1f157d
added some test
LIU-TIANHANG Nov 4, 2018
fc4a331
UG: fix #134
bluein-green Nov 4, 2018
307bf42
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/mai…
bluein-green Nov 6, 2018
4703ed0
AnalysisManager: reduce code redundancies
bluein-green Nov 6, 2018
9e79a1a
analyseProfit and analyseRevenue (for all transactions) added
bluein-green Nov 6, 2018
c38162f
AnalysisPeriodType added
bluein-green Nov 6, 2018
58c0836
Modified Analysis to account for period
bluein-green Nov 6, 2018
4f2710a
added more test
Nov 6, 2018
bfff2d6
Date: added methods to return date 6 and 29 days before. created pred…
bluein-green Nov 6, 2018
f14ccb5
used Predicates to filter transactions for analysis of costs
bluein-green Nov 6, 2018
e424e4d
added TransactionList test
bluein-green Nov 6, 2018
4b82d83
checkstyle for TransactionList
bluein-green Nov 6, 2018
83465ed
applay SLAP
Nov 6, 2018
ab7af2d
changed
Nov 6, 2018
637f376
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Nov 6, 2018
db9bf6e
Merge branch 'v1.4'
Nov 6, 2018
57e465e
change test location
Nov 6, 2018
3934571
travis
Nov 6, 2018
705eeb5
travis EOF
Nov 6, 2018
8d4dba8
travis please go alive
Nov 6, 2018
afcbe7a
travis go heaven pls
Nov 6, 2018
bd5948d
travis go fly pls
Nov 6, 2018
68ddc3f
added
Nov 6, 2018
6f26f89
move add and delete to manager
Nov 6, 2018
22dfd54
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Nov 6, 2018
05dae05
Merge branch 'accCommand'
Nov 6, 2018
78a70b6
settle command
Nov 6, 2018
a351168
travis
Nov 6, 2018
3387283
Merge branch 'master' into master
LIU-TIANHANG Nov 8, 2018
ffc71ea
change in ppp
Nov 9, 2018
deadfe6
Merge branch 'master' of https://github.com/LIU-TIANHANG/main
Nov 9, 2018
e405eee
changes to ppp
Nov 9, 2018
46f9b97
added
Nov 9, 2018
128f8f5
fix about us pic not showing
Nov 9, 2018
be41d6f
Merge branch 'master' into master
LIU-TIANHANG Nov 9, 2018
5e79084
Update docs/AboutUs.adoc
Nov 9, 2018
5d63791
update on UG
Nov 9, 2018
7d086c3
EOF
Nov 9, 2018
717c9bd
clean code
LIU-TIANHANG Nov 10, 2018
d39bf0f
Update src/test/seedu/address/logic/commands/AddDrinkCommandTest.java
LIU-TIANHANG Nov 10, 2018
ce7b3d4
Revert "clean code"
LIU-TIANHANG Nov 10, 2018
c5ec6a3
Revert "Update src/test/seedu/address/logic/commands/AddDrinkCommandT…
LIU-TIANHANG Nov 10, 2018
2607917
added
LIU-TIANHANG Nov 10, 2018
8e36f7e
Revert "Revert "clean code""
LIU-TIANHANG Nov 10, 2018
40dec61
added
LIU-TIANHANG Nov 10, 2018
3940605
eof
LIU-TIANHANG Nov 10, 2018
a9f1e90
Update src/test/seedu/address/logic/commands/AddDrinkCommandTest.java
LIU-TIANHANG Nov 10, 2018
175ac89
Merge branch 'master' into master
LIU-TIANHANG Nov 10, 2018
fd2e717
update on test
LIU-TIANHANG Nov 10, 2018
4fa8abb
Merge branch 'master' of https://github.com/LIU-TIANHANG/main
LIU-TIANHANG Nov 10, 2018
8957e59
add test
LIU-TIANHANG Nov 10, 2018
d96bd50
eof i love u.....
LIU-TIANHANG Nov 10, 2018
f507e29
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
LIU-TIANHANG Nov 11, 2018
25fa4e8
added more test to increase coverage
LIU-TIANHANG Nov 11, 2018
b0a9ab7
delete manager UG
LIU-TIANHANG Nov 11, 2018
5ec09b3
update on uf
LIU-TIANHANG Nov 11, 2018
476fb46
create a new interface for loginINformanager
Nov 11, 2018
431bc45
Update src/main/java/seedu/address/init/InventoryListInitializer.java
Nov 11, 2018
0b6fa33
same
Nov 11, 2018
d0fcdd3
Merge branch 'master' into master
LIU-TIANHANG Nov 11, 2018
d4c566b
add interface of LoginINfoManager
Nov 12, 2018
8e9edd9
checkstyle
Nov 12, 2018
469bc8e
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Nov 12, 2018
1da035d
changed to fix logout login bug
Nov 12, 2018
a1493c7
Merge branch 'master' into master
LIU-TIANHANG Nov 12, 2018
7d456f2
Merge branch 'master' of https://github.com/CS2113-AY1819S1-W12-4/main
Nov 12, 2018
7e56df5
Update loginInfoList.json
Nov 12, 2018
d3411a2
change on the header of UG
Nov 12, 2018
e1ed5d8
added roles
Nov 12, 2018
fbc86da
update on roles
Nov 12, 2018
052a7b0
Update docs/team/johndoe.adoc
Nov 12, 2018
2b881db
Update README.adoc
Nov 12, 2018
209c0a5
Merge branch 'master' into master
LIU-TIANHANG Nov 12, 2018
1d1b209
update dg
Nov 12, 2018
8e6e8ea
Merge branch 'master' of https://github.com/LIU-TIANHANG/main
Nov 12, 2018
7fc5d4d
Merge branch 'master' into master
LIU-TIANHANG Nov 12, 2018
527e01a
EOF
Nov 12, 2018
772aead
delete john and add html page
Nov 12, 2018
5efb20a
eof
Nov 12, 2018
20c8791
eof fly pls
Nov 12, 2018
c221df9
eof
Nov 12, 2018
caf53d2
pppp
Nov 12, 2018
171f83e
cec
Nov 12, 2018
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
7 changes: 4 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ endif::[]
* <<AboutUs#, About Us>>
* <<ContactUs#, Contact Us>>
* https://cs2113-ay1819s1-w12-4.github.io/main/AccountantUserGuide.html[Accountant user guide]
* https://cs2113-ay1819s1-w12-4.github.io/main/ManagerUserGuide.html [Manager user guide]
* https://cs2113-ay1819s1-w12-4.github.io/main/StockTakerUserGuide.html [Stock taker user guide]
* https://cs2113-ay1819s1-w12-4.github.io/main/AdminUserGuide.html [Admin user guide]
* https://cs2113-ay1819s1-w12-4.github.io/main/ManagerUserGuide.html[Manager user guide]
* https://cs2113-ay1819s1-w12-4.github.io/main/StockTakerUserGuide.html[Stock taker user guide]
* https://cs2113-ay1819s1-w12-4.github.io/main/AdminUserGuide.html[Admin user guide]


== Acknowledgements
* Original source of code: Addressbook-Level4 project created by SE-EDU initiative at [https://github.com/se-edu]
Expand Down
140 changes: 44 additions & 96 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,25 @@ is within the desired time period

// end::analyses[]

//tag::commandPartition[]
=== Command partition

==== Current Implementation

The command partition is an implementation of the role system.

The `model` contain all the
API that is common for every user. `StockTakerModel` contains API for for stockTaker. Similar
idea applied to `AccountantModel` and `ManagerModel`. However, `AdminModel` extends all three models.
As such, `adminModel` will contains all APIs.

.Class diagram for Login related model
image::LoginUMLDiagram/Logic-UML-design-Login.png[width="800"]

After login, `logicManager` will assign a particular role to user according to their
`authenticationLevel`. As such, it will prevent one role from accessing other role's
command.
//end::commandPartition[]

//tag::login[]
=== Login/logout feature
Expand All @@ -383,28 +402,41 @@ is within the desired time period

The login feature is a standalone feature that enable security check on user. It has a fxml page that name `LoginPage.fxml` at `main\resources\view`
The controller of the fxml page named `LoginController` at `seedu.address\controller`
The model of is at `loginInfo` which storage the format in JSON with the help of `JsonUtils`.
Also, there is a `loginInfoManager` which include all the API for `loginInfo`.
As such, this is a design that fulfil the Model-View-Controller pattern.

Given below is a class diagram for login function
Given below is a class diagram for login function. LoginUtils has attributes of `LoginInfoModel`
`userName` and `Password`. It also use `passwordUtils` to hashed verify the password with `LoginInfoModel`

.Class diagram for Login related Utils
image::LoginUMLDiagram/Login_Class_Diagram.png[width="800"]


Given below is an example usage scenario and how login mechanism behave at each step.

image::LoginUMLDiagram/Login_sequence_diagram.png[width="800"]
The `LoginController` will check for username and password will the LoginUtils
Once the username and password is correct, it will continue to `InventoryListInitializer`.
It will also start the ui.
image::LoginUMLDiagram/Login_sequence_diagram.png[width="600" height ="400"]
The `LoginController` will check for username and password will the `LoginUtils`.


image::LoginUMLDiagram/LoginUtils_Sequence_Diagram.png[width="800"]
Given below is an example of access login information for `loginInfoList.json` during initiation of the application.
image::LoginUMLDiagram/LoginUtils_Sequence_Diagram.png[width="600" height ="400"]

image::LoginUMLDiagram/LoginList_Read_Sequence_Diagram.png[width="800"]
=== Save information about user account
Given below is a structure of `Model` components that is related to login feature.
The model stores loginInfo of the user.

Given below is an example of relogin under different account. `InventoryListInitializer` will call three event list below.
image::LoginUMLDiagram/Logic_LoginInfo_Model.png[width="800" height "200"]

The sequence diagram below shows the interactions within the logic components for the execuion of `createAccount` command.


image::LoginUMLDiagram/createAccountSequenceDiagram.png[width="800"]

Given below is an sequence diagram of access login information for `loginInfoList.json` during initiation of the application.
The program also save the the login information to `loginInfoList.json` when `logout` or `exit`.

image::LoginUMLDiagram/Logic-UML-design-ReadLoginInfoList.png[width="800" height ="400"]

image::LoginUMLDiagram/ReLoginEvent_sequence_diagram.png[width="800"]

==== Design Considerations
===== Aspect: How to store the data
Expand All @@ -418,101 +450,17 @@ image::LoginUMLDiagram/ReLoginEvent_sequence_diagram.png[width="800"]
===== Aspect: Data format for store data

* **Alternative 1 (current choice):** Store in Json file.
** Pros: Json is popular and have have support online.
** Pros: Json is popular and have many support online.
** Pros :JSON is relatively easier to implement compared to XML
** Cons: Have to write serialized method for JSON file.
* **Alternative 2:** Store in XML file
** Pros: Classic and matured product
** Pros: Have serialized code in original ab4.
** Cons: It has many rule to set before implementation.
** Cons: It has many rules to set before implementation.
//end::login[]

// tag::undoredo[]
=== Undo/Redo feature
==== Current Implementation

The undo/redo mechanism is facilitated by `VersionedAddressBook`.
It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`.
Additionally, it implements the following operations:

* `VersionedAddressBook#commit()` -- Saves the current address book state in its history.
* `VersionedAddressBook#undo()` -- Restores the previous address book state from its history.
* `VersionedAddressBook#redo()` -- Restores a previously undone address book state from its history.

These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively.

Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.

Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state.

image::UndoRedoStartingStateListDiagram.png[width="800"]

Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state.

image::UndoRedoNewCommand1StateListDiagram.png[width="800"]

Step 3. The user executes `add n/David ...` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`.

image::UndoRedoNewCommand2StateListDiagram.png[width="800"]

[NOTE]
If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`.

Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state.

image::UndoRedoExecuteUndoStateListDiagram.png[width="800"]

[NOTE]
If the `currentStatePointer` is at index 0, pointing to the initial address book state, then there are no previous address book states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo.

The following sequence diagram shows how the undo operation works:

image::UndoRedoSequenceDiagram.png[width="800"]

The `redo` command does the opposite -- it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state.

[NOTE]
If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone address book states to restore. The `redo` command uses `Model#canRedoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.

Step 5. The user then decides to execute the command `list`. Commands that do not modify the address book, such as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged.

image::UndoRedoNewCommand3StateListDiagram.png[width="800"]

Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. We designed it this way because it no longer makes sense to redo the `add n/David ...` command. This is the behavior that most modern desktop applications follow.

image::UndoRedoNewCommand4StateListDiagram.png[width="800"]

The following activity diagram summarizes what happens when a user executes a new command:

image::UndoRedoActivityDiagram.png[width="650"]

==== Design Considerations

===== Aspect: How undo & redo executes

* **Alternative 1 (current choice):** Saves the entire address book.
** Pros: Easy to implement.
** Cons: May have performance issues in terms of memory usage.
* **Alternative 2:** Individual command knows how to undo/redo by itself.
** Pros: Will use less memory (e.g. for `delete`, just save the person being deleted).
** Cons: We must ensure that the implementation of each individual command are correct.

===== Aspect: Data structure to support the undo/redo commands

* **Alternative 1 (current choice):** Use a list to store the history of address book states.
** Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project.
** Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both `HistoryManager` and `VersionedAddressBook`.
* **Alternative 2:** Use `HistoryManager` for undo/redo
** Pros: We do not need to maintain a separate list, and just reuse what is already in the codebase.
** Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as `HistoryManager` now needs to do two different things.
// end::undoredo[]

// tag::dataencryption[]
=== [Proposed] Data Encryption

_{Explain here how the data encryption feature will be implemented}_

// end::dataencryption[]

=== Logging

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/LoginUMLDiagram/Login_Sequence_Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/LoginUMLDiagram/Login_sequence_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 0 additions & 72 deletions docs/team/johndoe.adoc

This file was deleted.

3 changes: 2 additions & 1 deletion docs/team/liu-tianhang.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ include::../UserGuide.adoc[tag=account]
|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

include::../DeveloperGuide.adoc[tag=commandPartition]
include::../DeveloperGuide.adoc[tag=login]

3 changes: 0 additions & 3 deletions docs/team/lunastryke.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ include::../UserGuide.adoc[tag=viewDrinkDetails]
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

include::../DeveloperGuide.adoc[tag=undoredo]

include::../DeveloperGuide.adoc[tag=dataencryption]


== PROJECT: PowerPointLabs
Expand Down
Loading