Skip to content

Commit

Permalink
Merge a0598c7 into a2c500d
Browse files Browse the repository at this point in the history
  • Loading branch information
joloong committed Nov 11, 2019
2 parents a2c500d + a0598c7 commit b6d0571
Show file tree
Hide file tree
Showing 39 changed files with 389 additions and 178 deletions.
195 changes: 177 additions & 18 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:imagesDir: images
:stylesDir: stylesheets
:xrefstyle: full
:experimental:
ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
Expand Down Expand Up @@ -39,6 +40,11 @@ In particular, the intended audience of this document will be the students takin
_PalPay_ is a CLI application targeted for users who have poor financial management skills. The users should also prefer typing over mouse inputs.
It allows the users to keep track of daily financial transactions, as well as set a budget for a time duration to achieve long-term financial success. Additionally, users can keep a ledger of lending and borrowing of money with others so that the users can keep track of the flow of their money.

Below is the Graphical User Interface (GUI) of PalPay:

.PalPay's GUI
image::dg_gui_example.png[]

== Setting up

Refer to the guide <<SettingUp#, here>>.
Expand Down Expand Up @@ -253,7 +259,7 @@ image::OutbudgetActivityDiagram.png[]
=== Set Budget Feature: `set`

The `Budget` class allows the user to set a budget for a given time period for a category, if specified.
The user is allowed to set multiple budgets, but duplicate budgets (budgets with the same identity in terms of *amount*, *date* and *tag*) are not allowed.
The user is allowed to set multiple budgets, but duplicate budgets (budgets with the same identity in terms of *amount*, *date* and *category*) are not allowed.
Upon setting the budget, making `OutTransaction` will deduct the amount from relevant budgets in the list.
The detailed implementation of the process of updating the budget is explained further below in <<Current-Implementation, Current Implementation>>.

Expand Down Expand Up @@ -284,6 +290,8 @@ public String displayPercentage() {
double percentage = this.amount.divideAmount(this.initialAmount) * 100;
if (percentage < 0.00) {
percentage = 0.0; // should not display a negative percentage
} else if (percentage > 100.00) {
percentage = 100.0; // should not display a percentage greater than 100%
}
return String.format("%.2f%% remaining", percentage);
}
Expand All @@ -294,21 +302,50 @@ For instance, budget is displayed in red to alert the user that he has overspent

Shown below is an example of an overspent budget:

.Example of an overspent budget
.Example of an Overspent Budget
image::overspentBudget.png[]


When setting a new `Budget`, existence of a duplicate budget is checked through a sequence of checks.
The activity diagram below shows the activity diagram of setting a new budget:

.Activity Diagram of successfully setting a new Budget

[[Duplicate-budget-check]]
.Activity Diagram of setting a New Budget Successfully
image::SetBudgetSimpleActivityDiagram.png[]

As shown, a new budget cannot have the same *initalAmount*, *deadline* and *categories* as any other existing budget in
budget list. Allowing existence of duplicate budgets will crowd the interface of `Budget` tab,
which prevents the user from getting a quick overview of his budget status. Hence, a duplicate check is essential
in providing a pleasing user experience. +

==== Example of Usage

Given below is an example usage of how `set` behaves at each step.

**Step 1**. The user executes `set $/100 d/31122019 c/shopping` to set a new budget of $100 until 31st December 2019 under the *category* shopping.

.User Inputs `set $/100 d/31122019 c/shopping`
image::set_dg_1.png[]

**Step 2**. Upon executing the command, `LogicManager` uses `MainParser#parse` to parse the input from the user.

**Step 3**. `MainParser` determines which command is being executed and creates `SetCommandParser` to further parse the input.

**Step 4**. `SetCommandParser` parses the argument and checks if it is valid. If it is invalid, an exception is thrown.
Else, it returns a `SetCommand`.

**Step 5**. `LogicManager` uses `SetCommand#execute()` to add a new budget. +
`SetCommand` uses `ModelManager#has(Budget)` to check if it is a duplicate of an existing budget
in the `UniqueBudgetList` as shown above in <<Duplicate-budget-check, the above diagram>>.

**Step 6**. `SetCommand` uses `Model#commitUserState()` to save the latest state of the application. It then
returns a `CommandResult` to the `LogicManager` and the result will be displayed to the user at the end.

.New Budget Successfully Created
image::set_dg_2.png[]


==== Design Considerations

Currently, `Budget` does not extend from `Transaction` although the two behave in a similar way.
Expand Down Expand Up @@ -1001,7 +1038,7 @@ Cons:
[appendix]
== Instructions for Manual Testing

Given below are instructions to test the app manually.
Given below are instructions to test the application manually.

[NOTE]
These instructions only provide a starting point for testers to work on; testers are expected to do more _exploratory_ testing.
Expand All @@ -1023,23 +1060,145 @@ Close the window.
.. Re-launch the app by double-clicking the jar file. +
Expected: The most recent window size and location is retained.

=== Adding an In Transaction

. Adding an in transaction with the command: `in`

.. Prerequisites:

.. Test case: `in $/1000 n/Allowance d/11112019` +
Expected: An in transaction will be added into the list of transactions in the Transaction tab.

.. Test case: `in $/0 n/Allowance d/11112019` +
Expected: No transaction is added. Error details will be shown in the status message.

.. Other incorrect `in` commands to try: `in $/10.001 n/Allowance d/11112019`, `in $/1000 n/Allow@nce d/11112019`
(Contains non-alphanumeric characters). +
Expected: Similar to previous.

=== Adding an Out Transaction

. Adding an out transaction with the command: `out`

.. Prerequisites:

.. Test case: `out $/10 n/KFC d/11112019` +
Expected: An out transaction will be added into the list of transactions in the Transaction tab.

.. Test case: `out $/0 n/KFC d/11112019` +
Expected: No transaction is added. Error details will be shown in the status message.

.. Other incorrect `out` commands to try: `out $/10.001 n/KFC d/11112019`, `out $/10 n/KFC d/32112019`
(Date is invalid). +
Expected: Similar to previous.

=== Adding a Budget

. Adding a budget with the command: `set`

.. Prerequisites:

.. Test case: `set $/1000 c/Shopping d/31122019` +
Expected: A budget will be added into the list of budgets in the Budget tab.

.. Test case: `set $/1000 c/Shopping d/01012019` +
Expected: No budget is added. Error details will be shown in the status message.

.. Other incorrect `set` command to try: `set $/-10 c/Shopping d/31122019` (Amount is negative). +
Expected: Similar to previous.

=== Adding a Split Ledger

. Adding a split ledger with the command: `split`

.. Prerequisites:

.. Test case: `split $/1000 n/Amy n/Betty a/HaiDiLao` +
Expected: An overall ledger with 4 individual ledgers will be added into the list of ledgers in the Ledger tab.

.. Test case: `split $/1000 n/Amy n/Betty` +
Expected: No ledger is added. Error details will be shown in the status message.

.. Other incorrect `split` command to try: `split $/1000 n/Amy n/Betty a/HaiDiLao s/1 s/2 s/3 s/4`
(Greater number of shares than number of people). +
Expected: Similar to previous.

=== Adding a Receive Ledger

. Adding a receive ledger with the command: `receive`

.. Prerequisites:

.. Test case: `receive $/20 n/Albert` +
Expected: An overall ledger with an individual ledger will be added into the list of ledgers in the ledger tab.

.. Test case: `receive $/20 n/A|bert` +
Expected: No ledger is added. Error details will be shown in the status message.

.. Other incorrect `receive` command to try: `receive $/20.001 n/Albert` (Amount cannot have more than
two decimal places). +
Expected: Similar to previous.

=== Switching Tabs

. Switching tabs with the command: `view`

.. Prerequisites:

.. Test case: `view budget` +
Expected: Switches to budget tab if user is in another tab. Else, user remains in budget tab.

.. Test case: `view budg3t` +
Expected: Remains in current tab. Error details will be shown in the status message.

.. Other incorrect `view` command to try: `view loans` (Loans tab does not exist). +
Expected: Similar to previous.

=== Deleting an Entry

. Deleting an entry with the command: `delete`

.. Prerequisites:

.. Test case: `delete t1` +
Expected: First transaction is deleted from the list. Balance in the footer will be updated.

.. Test case: `delete t0` +
Expected: No transaction is deleted. Error details shown in the status message. Balance remains the same.

.. Other incorrect `delete` commands to try: `delete`, `delete t1000` (When size of the list of transaction
is smaller than 1000). +
Expected: Similar to previous.

=== Updating an Entry

. Updating an entry with the command: `update`

.. Prerequisites:

.. Test case: `update t1 $/1000` +
Expected: First transaction in the list is updated. Balance will be updated as well.

.. Test case: `update t0 $/1000` +
Expected: No transaction is updated. Error details shown in the status message. Balance remains the same.

.. Other incorrect `update` commands to try: `update`, `update i/Invalid` (Invalid prefix). +
Expected: Similar to previous.

=== Sorting the Transactions

. Sorting the transactions with the command: `sort`

Prerequisites:

=== Deleting a Person
.. Test case: `sort amount/a` +
Expected: Transaction list will be sorted from smallest amount to greatest amount. Balance remains the same.

. Deleting a person while all persons are listed
.. Test case: `sort amount` +
Expected: Transaction list remains unchanged. Error details shown in the status message.

.. Prerequisites: List all persons using the `list` command.
Multiple persons 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.
.. Test case: `delete 0` +
Expected: No person 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.
.. Other incorrect `sort` commands to try: `sort`, `sort date` (Order not stated). +
Expected: Similar to previous.


=== Viewing Help Window
Expand Down
Binary file added docs/DeveloperGuide.pdf
Binary file not shown.
Loading

0 comments on commit b6d0571

Please sign in to comment.