Skip to content

Commit

Permalink
Merge branch 'master' into junRong-BugFixes-Rec
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/seedu/budgetbuddy/BudgetBuddy.java
#	src/main/java/seedu/budgetbuddy/command/ChangeCurrencyCommand.java
#	src/main/java/seedu/budgetbuddy/commons/CurrencyConverter.java
  • Loading branch information
itsmejr257 committed Apr 9, 2024
2 parents 2256aeb + 6d8264a commit 8235363
Show file tree
Hide file tree
Showing 43 changed files with 432 additions and 154 deletions.
1 change: 1 addition & 0 deletions data/DefaultCurrency.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Default Currency: SGD
2 changes: 2 additions & 0 deletions data/ExpenseFile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2024-04-07 | Transport | 100.00 | bus
2024-04-07 | Transport | 60.00 | train
17 changes: 14 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ following format: `set budget c/<Category> b/<Amount>`

##### Printing Budgets
The following UML Sequence diagram shows how `ListBudgetCommand` works when a user checks the budget status with the
command: `budget print`
command: `print budget`

<img alt="ListBSD2.png" height="400" src="ListBSD2.png" width="700"/>

Expand All @@ -79,7 +79,7 @@ The activity diagram provides an overview of the Budget Management feature's wor

1. The user types `set budget c/food b/500` to set a budget of $500 for the food category. The Parser class creates a
`SetBudgetCommand` object which calls `setBudget()` on the `ExpenseList` object.
2. To view budgets, the user enters `budget print`. The Parser class creates a `ListBudgetCommand` object. This command
2. To view budgets, the user enters `print budget`. The Parser class creates a `ListBudgetCommand` object. This command
retrieves the budgets using `getBudgets()` and displays them, also indicating any categories that are over budget.

## 1. Introduction
Expand Down Expand Up @@ -280,6 +280,17 @@ ExpenseList.


##### 3.6.8 DefaultCurrency
The `DefaultCurrency` class manages the application's default currency setting. It contains a static variable:

- `Currency defaultCurrency`: Holds the current default currency setting, initialized to the Singapore Dollar (SGD) using the `Currency.getInstance("SGD")` method.

The class provides two static methods:

- `getDefaultCurrency()`: Returns the `defaultCurrency` currently set for the application. This allows different parts of the application to retrieve the default currency consistently.

- `setDefaultCurrency(Currency currency)`: Assigns a new `Currency` object to `defaultCurrency`. This method enables the application to update the default currency based on user actions or preferences.

This class ensures a consistent default currency is used throughout the application, essential for functions like displaying amounts and performing currency conversions.

##### 3.6.9 CurrencyConverter
The `CurrencyConverter` class provides functionality for converting amounts between different currencies. It includes two class-level variables:
Expand Down Expand Up @@ -391,7 +402,7 @@ The Listing Savings feature follows these steps when a user inputs a command to
The UML Sequence diagram for the Listing Savings feature would illustrate the interactions between the `User`, `BudgetBuddy`, `Parser`, `ListSavingsCommand`, and `SavingList` classes, showing the method calls and returns between these objects to complete the operation.
![Sequence diagram for List Expense Feature](diagrams/SavingList_SequenceDiagram.png)

### Listing feature (List Expenses)
### Listing Feature (List Expenses)
The Listing Expenses Feature provides users with the ability to view their expenses, which can be filtered by category. The `ListExpenseCommand` class, generated by the `ListCommandCreator`, is responsible for this feature. The class utilizes the `ExpenseList` object to access and manipulate expense records, optionally applying a filter based on the category. The significance of the `ListExpenseCommand` class's attributes is outlined below:

| Class Attribute | Variable Type | Relevance |
Expand Down
73 changes: 60 additions & 13 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ to deal with finances on a singular platform with ease as long as you can type f

## Quick Start
1. Ensure that you have Java 11 installed.
2. Down the latest version of `BudgetBuddy` from [here](https://github.com/AY2324S2-CS2113-T12-3/tp/releases/tag/v2.0).
2. Download the latest version of `BudgetBuddy` from [here](https://github.com/AY2324S2-CS2113-T12-3/tp/releases/tag/v2.0).
3. Copy the file to the folder you want to use as the home folder.
4. Open command terminal, ``cd`` into the folder you put your jar file in, and use the `java -jar BudgetBuddy.jar` command to run the application.
4. Open command terminal, ``cd`` into the folder you put your jar file in, and use the `java -jar BudgetBuddy.jar`
command to run the application.


## Features
Expand Down Expand Up @@ -46,8 +47,8 @@ Displays the corresponding features of BudgetBuddy

Format: `menu [INDEX]`

* The `INDEX` refers to the number associated with each menu option. If `INDEX` is not provided, the overall
menu list will be displayed
* The `INDEX` refers to the number associated with each menu option. If `INDEX` is not provided **OR**
is of value `0`, the overall menu list will be displayed
* `INDEX` must be either be empty OR a positive integer and a valid index in the menu list

Example of usage:
Expand Down Expand Up @@ -109,7 +110,11 @@ Format: `edit savings c/CATEGORY i/INDEX a/AMOUNT`

Example of usage:

`edit savings c/Entertainment i/3 a/300`
`edit savings c/Salary i/2 a/180 d/Monthly Salary`

Expected Output:

`Saving edited successfully.`

### Edit Expenses: `edit expense`
Edit expenses that have been added previously.
Expand All @@ -124,7 +129,11 @@ Format: `edit expense c/CATEGORY i/INDEX a/AMOUNT d/DESCRIPTION`

Example of usage:

`edit expense c/Utility i/2 a/180 d/Household Electricity`
`edit expense c/Entertainment i/3 a/30 d/movie`

Expected Output:

`Expense edited successfully.`

### Reduce Savings: `reduce savings`

Expand Down Expand Up @@ -168,35 +177,65 @@ Format: `list savings CATEGORY`
* The `CATEGORY` must be a pre-existing category if inputted.
* Similar to listing expenses, users can view their savings with optional category filtering.
* Savings are listed along with their respective categories and amounts.
* Filtered Categories will only display savings with that Category.
* **DOES NOT** affect total savings.
* If there are no listings with the filtered category, nothing will be shown.
* Total savings are displayed at the end of the list, after deducting relevant expenditures.
* **NOT** affected by filtered categories. (i.e will ignore filter category when calculating overall remaining amount)
* Currency of listed savings is stated at the top.

Example Usage:

`list savings`
`list savings Salary`
`list savings Investment`

Expected Output (Empty Saving List) :
![ListSavings_EmptySaving.PNG](userguideimages/ListSavings_EmptySaving.PNG)

Expected Output (Empty Expense List) :
![ListSavings_EmptyExpense.PNG](userguideimages/ListSavings_EmptyExpense.PNG)

Expected Output (Expense Recorded) :
![ListSavings_ExpenseRecorded.PNG](userguideimages/ListSavings_ExpenseRecorded.PNG)

Expected Output (Filtered Category) :
![ListSavings_FilterCategory.PNG](userguideimages/ListSavings_FilterCategory.PNG)

### Listing Expenses: `list expense`

### Listing Expenses: `list expenses`

Lists expenses

Format: `list expense CATEGORY`
Format: `list expenses CATEGORY`

* The `CATEGORY` is optional and can be left blank.
* The `CATEGORY` must be a pre-existing category if inputted.
* When listing expenses, users have the option to filter expenses based on categories.
* Users can specify a category to view expenses related to that category only.
* If no category is specified, the system will list all expenses.
* Index is **NOT** affected so as to facilitate easier identification for deletion.
* If no category is specified, the system will list all expenses.
* If there are no listings with the filtered category, nothing will be shown.
* The listed expenses include details such as the date of the expense, category, amount, and description.
* Total expenses are displayed at the end of the list.
* **NOT** affected by filtered categories. (i.e Filtered Category still displays overall total expenses.)
* Currency of listed expenses is stated at the top.

Example Usage:

`list expenses`
`list expenses Transport`
`list expenses Housing`

Expected Output (Empty Expense List) :
![ListSavings_EmptyExpense.PNG](userguideimages/ListSavings_EmptyExpense.PNG)

Expected Output (Expense Recorded):
![ListExpenses_ExpenseRecorded.PNG](userguideimages/ListExpenses_ExpenseRecorded.PNG)

Expected Output (Filtered Category) :
![ListExpenses_FilteredCategory.PNG](userguideimages/ListExpenses_FilteredCategory.PNG)

### Check splitted expenses `check splitted expenses`

Check expenses
Expand Down Expand Up @@ -354,11 +393,19 @@ Format : `change currency [CURRENCY_CODE]`
* `CURRENCY_CODE` cannot be null.
* Conversion of Currency is interchangeable (e.g. SGD -> USD -> JPY).
* Future additions to Expenses/Savings will be using the current currency displayed.
* (i.e. **ALL** Expenses/Savings will be converted to the new currency.)
* Currency Icon will standardise to use universal `$`.

Examples of usage:

`change currency USD` : Converts current currency into USD

Expected Output (SGD -> USD) :
![CurrencyConverter_ChangeUSD.PNG](userguideimages%2FCurrencyConverter_ChangeUSD.PNG)

Expected Output (USD -> USD) :
![CurrencyConverter_SameCurrency.PNG](userguideimages%2FCurrencyConverter_SameCurrency.PNG)

### Setting Budgets:

Sets budget for specified category
Expand Down Expand Up @@ -391,7 +438,7 @@ in transport category in ascending order, and shows % of budget taken up by each
* If any of the budgets have been exceeded, will be displayed in another table (Table 2)
* Table 2 contains categories that exceeded budget and amount exceeded.

Format: `budget print`
Format: `print budget`


### Get Graphical Insights for expenses: `get expenses insights`
Expand Down Expand Up @@ -438,13 +485,13 @@ Advanced users are welcome to update the data directly by editing this file. How
* Add Expense: `add expense c/CATEGORY a/AMOUNT d/DESCRIPTION`
* Edit Expenses `edit expense c/CATEGORY i/INDEX a/AMOUNT d/DESCRIPTION`
* Edit Savings `edit savings c/CATEGORY i/INDEX a/AMOUNT`
* List Expenses: `list expenses CATEGORY`
* List Savings: `list savings CATEGORY`
* List Expenses: `list expenses [CATEGORY]`
* List Savings: `list savings [CATEGORY]`
* Find Expenses `find expenses [d/DESCRIPTION] [morethan/MINAMOUNT] [lessthan/MAXAMOUNT]`
* Change Currency `change currency [CURRENCY_CODE]`
* Set Budget `set budget c/CATEGORY b/BUDGET`
* Get Budget `get budget c/CATEGORY`
* Print Budgets `budget print`
* Print Budgets `print budget`
* Get Graphical Insights for expenses `get expenses insights`
* Get Graphical Insights for savings `get savings insights`

Binary file modified docs/diagrams/CurrencyConverter_SequenceDiagram.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/diagrams/ExpenseList_SequenceDiagram.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/diagrams/SavingList_SequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions docs/team/EditExpenseSequence.puml

This file was deleted.

6 changes: 0 additions & 6 deletions docs/team/johndoe.md

This file was deleted.

54 changes: 54 additions & 0 deletions docs/team/sweijie24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Wei Jie's Project Portfolio Page

## Project: BudgetBuddy

**BudgetBuddy** is a product for users who wish to handle and track any current/future expenses on a singular platform.
BudgetBuddy provides a faster and more efficient way to track and calculate expenses and provides the ability
to deal with finances on a singular platform with ease as long as you can type fast.

Given below are my contributions to the project.

### New Features

#### Listing Saving/Expense Feature
- **What it does**: Displays a list of all savings/expenses inputted by the user. Allows the user to view expenses/savings spent/earned so far based on his/her inputs. Also allows user to view remaining amount left in savings after deducting expenses.
- **Justification**: This is a basic essential feature surrounding the core functionality of our product.
- **Highlights**: The in-built calculation of remaining savings provides easy accessibility to information without the need for external calculation devices.

#### Currency Converter Feature
- **What it does**: Converts currently listed and future expenses/savings into another currency of choice listed in the User Guide. This feature ties in with my Listing feature to view the currency changes.
- **Justification**: This feature is greatly beneficial for users who travel frequently and often stay in foreign countries for a period of time. It allows them to track their expenses/savings regardless of their location. Additionally, one can also check how much their savings are worth if they plan to travel to another country in the future.
- **Highlights**: The user is able to convert interchangeably between the countries listed, providing greater convenience.

### Code Contributed
[RepoSense link](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=sweijie24&breakdown=true&sort=groupTitle%20dsc&sortWithin=title&since=2024-02-23&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other).

### Project Management
- Managed Issue Tracker Assignment from PE-D for v2.1 on GitHub.

### Enhancements to Existing Features
- Implemented Loading/Saving for Currency Codes to remain persistent. (Pull Requests : [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).
- Implemented JUnit tests for existing features to improve test coverage. (Pull Requests : [#43](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/43), [#62](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/62)).
- Implemented Logging/Assertions for improved error handling. (Pull Requests : [#43](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/43), [#62](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/62)).
- Refactor features to use more OOP. (Pull Requests : [#89](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/89), [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).

### Documentation

#### User Guide
- Added documentation for the features `Listing Savings`, `Listing Expenses` and `Changing Currencies`. (Pull Requests : [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).

#### Developer Guide
- Added implementation details of the `Listing Savings`, `Listing Expenses` and `Currency Converter` feature. (Pull Requests : [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).
- Added design details of the `Expense`, `Saving`, `ExpenseList`, `SavingList`, `DefaultCurrency` and `CurrencyConverter` classes. (Pull Requests : [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).
- Added user stories for my respective features. (Pull Requests : [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).
- Added Sequence Diagrams for `Listing Savings`, `Listing Expenses` and `Currency Converter` features. (Pull Requests : [#107](https://github.com/AY2324S2-CS2113-T12-3/tp/pull/107)).

### Community

#### Reported Bugs and Suggestions for Other Teams
- Provided 4 DG Peer Review Comments for another team. ([Team #1](https://github.com/nus-cs2113-AY2324S2/tp/pull/30)).
- Reported 13 Bugs for another team during PE-D. ([Team #1](https://github.com/nus-cs2113-AY2324S2/tp/pull/7)).

### Tools
- Usage of Draw.io for my Sequence Diagrams. ([Draw.io](https://draw.io/)).

30 changes: 30 additions & 0 deletions docs/team/yyangdaa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Zhang Yangda - Project Portfolio Page

## Overview
BudgetBuddy is a finance-tracking application designed for users seeking a centralized platform to manage and
monitor their finances. Tailored for individuals who value efficiency, BudgetBuddy simplifies the process of
tracking and calculating expenses. Its user-friendly interface caters to fast typists, making financial management
both quick and intuitive.
### Summary of Contributions
Given below are my contributions to the project

#### New Feature : Add Expense and Add Savings

1. What it does : Allows user to add expense and savings to the app for users to monitor their spending habits
and savings growth over time.
2. Justification : Users can save their spendings and savings.

#### New Feature : Add SplitExpense, List SplitExpense, and Settle SplitExpense
1. What is does : Allows users to add expenses that are meant to be split amoung friends. Allows users to check the
added list of expenses that are to be among the friends. The users can also settle the expense once others have paid.
2. Justification : This enhancement simplifies the task of tracking shared expenses, making it easier for users to
manage shared activities without the hassle of manual calculations.

#### Code Contributed
[RepoSenseLink](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=yyangdaa&breakdown=true&sort=groupTitle
%20dsc&sortWithin=title&since=2024-02-23&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=
docs~functional-code~test-code~other)

#### Enhancements to existing features:
1. Wrote JUnit tests for the ExpenseList, SavingsList, SplitExpenseList and Parser.

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.
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 added docs/userguideimages/ListSavings_EmptyExpense.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 added docs/userguideimages/ListSavings_EmptySaving.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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/main/java/seedu/budgetbuddy/BudgetBuddy.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void handleCommands(String input) {
expensesStorage.saveExpenses(expenses.getExpenses());
savingsStorage.saveSavings(savings.getSavings());
recurringExpensesStorage.saveRecurringExpenses(recurringExpenseLists);
// Save Currency

defaultCurrency.saveCurrency();
} catch (IOException e) {
System.out.println("Error saving to file.");
Expand All @@ -68,7 +68,6 @@ public void run() {
Scanner scanner = new Scanner(System.in);

try {
// Load Currency
defaultCurrency.loadCurrency();
this.expenses.getExpenses().addAll(expensesStorage.loadExpenses());
this.savings.getSavings().addAll(savingsStorage.loadSavings());
Expand Down
Loading

0 comments on commit 8235363

Please sign in to comment.