Skip to content

Commit

Permalink
Merge pull request #77 from sp4ce-cowboy/branch-REFACTOR_ALL
Browse files Browse the repository at this point in the history
Refactor seedu.address package to unicash
  • Loading branch information
sp4ce-cowboy authored Oct 18, 2023
2 parents 08a8c37 + e34e80e commit 78d3181
Show file tree
Hide file tree
Showing 152 changed files with 857 additions and 853 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'jacoco'
}

mainClassName = 'seedu.address.Main'
mainClassName = 'unicash.Main'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down Expand Up @@ -66,7 +66,7 @@ dependencies {
}

shadowJar {
archiveFileName = 'addressbook.jar'
archiveFileName = 'unicash.jar'
}

defaultTasks 'clean', 'test'
2 changes: 1 addition & 1 deletion docs/SettingUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you plan to use Intellij IDEA (highly recommended):
1. **Import the project as a Gradle project**: Follow the guide [_[se-edu/guides] IDEA: Importing a Gradle project_](https://se-education.org/guides/tutorials/intellijImportGradleProject.html) to import the project into IDEA.<br>
:exclamation: Note: Importing a Gradle project is slightly different from importing a normal Java project.
1. **Verify the setup**:
1. Run the `seedu.address.Main` and try a few commands.
1. Run the `seedu.address.Main` [OR] `unicash.Main` and try a few commands.
1. [Run the tests](Testing.md) to ensure they all pass.

--------------------------------------------------------------------------------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions docs/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ This project has three types of tests:

1. *Unit tests* targeting the lowest level methods/classes.<br>
e.g. `seedu.address.commons.StringUtilTest`
1. *Integration tests* that are checking the integration of multiple code units (those code units are assumed to be working).<br>
e.g. `seedu.address.storage.StorageManagerTest`
1. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.<br>
e.g. `unicash.commons.util.StringUtilTest`
2. *Integration tests* that are checking the integration of multiple code units (those code units are assumed to be working).<br>
e.g. `seedu.address.storage.StorageManagerTest`
e.g `unicash.storage.StorageManagerTest`
3. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.<br>
e.g. `seedu.address.logic.LogicManagerTest`
e.g. `unicash.logic.LogicManagerTest`
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package unicash;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -7,9 +7,9 @@
import java.util.logging.Logger;

import javafx.application.Application;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.util.FileUtil;
import seedu.address.commons.util.ToStringBuilder;
import unicash.commons.core.LogsCenter;
import unicash.commons.util.FileUtil;
import unicash.commons.util.ToStringBuilder;

/**
* Represents the parsed command-line parameters given to the application.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package seedu.address;
package unicash;

import java.util.logging.Logger;

import javafx.application.Application;
import seedu.address.commons.core.LogsCenter;
import unicash.commons.core.LogsCenter;

/**
* The main entry point to the application.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package unicash;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -7,29 +7,29 @@

import javafx.application.Application;
import javafx.stage.Stage;
import seedu.address.commons.core.Config;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.core.Version;
import seedu.address.commons.exceptions.DataLoadingException;
import seedu.address.commons.util.ConfigUtil;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.Logic;
import seedu.address.logic.LogicManager;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.ReadOnlyUniCash;
import seedu.address.model.ReadOnlyUserPrefs;
import seedu.address.model.UniCash;
import seedu.address.model.UserPrefs;
import seedu.address.model.util.SampleDataUtil;
import seedu.address.storage.JsonUniCashStorage;
import seedu.address.storage.JsonUserPrefsStorage;
import seedu.address.storage.Storage;
import seedu.address.storage.StorageManager;
import seedu.address.storage.UniCashStorage;
import seedu.address.storage.UserPrefsStorage;
import seedu.address.ui.Ui;
import seedu.address.ui.UiManager;
import unicash.commons.core.Config;
import unicash.commons.core.LogsCenter;
import unicash.commons.core.Version;
import unicash.commons.exceptions.DataLoadingException;
import unicash.commons.util.ConfigUtil;
import unicash.commons.util.StringUtil;
import unicash.logic.Logic;
import unicash.logic.LogicManager;
import unicash.model.Model;
import unicash.model.ModelManager;
import unicash.model.ReadOnlyUniCash;
import unicash.model.ReadOnlyUserPrefs;
import unicash.model.UniCash;
import unicash.model.UserPrefs;
import unicash.model.util.SampleDataUtil;
import unicash.storage.JsonUniCashStorage;
import unicash.storage.JsonUserPrefsStorage;
import unicash.storage.Storage;
import unicash.storage.StorageManager;
import unicash.storage.UniCashStorage;
import unicash.storage.UserPrefsStorage;
import unicash.ui.Ui;
import unicash.ui.UiManager;

/**
* Runs the application.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package seedu.address.commons.core;
package unicash.commons.core;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.logging.Level;

import seedu.address.commons.util.ToStringBuilder;
import unicash.commons.util.ToStringBuilder;

/**
* Config values used by the app
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package seedu.address.commons.core;
package unicash.commons.core;

import java.awt.Point;
import java.io.Serializable;
import java.util.Objects;

import seedu.address.commons.util.ToStringBuilder;
import unicash.commons.util.ToStringBuilder;

/**
* A Serializable class that contains the GUI settings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package unicash.commons.core;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package unicash.commons.core;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package seedu.address.commons.core.index;
package unicash.commons.core.index;

import seedu.address.commons.util.ToStringBuilder;
import unicash.commons.util.ToStringBuilder;

/**
* Represents a zero-based or one-based index.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.enums;
package unicash.commons.enums;

import java.util.Arrays;
import java.util.StringJoiner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.exceptions;
package unicash.commons.exceptions;

/**
* Represents an error during loading of data from a file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.exceptions;
package unicash.commons.exceptions;

/**
* Signals that some given data does not fulfill some constraints.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package seedu.address.commons.util;
package unicash.commons.util;

import static java.util.Objects.requireNonNull;

import javafx.scene.image.Image;
import seedu.address.MainApp;
import unicash.MainApp;

/**
* A container for App specific utility functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package unicash.commons.util;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package seedu.address.commons.util;
package unicash.commons.util;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Optional;

import seedu.address.commons.core.Config;
import seedu.address.commons.exceptions.DataLoadingException;
import unicash.commons.core.Config;
import unicash.commons.exceptions.DataLoadingException;

/**
* A class for accessing the Config File.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package unicash.commons.util;

import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package unicash.commons.util;

import static java.util.Objects.requireNonNull;

Expand All @@ -20,8 +20,8 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.exceptions.DataLoadingException;
import unicash.commons.core.LogsCenter;
import unicash.commons.exceptions.DataLoadingException;

/**
* Converts a Java object instance to JSON and vice versa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package seedu.address.commons.util;
package unicash.commons.util;

import static java.util.Objects.requireNonNull;
import static seedu.address.commons.util.AppUtil.checkArgument;
import static unicash.commons.util.AppUtil.checkArgument;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package unicash.commons.util;

/**
* Builds a string representation of an object that is suitable as the return value of {@link Object#toString()}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package seedu.address.logic;
package unicash.logic;

import java.nio.file.Path;

import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.transaction.Transaction;
import unicash.commons.core.GuiSettings;
import unicash.logic.commands.CommandResult;
import unicash.logic.commands.exceptions.CommandException;
import unicash.logic.parser.exceptions.ParseException;
import unicash.model.transaction.Transaction;

/**
* API of the Logic component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package seedu.address.logic;
package unicash.logic;

import java.io.IOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.Path;
import java.util.logging.Logger;

import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.AddressBookParser;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.Model;
import seedu.address.model.transaction.Transaction;
import seedu.address.storage.Storage;
import unicash.commons.core.GuiSettings;
import unicash.commons.core.LogsCenter;
import unicash.logic.commands.Command;
import unicash.logic.commands.CommandResult;
import unicash.logic.commands.exceptions.CommandException;
import unicash.logic.parser.AddressBookParser;
import unicash.logic.parser.exceptions.ParseException;
import unicash.model.Model;
import unicash.model.transaction.Transaction;
import unicash.storage.Storage;

/**
* The main LogicManager of the app.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package seedu.address.logic;
package unicash.logic;

import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import seedu.address.logic.parser.Prefix;
import seedu.address.model.transaction.Transaction;
import unicash.logic.parser.Prefix;
import unicash.model.transaction.Transaction;

/**
* Container for user visible messages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package seedu.address.logic.commands;
package unicash.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_AMOUNT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CATEGORY;
import static seedu.address.logic.parser.CliSyntax.PREFIX_DATETIME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_LOCATION;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TYPE;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.UniCashMessages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.transaction.Transaction;
import unicash.commons.util.ToStringBuilder;
import unicash.logic.UniCashMessages;
import unicash.logic.commands.exceptions.CommandException;
import unicash.logic.parser.CliSyntax;
import unicash.model.Model;
import unicash.model.transaction.Transaction;


/**
* Adds a transaction to UniCash.
Expand All @@ -22,19 +18,19 @@ public class AddTransactionCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a transaction to UniCash. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_TYPE + "TYPE "
+ PREFIX_AMOUNT + "AMOUNT "
+ PREFIX_DATETIME + "DATETIME "
+ PREFIX_LOCATION + "LOCATION "
+ "[" + PREFIX_CATEGORY + "CATEGORY]...\n"
+ CliSyntax.PREFIX_NAME + "NAME "
+ CliSyntax.PREFIX_TYPE + "TYPE "
+ CliSyntax.PREFIX_AMOUNT + "AMOUNT "
+ CliSyntax.PREFIX_DATETIME + "DATETIME "
+ CliSyntax.PREFIX_LOCATION + "LOCATION "
+ "[" + CliSyntax.PREFIX_CATEGORY + "CATEGORY]...\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "Buying groceries "
+ PREFIX_TYPE + "expense "
+ PREFIX_AMOUNT + "300 "
+ PREFIX_DATETIME + "18-08-2001 19:30 "
+ PREFIX_LOCATION + "ntuc"
+ PREFIX_CATEGORY + "household expenses";
+ CliSyntax.PREFIX_NAME + "Buying groceries "
+ CliSyntax.PREFIX_TYPE + "expense "
+ CliSyntax.PREFIX_AMOUNT + "300 "
+ CliSyntax.PREFIX_DATETIME + "18-08-2001 19:30 "
+ CliSyntax.PREFIX_LOCATION + "ntuc"
+ CliSyntax.PREFIX_CATEGORY + "household expenses";

public static final String MESSAGE_SUCCESS = "New transaction added: %1$s";

Expand Down
Loading

0 comments on commit 78d3181

Please sign in to comment.