Skip to content

Commit

Permalink
Add author
Browse files Browse the repository at this point in the history
  • Loading branch information
sweijie24 committed Apr 13, 2024
1 parent 67259d5 commit d230222
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import java.util.Currency;

/**
* @@author sweijie24
*/
public class ChangeCurrencyCommand extends Command {

private Currency newCurrency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public ChangeCurrencyCommandCreator(String input, SavingList savings, ExpenseLis
* @param expenseList The ExpenseList containing expenses data.
* @param currencyConverter The CurrencyConverter object for currency conversion.
* @return A ChangeCurrencyCommand if the input is valid; otherwise, null.
* @author sweijie24
*/
public Command handleChangeCurrencyCommand(String input, SavingList savingList, ExpenseList expenseList,
SplitExpenseList splitExpenses,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private boolean isValidSavingsCategory(String category) {
* @param expenseList The ExpenseList containing expenses data.
* @param savingList The SavingList containing savings data.
* @return A ListCommand if the input is valid; otherwise, null.
* @author sweijie24
*/
public Command handleListCommand(String input, ExpenseList expenseList, SavingList savingList) {
assert input != null : "Input should not be null";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Map;
import java.util.logging.Logger;

//@author sweijie24
public class CurrencyConverter {

private static final Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
Expand Down Expand Up @@ -36,6 +37,7 @@ public CurrencyConverter() {
* @return The converted amount in the target currency.
* @throws IllegalArgumentException If exchange rates are not available for one or both currencies,
* or if exchange rates are not positive numbers.
* @author sweijie24
*/
public double convertAmount(double amount, Currency fromCurrency, Currency toCurrency) {
if (!exchangeRates.containsKey(fromCurrency) || !exchangeRates.containsKey(toCurrency)) {
Expand Down Expand Up @@ -77,6 +79,7 @@ public double convertAmount(double amount, Currency fromCurrency, Currency toCur
* @param newCurrency The new currency to convert expenses to.
* @param expenses The ExpenseList containing the expenses to be converted.
* @throws IllegalArgumentException If the ExpenseList is null.
* @author sweijie24
*/
public void convertExpenseCurrency(Currency newCurrency, ExpenseList expenses) {
if (expenses == null) {
Expand Down Expand Up @@ -146,6 +149,7 @@ public void convertSplitExpenseCurrency(Currency newCurrency, SplitExpenseList s
* @param newCurrency The new currency to convert savings to.
* @param savings The SavingList containing the savings to be converted.
* @throws IllegalArgumentException If the SavingList is null.
* @author sweijie24
*/
public void convertSavingCurrency(Currency newCurrency, SavingList savings) {
if (savings == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Currency;

//@author sweijie24
public class DefaultCurrency {

private static Currency defaultCurrency = Currency.getInstance("SGD");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/seedu/budgetbuddy/commons/Expense.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.LocalDate;

//@author sweijie24
public class Expense extends Transaction{
protected String description;
private LocalDate dateAdded;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/budgetbuddy/commons/ExpenseList.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public ArrayList<Expense> filterExpenses(String description, Double minAmount, D
* If no filter category is specified, all expenses are listed.
*
* @param filterCategory the category by which to filter the expenses (optional)
* @author sweijie24
*/
public void listExpenses(String filterCategory) {
LOGGER.info("Listing expenses...");
Expand Down Expand Up @@ -132,6 +133,7 @@ public void listExpenses(String filterCategory) {
*
* @return The total expenses.
* @throws IllegalArgumentException If any expense amount is negative.
* @author sweijie24
*/
public double calculateTotalExpenses() {
double totalExpenses = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/budgetbuddy/commons/Saving.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package seedu.budgetbuddy.commons;

//@author sweijie24
public class Saving extends Transaction{

public Saving(String category, double amount) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/budgetbuddy/commons/SavingList.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void findTotalSavings() {
*
* @param filterCategory The category to filter savings by (optional). If null, all savings are listed.
* @param expenseList The ExpenseList object containing the expenses to deduct from savings.
* @author sweijie24
*/
public void listSavings(String filterCategory, ExpenseList expenseList) {
LOGGER.info("Listing savings...");
Expand Down Expand Up @@ -116,6 +117,7 @@ public void listSavings(String filterCategory, ExpenseList expenseList) {
* @param initialAmount The initial amount of savings.
* @param totalExpenses The total amount of expenses to be deducted.
* @return The remaining savings amount after deducting total expenses.
* @author sweijie24
*/
public double calculateRemainingSavings(double initialAmount, double totalExpenses) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

//@@author sweijie24
public class ChangeCurrencyCommandCreatorTest {


Expand Down
1 change: 1 addition & 0 deletions src/test/java/seedu/budgetbuddy/CurrencyConverterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Currency;
import static org.junit.jupiter.api.Assertions.assertEquals;

//@@author sweijie24
public class CurrencyConverterTest {

@Test
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/seedu/budgetbuddy/ExpenseListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.util.ArrayList;


//@@author sweijie24
public class ExpenseListTest {

private static final Logger LOGGER = Logger.getLogger(ExpenseListTest.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

//@@author sweijie24
public class ListCommandCreatorTest {

@Test
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/seedu/budgetbuddy/SavingListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;


//@@author sweijie24
public class SavingListTest {

private static final Logger LOGGER = Logger.getLogger(SavingListTest.class.getName());
Expand Down

0 comments on commit d230222

Please sign in to comment.