Skip to content

Commit 21afb5c

Browse files
authored
Merge pull request #238 from AY1920S1-CS2103T-W12-3/develop-budget
Fix minor errors
2 parents c15a4df + ddb70df commit 21afb5c

File tree

6 files changed

+34
-10
lines changed

6 files changed

+34
-10
lines changed

docs/UserGuide.adoc

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ Examples:
108108

109109
=== Setting a Budget : `set`
110110

111-
You can set a budget for a particular category until a certain date, given it is not a duplicate.
111+
=== Setting a Budget : `set`
112+
113+
You can set a budget for a particular category until a certain date, given it is not already present in the budget list.
112114
A duplicate budget is a budget with the same `AMOUNT` and `DATE` and `CATEGORY`. +
113115
If you attempt to do so, you will receive an error message: `This budget already exists in the bank account`. +
114116

@@ -118,19 +120,41 @@ Format: `set $/AMOUNT d/DATE c/CATEGORY`
118120
* `AMOUNT` input accepts the new budget amount to be set. This amount must be non-negative, non-zero and
119121
less than 1,000,000.
120122
* `DATE` input accepts the deadline to be set. It cannot be a date in the past.
121-
* `CATEGORY` accepts the CATEGORY for the budget. A budget can be created without `CATEGORY` inputs.
123+
* `CATEGORY` accepts the CATEGORY for the budget. A budget can be created without `CATEGORY` inputs in which case, the budget will automatically be assigned `GENERAL' category.
122124
****
123125

124-
Example: Let's say you want to restrict your spending for a certain category until a certain deadline.
126+
Let's say you want to restrict your spending for a certain category until a certain deadline.
125127
PalPay allows you to set a budget and serve as a reminder to show how much of the budget set you have left
126-
until the deadline. (V1.4) You will be more self-conscious of your spending and minimise your spending by setting a budget. +
128+
until the deadline. You will be more self-conscious of your spending and minimise your spending by setting a budget. +
127129

128130
To set a new budget: +
129131
1. Type `set` and enter the relevant details (amount, deadline, category) in the format given above. +
130132
2. The result box will display the message "New budget successfully set". +
131133
3. If the budget already exists in the budget list, the result box will display the message "This budget already exists". +
132134
4. Now you can see the newly set budget in the budget list.
133135

136+
As you make an *OutTransaction* of a particular `CATEGORY`, your budgets with the same `CATEGORY` will be adjusted
137+
to display the remaining amount of budget. Other budgets in the list belonging to different `CATEGORY` will not be adjusted. +
138+
139+
If you overspend beyond a set budget, the overspent budget will be displayed in red.
140+
Shown below as budget index 3 is an example of an overspent budget:
141+
142+
.Overspent Budget
143+
image::overspentBudget.png[]
144+
145+
As the day you have set for the budget approaches, the countdown placeholder as well as the percentage remaining placeholder
146+
will turn to red when the number of remaining days reaches 3 and below.
147+
Shown below as budget index 4 is an example of a budget approaching its deadline:
148+
149+
.Budget approaching deadline
150+
image::approachingBudget.png[]
151+
152+
Examples:
153+
154+
* `set $/100 d/010120120 c/BBT`
155+
* `set $/300 d/29022020 c/shopping`
156+
157+
134158
=== Splitting a Bill with Friends : `split`
135159

136160
Split a bill with your friends +

docs/diagrams/DeleteSequenceDiagram.puml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ deactivate BankAccountParser
4848
LogicManager -> DeleteCommand : execute()
4949
activate DeleteCommand
5050

51-
DeleteCommand -> Model : deletePerson(1)
51+
DeleteCommand -> Model : deleteTransaction(1)
5252
activate Model
5353

5454
Model --> DeleteCommand

docs/diagrams/LogicClassDiagram.puml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package Logic {
88

99
package Parser {
1010
Interface Parser <<Interface>>
11-
Class AddressBookParser
11+
Class BankAccountParser
1212
Class XYZCommandParser
1313
Class CliSyntax
1414
Class ParserUtil
@@ -35,8 +35,8 @@ Class HiddenOutside #FFFFFF
3535
HiddenOutside ..> Logic
3636

3737
LogicManager .up.|> Logic
38-
LogicManager -->"1" AddressBookParser
39-
AddressBookParser .left.> XYZCommandParser: creates >
38+
LogicManager -->"1" BankAccountParser
39+
BankAccountParser .left.> XYZCommandParser: creates >
4040

4141
XYZCommandParser ..> XYZCommand : creates >
4242
XYZCommandParser ..|> Parser

docs/images/approachingBudget.png

67 KB
Loading

docs/images/overspentBudget.png

66.9 KB
Loading

src/main/java/seedu/address/logic/commands/DeleteCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public CommandResult execute(Model model) throws CommandException {
6363
ObservableList<Budget> lastShownList = model.getFilteredBudgetList();
6464

6565
if (targetIndex.getZeroBased() >= lastShownList.size()) {
66-
throw new CommandException(Messages.MESSAGE_INVALID_TRANSACTION_DISPLAYED_INDEX);
66+
throw new CommandException(Messages.MESSAGE_INVALID_BUDGET_DISPLAYED_INDEX);
6767
}
6868
//TODO: updateProjectionsAfterDelete(Budget budget)
6969
Budget budgetToDelete = lastShownList.get(targetIndex.getZeroBased());
@@ -76,7 +76,7 @@ public CommandResult execute(Model model) throws CommandException {
7676
ObservableList<Projection> lastShownList = model.getFilteredProjectionsList();
7777

7878
if (targetIndex.getZeroBased() >= lastShownList.size()) {
79-
throw new CommandException(Messages.MESSAGE_INVALID_TRANSACTION_DISPLAYED_INDEX);
79+
throw new CommandException(Messages.MESSAGE_INVALID_PROJECTION_DISPLAYED_INDEX);
8080
}
8181

8282
Projection projectionToDelete = lastShownList.get(targetIndex.getZeroBased());

0 commit comments

Comments
 (0)