Skip to content

Commit

Permalink
Merge pull request #76 from AY1920S1-CS2103-T14-4/UpdateDocs_CW
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
Cary-Xx committed Oct 23, 2019
2 parents 36bbb59 + 06928de commit 9026bab
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 89 deletions.
98 changes: 53 additions & 45 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ image::UiClassDiagram.png[]

*API* : link:{repoURL}/src/main/java/seedu/address/ui/Ui.java[`Ui.java`]

The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class.
The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `ExpenseListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class.

The `UI` component uses JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow`] is specified in link:{repoURL}/src/main/resources/view/MainWindow.fxml[`MainWindow.fxml`]

Expand All @@ -99,9 +99,9 @@ image::LogicClassDiagram.png[]
*API* :
link:{repoURL}/src/main/java/seedu/address/logic/Logic.java[`Logic.java`]

. `Logic` uses the `AddressBookParser` class to parse the user command.
. `Logic` uses the `MymParser` class to parse the user command.
. This results in a `Command` object which is executed by the `LogicManager`.
. The command execution can affect the `Model` (e.g. adding a person).
. The command execution can affect the `Model` (e.g. adding an expense).
. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`.
. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as displaying help to the user.

Expand All @@ -123,8 +123,8 @@ image::ModelClassDiagram.png[]
The `Model`,

* stores a `UserPref` object that represents the user's preferences.
* stores the Address Book data.
* exposes an unmodifiable `ObservableList<Person>` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.
* stores the MYMorise data.
* exposes an unmodifiable `ObservableList<Expense>` and an unmodifiable `ObservableList<Budget>` that can be 'observed' e.g. the UI can be bound to either list so that the UI automatically updates when the data in the list change.
* does not depend on any of the other three components.

[NOTE]
Expand All @@ -143,7 +143,7 @@ image::StorageClassDiagram.png[]
The `Storage` component,

* can save `UserPref` objects in json format and read it back.
* can save the Address Book data in json format and read it back.
* can save the MYMorise data in json format and read it back.

[[Design-Commons]]
=== Common classes
Expand Down Expand Up @@ -283,8 +283,7 @@ Refer to the guide <<DevOps#, here>>.
*Value proposition*:

* manage expenses faster than a typical mouse/GUI driven app.
* easily view metrics of spending.
* easily identify spending behaviour and tweak to meet budgeting goals.
* easily view spending metrics.

[appendix]
== User Stories
Expand All @@ -297,24 +296,14 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un
4.+| *Basic Functionality*
|`* * *` |new user |see usage instructions |refer to instructions when I forget how to use the App

|`* * *` |user |create a plain old expense |
|`* * *` |user |create an expense |

|`* * *` |user |create an expense with a tag |
|`* * *` |user |create an expense with a tag |identify my expenses by tags

|`* * *` |user |create a recurring expense |

|`* * *` |user |retrieve all expenses |review all my spending
|`* * *` |user |retrieve all expenses |review my spending

|`* * *` |user |retrieve all expenses for today |review my spending for the day

|`* * *` |user |retrieve list of all recurring expenses |

|`* *` |user |retrieve all expenses for the week |review my spending for the week

|`* *` |user |retrieve all expenses for the month |review my spending for the month

|`* *` |user |retrieve all expenses for the year |review my spending for the year

|`* * *` |user |find an expense name |locate a specific expense without having to go through the entire list

|`* * *` |user |edit an expense |change the expense amount, date or tag
Expand All @@ -323,35 +312,45 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un

|`* * *` |user |terminate a recurring expense |

|`* * ` |user |create a recurring expense |don't have to input recurring expenses every time

|`* *` |user |retrieve list of all recurring expenses |view all my recurring expenses

|`* *` |user |retrieve all expenses for the week |review my spending for the week

|`* *` |user |retrieve all expenses for the month |review my spending for the month

|`* *` |user |retrieve all expenses for the year |review my spending for the year

4.+| *Budgeting*

|`* * *` |user |set a budget for the month |
|`* * *` |user |set a budget for a period |track my expenses according to the budget amount

|`* * *` |user |check how much of my budget is left |know how much I can spend
|`* * *` |user |view a budget |know my expenses and how much I have left to spend in the budget

|`* * *` |user |notified every time I add an expense if I have less than 50% of my budget left |know how much I can spend
|`* *` |user |be notified every time I add an expense if I have less than 50% of my budget left |notify myself that i may be spending too much according to my budget

4.+| *UI*

|`* * *` |user |view in a pie chart expenditure breakdown by tag |
|`* * *` |user |view in a pie chart expenditure breakdown by tag |view my expenses easily with visual aid

|`* * *` |user |view in a pie chart how much of my budget is spent/available for the current month | manage my spending
|`* * *` |user |view in a pie chart how much of my budget is spent/available for the current month |view how much of my budget is left

|`* *` |user |view in a bar chart my expenditure | visualise my spending habits

4.+| *Inputs*

|`*` |user | command autocomplete suggestions| improve my productivity

|`* *` |user | recall commands previously used in session | improve my productivity

|`*` |user | command autocomplete suggestions| improve my productivity

4.+| *Multi-Currency*

|`* *` |user | set my default currency for tracking |
|`* * *` |user | set my default currency for tracking |

|`* *` |user | store expenses in a specific currency | track expenses when I travel
|`* *` |user | store expenses in a specific currency | track expenses in a different currency

|`* *` |user | automatically convert the expense to my local currency | track expenses in one currency
|`* *` |user | automatically convert the expense to my default currency | track expenses of different currency in terms of my default currency

|=======================================================================

Expand All @@ -362,7 +361,7 @@ _{More may be added}_


Note: For all use cases below, the *System* is `MYMorise(MYM)`, the *Actor* is the `user` and the *Precondition* is
`MyMorise is running`, unless specified otherwise).
`MYMorise is running`, unless specified otherwise).

Inputs specified in a square bracket i.e [input] are optional inputs from the user.

Expand Down Expand Up @@ -649,28 +648,37 @@ Use case resumes at step 2.

[none]
[#_UC10]
=== UC10 - Set a budget for the current month +
=== UC10 - Set a budget for a specific period +
Guarantees:

* The budget will be set to the specified amount.
* The budget will be set to a specified amount for a specific period.

[none]
*MSS*

. User requests to set the budget, specifying the amount for the month.
. MYM sets the budget of the month.
. User requests to set the budget, specifying the amount, the start date and the end date of the period.
. MYM sets the budget for the amount and period specified.
+
Use case ends.

[none]
*Extensions*

[none]
* 1a. An existing budget has already been set.
* 1a. MYM detects an error in the entered data.
[none]
** 1a1. MYM sets the budget for the month to the newly specified amount.
+
Use case ends.
** 1a1. MYM requests for the correct data.
** 1a2. User enters new data.
** Steps 1a1-1a2 are repeated until the data are correct.
** Use case resumes from step 2.
[none]
* 1b. MYM detects a budget period clash.
[none]
** 1b1. MYM requests for different period dates.
** 1b2. User enters new data.
** Steps 1b1-1b2 are repeated until the dates do not clash with existing budget periods.
** Use case resumes from step 2.


[none]
[#_UC11]
Expand Down Expand Up @@ -1011,15 +1019,15 @@ These instructions only provide a starting point for testers to work on; testers

_{ more test cases ... }_

=== Deleting a person
=== Deleting an expense

. Deleting a person while all persons are listed
. Deleting an expense while all expenses are listed

.. Prerequisites: List all persons using the `list` command. Multiple persons in the list.
.. Prerequisites: List all expenses using the `list` command. Multiple expenses in the list.
.. Test case: `delete 1` +
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
Expected: First expense is deleted from the list. Details of the deleted expense shown in the status message. Timestamp in the status bar is updated.
.. Test case: `delete 0` +
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
Expected: No expense is deleted. Error details shown in the status message. Status bar remains the same.
.. Other incorrect delete commands to try: `delete`, `delete x` (where x is larger than the list size) _{give more}_ +
Expected: Similar to previous.

Expand Down
67 changes: 35 additions & 32 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
. Some example commands you can try:

* *`list`* : lists all expenses
* **`add`**`add /n Textbook /a 23.50 /t education /t school` : adds an expense named `Textbook` to MYMorise with the tags `education` and `school`.
* **`add`**`n/Textbook a/23.50 t/education t/school` : adds an expense named `Textbook` to MYMorise with the tags `education` and `school`.
* **`delete`**`3` : deletes the 3rd expense shown in the current list
* *`exit`* : exits the app

Expand All @@ -51,8 +51,8 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
*Command Format*
* Words in `UPPER_CASE` are the parameters to be supplied by the user
* Items in square brackets are optional e.g `/a NAME [/t TAG]` can be used as `/a Bread /t Food` or as `/a Bread`.
* Items post-fixed with `…`​ can be used zero or more times e.g. `[/t TAG]…`​ can be excluded or include 1 or more tags `/t food /t drinks`.
* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/Bread t/Food` or as `n/Bread`.
* Items post-fixed with `…`​ can be used zero or more times e.g. `[t/TAG]…`​ can be excluded or include 1 or more tags `t/food t/drinks`.
====

=== Viewing help : `help`
Expand All @@ -62,15 +62,15 @@ Format: `help`
=== Adding an expense: `add`

Adds an expense to track. +
Format: `add /n NAME /a AMOUNT [/t TAG]…​`
Format: `add n/NAME a/AMOUNT [t/TAG]…​`

[TIP]
An expense can have any number of tags (including no tags)

Examples:

* `add /n Coffee /a 1.80 /t food`
* `add /n Textbook /a 23.50 /t education /t school`
* `add n/Coffee a/1.80 t/food`
* `add n/Textbook a/23.50 t/education t/school`

=== Listing all expenses : `list`

Expand All @@ -85,28 +85,28 @@ Format: `view`
=== Editing an expense : `edit`

Edits an existing expense in the expense list. +
Format: `edit INDEX [/n NAME] [/a AMOUNT] [/t TAG]…`
Format: `edit INDEX [n/NAME] [a/AMOUNT] [t/TAG]…`

****
* Edits the expense at the specified `INDEX`. The index refers to the index number shown in the displayed expense list. The index *must be a positive integer* 1, 2, 3, …​ The index is relative to what is displayed on the GUI rather than the actual index of the expense in MYMorise.
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.
* When editing tags, the existing tags of the expense will be removed i.e adding of tags is not cumulative.
* You can remove all the expense’s tags by typing `/t` without specifying any tags after it.
* You can remove all the expense’s tags by typing `t/` without specifying any tags after it.
****

Examples:

* `edit 1 /a 20.10` +
* `edit 1 a/20.10` +
Edits the amount of the 1st expense to be `$20.10`.
* `edit 2 /n Poets Coffee /t` +
* `edit 2 n/Poets Coffee t/` +
Replaces the name of the 2nd expense to `Poets Coffee` and clears all existing tags.

=== Locating expenses by name: `find`

Finds all expenses by name, date, tag. +
Format: `find [/n NAME] [/d DATE] [/t TAG]`
Format: `find [n/NAME] [d/DATE] [t/TAG]`

****
* Search by name and tag is case insensitive. e.g hans will match Hans
Expand All @@ -118,9 +118,9 @@ Format: `find [/n NAME] [/d DATE] [/t TAG]`

Examples:

* find Coffee +
* `find n/Coffee` +
Returns `coffee` and `Starbucks Coffee`.
* find Cheesecake +
* `find n/Cheesecake` +
Returns any expense having names `Cheesecake`, eg: `Strawberry Cheesecake`, `Blueberry Cheesecake`.

// tag::delete[]
Expand All @@ -141,7 +141,7 @@ Examples:
* `list` +
`delete 2` +
Deletes the 2nd expense in MYMorise.
* `find Coffee` +
* `find n/Coffee` +
`delete 1` +
Deletes the 1st expense in the results of the find command.

Expand All @@ -163,23 +163,24 @@ There is no need to save manually.
// tag::budget[]
=== Set a budget for a period : `budget`

Specifies a budget for a specific period. +
Format: `budget /d PERIOD /a AMOUNT`
Specifies a budget for a period beginning from the specified start date to an end date. +
Format: `budget n/NAME a/AMOUNT d/STARTDATE ed/ENDDATE `

****
* Sets a budget for the specified PERIOD. All expenses made in the month will deduct its amount from the budget to indicate how much funds are available to spend
* The Period refers to a specific date, month or period between two dates.
* The Amount refers to amount set for specified period.
* Sets a budget for a period beginning from STARTDATE to ENDDATE (inclusive). All expenses made during
that period will be included into the budget and the budget will deduct the expense
to indicate how much funds are left available to spend.
* The NAME refers to a name description to be given to the budget.
* The STARTDATE and ENDDATE refers to a specific date.
* The AMOUNT refers to the amount set for the budget.
****

Examples:

* `budget /d 9-10-19 /a SGD400` +
Sets a budget of SGD400 for Wed, 9th Oct 19.
* `budget /d Jan-19 /a SGD200` +
Sets a budget of SGD200 for the month of January 19.
* `budget /d 14-10-19 - 13-11-19 /a SGD500` +
Sets a budget of SGD500 for the period from Mon, 14th Oct 19 to Wed, 13th Nov 19.
* `budget n/Japan Travel a/SGD4000 d/9/10/19 ed/19/10/19` +
Sets a budget of SGD4000 for the period from Wed, 9th Oct 19 to Sat, 19th Oct 19.
* `budget n/January 2019 Budget a/SGD800 d/1/1/19 ed/31/1/19` +
Sets a budget of SGD800 for the period from Tue, 1st Jan 19 to Thu, 31st Jan 19.

// end::budget[]

Expand Down Expand Up @@ -209,14 +210,16 @@ Sets a budget of SGD500 for the period from Mon, 14th Oct 19 to Wed, 13th Nov 19
== Command Summary

* *Help* : `help`
* *Add* `add /n NAME /a AMOUNT [/t TAG]…` +
e.g. `add /n Coffee /a 2.00 /t nourishment /t school`
* *Add* `add n/NAME a/AMOUNT [t/TAG]…` +
e.g. `add n/Coffee a/2.00 t/nourishment t/school`
* *List* : `list`
* *View* : `view`
* *Edit* : `edit INDEX [/n NAME] [/a AMOUNT] [/t TAG]…​` +
e.g. `edit 2 /n Starbucks Coffee /t nourishment`
* *Find* : `find [/n NAME] [/d DATE] [/t TAG]` +
e.g. `find /n Coffee /d 20190412 /t nourishment` +
e.g. `find /t nourishment`
* *Edit* : `edit INDEX [n/NAME] [a/AMOUNT] [t/TAG]…​` +
e.g. `edit 2 n/Starbucks Coffee t/nourishment`
* *Find* : `find [n/NAME] [d/DATE] [t/TAG]` +
e.g. `find n/Coffee d/13/12/2019 t/nourishment` +
e.g. `find t/nourishment`
* *Delete* : `delete INDEX` +
e.g. `delete 3`
* *Budget* : `budget n/NAME a/AMOUNT d/STARTDATE ed/ENDDATE` +
e.g. `budget n/Japan Travel a/SGD4000 d/9/10/19 ed/19/10/19`
4 changes: 2 additions & 2 deletions docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ activate ui UI_COLOR
ui -[UI_COLOR]> logic : execute("delete 1")
activate logic LOGIC_COLOR

logic -[LOGIC_COLOR]> model : deletePerson(p)
logic -[LOGIC_COLOR]> model : deleteExpense(e)
activate model MODEL_COLOR

model -[MODEL_COLOR]-> logic
deactivate model

logic -[LOGIC_COLOR]> storage : saveExpenseList(expenseList)
logic -[LOGIC_COLOR]> storage : saveMymorise()
activate storage STORAGE_COLOR

storage -[STORAGE_COLOR]> storage : Save to file
Expand Down
Loading

0 comments on commit 9026bab

Please sign in to comment.