diff --git a/.gitignore b/.gitignore index 2873e189e1..309e34f4c1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,13 @@ /.idea/ /out/ /*.iml - # Gradle build files /.gradle/ /build/ src/main/resources/docs/ - +# Any other files that should not be committed +/data +*.jar # MacOS custom attributes files created by Finder .DS_Store *.iml diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..57eaf39ca6 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: seedu.brokeMan.BrokeMan + diff --git a/README.md b/README.md index f82e2494b7..77ab65e4d5 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,27 @@ -# Duke project template +# BrokeMan -This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it. +``` +$$$$$___ ______ _______ $$_____ _______ $$___$$_ _______ _______ +$$__$$__ ______ _______ $$__$$_ _$$$$__ $$$_$$$_ $$$$$__ _______ +$$$$$___ $$_$$_ _$$$$__ $$_$$__ $$__$$_ $$$$$$$_ ____$$_ $$$$$__ +$$___$$_ $$$_$_ $$__$$_ $$$$___ $$$$$$_ $$_$_$$_ _$$$$$_ $$__$$_ +$$___$$_ $$____ $$__$$_ $$_$$__ $$_____ $$___$$_ $$__$$_ $$__$$_ +$$$$$$__ $$____ _$$$$__ $$__$$_ _$$$$$_ $$___$$_ _$$$$$_ $$__$$_ +``` -## Setting up in Intellij +Welcome to BrokeMan! -Prerequisites: JDK 11 (use the exact version), update Intellij to the most recent version. +Your personal budget manager to prevent you to become broke like me... -1. **Ensure Intellij JDK 11 is defined as an SDK**, as described [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk) -- this step is not needed if you have used JDK 11 in a previous Intellij project. -1. **Import the project _as a Gradle project_**, as described [here](https://se-education.org/guides/tutorials/intellijImportGradleProject.html). -1. **Verify the set up**: After the importing is complete, locate the `src/main/java/seedu/duke/Duke.java` file, right-click it, and choose `Run Duke.main()`. If the setup is correct, you should see something like the below: - ``` - > Task :compileJava - > Task :processResources NO-SOURCE - > Task :classes - - > Task :Duke.main() - Hello from - ____ _ - | _ \ _ _| | _____ - | | | | | | | |/ / _ \ - | |_| | |_| | < __/ - |____/ \__,_|_|\_\___| - - What is your name? - ``` - Type some word and press enter to let the execution proceed to the end. +If you are a fast typer, this CLI based program will help you track your financial status much faster than the traditional UI based apps! -## Build automation using Gradle +--- -* This project uses Gradle for build automation and dependency management. It includes a basic build script as well (i.e. the `build.gradle` file). -* If you are new to Gradle, refer to the [Gradle Tutorial at se-education.org/guides](https://se-education.org/guides/tutorials/gradle.html). - -## Testing - -### I/O redirection tests - -* To run _I/O redirection_ tests (aka _Text UI tests_), navigate to the `text-ui-test` and run the `runtest(.bat/.sh)` script. - -### JUnit tests - -* A skeleton JUnit test (`src/test/java/seedu/duke/DukeTest.java`) is provided with this project template. -* If you are new to JUnit, refer to the [JUnit Tutorial at se-education.org/guides](https://se-education.org/guides/tutorials/junit.html). - -## Checkstyle - -* A sample CheckStyle rule configuration is provided in this project. -* If you are new to Checkstyle, refer to the [Checkstyle Tutorial at se-education.org/guides](https://se-education.org/guides/tutorials/checkstyle.html). - -## CI using GitHub Actions - -The project uses [GitHub actions](https://github.com/features/actions) for CI. When you push a commit to this repo or PR against it, GitHub actions will run automatically to build and verify the code as updated by the commit/PR. - -## Documentation - -`/docs` folder contains a skeleton version of the project documentation. - -Steps for publishing documentation to the public: -1. If you are using this project template for an individual project, go your fork on GitHub.
- If you are using this project template for a team project, go to the team fork on GitHub. -1. Click on the `settings` tab. -1. Scroll down to the `GitHub Pages` section. -1. Set the `source` as `master branch /docs folder`. -1. Optionally, use the `choose a theme` button to choose a theme for your documentation. +Useful links: +* [User Guide](docs/UserGuide.md) +* [Developer Guide](docs/DeveloperGuide.md) +* [About Us](docs/AboutUs.md) +* [Yu Sichen Sistine PPP](docs/team/sistine-yu.md) +* [Sangjun Nam PPP](docs/team/namsengi11.md) +* [Samuel Tan PPP](docs/team/samueltansw.md) +* [Liam PPP](docs/team/speciliam.md) diff --git a/build.gradle b/build.gradle index d5e548e85f..f7659eaa66 100644 --- a/build.gradle +++ b/build.gradle @@ -1,46 +1,47 @@ -plugins { - id 'java' - id 'application' - id 'checkstyle' - id 'com.github.johnrengelman.shadow' version '7.1.2' -} - -repositories { - mavenCentral() -} - -dependencies { - testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0' - testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0' -} - -test { - useJUnitPlatform() - - testLogging { - events "passed", "skipped", "failed" - - showExceptions true - exceptionFormat "full" - showCauses true - showStackTraces true - showStandardStreams = false - } -} - -application { - mainClass = "seedu.duke.Duke" -} - -shadowJar { - archiveBaseName = "duke" - archiveClassifier = null -} - -checkstyle { - toolVersion = '10.2' -} - -run{ - standardInput = System.in -} +plugins { + id 'java' + id 'application' + id 'checkstyle' + id 'com.github.johnrengelman.shadow' version '7.1.2' +} + +repositories { + mavenCentral() +} + +dependencies { + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0' + testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0' +} + +test { + useJUnitPlatform() + + testLogging { + events "passed", "skipped", "failed" + + showExceptions true + exceptionFormat "full" + showCauses true + showStackTraces true + showStandardStreams = false + } +} + +application { + mainClass = "seedu.brokeMan.BrokeMan" +} + +shadowJar { + archiveBaseName = "brokeMan" + archiveClassifier = null +} + +checkstyle { + toolVersion = '10.2' +} + +run{ + standardInput = System.in + enableAssertions = true +} diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 0f072953ea..84936ce310 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -1,9 +1,8 @@ -# About us - -Display | Name | Github Profile | Portfolio ---------|:----:|:--------------:|:---------: -![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) +# About us + +| Display | Name | Github Profile | Portfolio | +|------------------------------|:------------------:|:-----------------------------:|:----------------------------------:| +| | Yu Sichen | [Github](https://github.com/sistine-yu) | [Portfolio](./team/sistine-yu.md) | +| | Liam Van | [Github](https://github.com/SpeciLiam) | [Portfolio](./team/speciliam.md) | +| ![](./teamImages/samuel.jpg) | Samuel Tan Sze Wee | [Github](https://github.com/Samueltansw) | [Portfolio](./team/samueltansw.md) | +| | Sangjun Nam | [Github](https://github.com/namsengi11) | [Portfolio](./team/namsengi11.md) | diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 64e1f0ed2b..68e469446f 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,38 +1,489 @@ # Developer Guide +## Table of Contents + +1. [Acknowledgements](#acknowledgements) +2. [Design](#design) + - [Architecture](#architecture) + - [UI component](#ui-component) + - [Parser component](#parser-component) + - [Command component](#command-component) + - [Save component](#save-component) + - [EntryList Component](#entrylist-component) + - [Budget Component](#budget-component) + - [Common class](#common-class) + - [Exception classes](#exception-classes) +3. [Implementation](#implementation) + - [Entry](#entry) + - [EntryList](#entrylist) + - [ExpenseList, IncomeList](#expenselist-incomelist) + - [Budget](#budget) + - [SaveExpense, SaveIncome, SaveBudget](#saveexpense-saveincome-savebudget) + - [Wishlist (COMING SOON)](#wishlist-coming-soon) + - [Spending Advisor (COMING SOON)](#spending-advisor-coming-soon) +4. [Appendix: Requirements](#appendix-requirements) + - [Product Scope](#product-scope) + - [User Stories](#user-stories) + - [Use cases](#use-cases) +5. [Appendix: Instructions for manual testing](#appendix-instructions-for-manual-testing) + +--- + ## Acknowledgements -{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} +Below are links to the codes that this program has partly referenced and adapted from. + +- [addressbook-level2](https://github.com/se-edu/addressbook-level2) +- [addressbook-level3](https://github.com/se-edu/addressbook-level3) + +[back to contents](#table-of-contents) + +--- + +## Design + +### Architecture + +![Architecture Diagram](./images/ArchitectureDiagram.png) + +The ***architecture diagram*** given above explains the high level design of the program. + +Given below is a quick overview of the main components and how they interact with each other. + +**Main components of architecture** + +`BrokeMan` has one class [`Main`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/BrokeMan.java), which is responsible for: +- At program launch: Initialises the components in the correct sequence, and connect them up with each other +- At program termination: Shuts down the components and invokes cleanup methods where necessary. + +[`Common`](#common-class) represents a collection of messages used by multiple other components. +[`Exception`](#exception-classes) represents a collection of custom exceptions used by multiple other components. + +The rest of the program consists of mainly 5 main components. +- [`Ui`](#ui-component): The Ui of the program. +- [`Parser`](#parser-component): The user input parser. +- [`Command`](#command-component): The command executor. +- [`Save`](#save-component): Reads data from, and writes data to hard disk. +- [`EntryList`](#entrylist-component): The abstract class (with subclasses `IncomeList` and `ExpenseList`) that contains +an `Entry` of linkedList which stores +the list of entries (incomes / expenses) and its method when program is running. +- [`Budget`](#budget-component) : Stores the list of budget amounts in `budgetEachMonth` and its methods when program is running. + +**How the architecture components interact with each other** + +The program will first load the content of the .txt files in the `Data` folder if exists, +and populate the `incomeList`, `expenseList`, and `budgetEachMonth`. The `user`'s interactions with +the `Ui` will be parsed to the `Command` using the `Parser`, and the `parser` will then return the `Command` object +specified, which the `Ui` can execute and format the output to the `user`. When the `user` exits the program, the `Save` +command will be executed and the content in the `entryList` (more specifically `incomeList`, `expenseList`) from `EntryList`, and `budgetEachMonth` from `Budget` will then be +stored into their respective .txt files in the `Data` folder. + +[back to contents](#table-of-contents) + +--- + +### Ui component + +The **API** of this component is specified in [`Ui.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/ui/Ui.java) + +Below is the UML diagram for Ui class: + +![UiClassDiagram](./images/UiClassDiagram.png) + +The Ui consists of methods to read inputs from user and to format the outputs to be displayed to the user. + +[back to contents](#table-of-contents) + +### Parser component + +The **API** of this component is specified in [`Parser.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/parser/Parser.java) + +Below is the UML diagram for Parser class: + +![ParserClassDiagram](./images/ParserClassDiagram.png) + +How the `Parser` component works: +1. When the `BrokeMan` class calls the `Parser` class to execute a command using the `parseCommand` method. +2. The `parseCommand` method uses `UserInput` class to split the user input in two, command input and description of command. +3. Depending on the command input, the `parseCommand` method will call its respective `prepareXCommand` (i.e, `prepareDeleteExpenseCommand`). +4. Whenever invalid inputs are given by the user, parser will throw appropriate exceptions, where it will catch itself and return a `InvalidCommand`. +5. The `prepareXCommand` will then return the respective Command object (i.e, `deleteExpenseCommand`) back to the `parseCommand` method and then to the `BrokeMan` class. + +[back to contents](#table-of-contents) + +--- + +### Command component + +The `Command` component consists of many `Command` classes that executes different commands of the program +when called. It is stored in the [`seedu.brokeMan.command`](https://github.com/AY2223S2-CS2113-F13-2/tp/tree/master/src/main/java/seedu/brokeMan/command) package. + +The sequence diagram below shows how the components interact with each other for the scenarios where the user +issues the commands `deleteExpense 1` and `exit`. + +![DeleteCommandSequenceDiagram](./images/DeleteCommandSequenceDiagram.png) + +When the `Ui` reads `"deleteExpense 1"` from `User`, it calls the `parseCommand()` method from `Parser` class +to help parse the user input to `Command` (more specifically, `DeleteExpenseCommand`). +In the `parseCommand()` method, it calls the `prepareDeleteExpenseCommand()` method to help convert the `String` "1" to +`int` 1, and handle the necessary `exceptions`. It then returns a newly constructed `DeleteExpenseCommand(1)` object to `parseCommand()` +method and back to `Ui`. The `Ui` executes the `excute()` method in `DeleteExpenseCommand` object which will call the +`deleteExpense()` method in `EntryList` which will delete the entry of expense in its entryList. The `Ui` will +display successful deletion of expense entry upon completion of delete command. + +When the `Ui` reads "exit" from the `User`, it similarly calls the `parseCommand()` method from +`Parser` class to help parse the user input to `Command` (more specifically, `ExitCommand`). +The `Parser` class will return a newly constructed `ExitCommand()` object back to the `Ui`. +The `Ui` executes the `execute()` method of the `ExitCommand` which will call writeFile method in the `SaveBudget`, +`SaveExpense`, and `SaveIncome` classes, in the `Save` folder, and write the content to its respective `.txt` +files in the `Data` folder. Upon completion of the save command, the `Ui` will print the goodbye messages to the +`User` and terminate the program. + +[back to contents](#table-of-contents) + +--- + +### Save component + +The **API** of this component is specified in [`SaveBudget.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/save/SaveBudget.java), [`SaveExpense.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/save/SaveExpense.java), [`SaveIncome.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/save/SaveIncome.java) + +The `Save` component, + +- can save entryList data and budget data in the hard disk as .txt files, and read them back into corresponding objects. +- depends on some classes in the EntryList component and Budget component(because the Save component’s job is to save/retrieve objects that belong to the EntryList and Budget) + +[back to contents](#table-of-contents) + +--- + +### EntryList component + +The **API** of this component is specified in [`EntryList.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/entry/EntryList.java) + +The `EntryList` component, +- stores the entry list data i.e., all `Entry` objects (which can inherit the behavior of `Expense` class or `Income` class) +- stores the `EntryAmountComparator` and `EntryDateComparator` to filter the list. The UI can be bound to this list so that the UI automatically updates when the data in the list change. +- does not depend on any of the other three components (as the `EntryList` represents data entities of the domain, they should make sense on their own without depending on other components). + +Here is the (partial) UML diagram of the `EntryList` component: + +![EntryListClassDiagram](./images/EntryListClassDiagram.png) + +[back to contents](#table-of-contents) + +--- + +### Budget component + +The **API** of this component is specified in [`Budget.java`](https://github.com/AY2223S2-CS2113-F13-2/tp/blob/master/src/main/java/seedu/brokeMan/budget/Budget.java) + +The `Budget` component, +- stores the monthly budget data in a hashmap +- does not depend on any of the other three components (as the `Budget` represents data entities of the domain, they should make sense on their own without depending on other components). + +Here is a UML diagram of the `Budget` component: + +![BudgetClassDiagram](./images/BudgetClassUML.png) + +### Common class + +Messages used by multiple components are in the [`seedu.brokeMan.common`](https://github.com/AY2223S2-CS2113-F13-2/tp/tree/master/src/main/java/seedu/brokeMan/common) package. + +[back to contents](#table-of-contents) + +--- + +### Exception classes + +Exceptions are used mainly by the parser to restrict commands from entering undesirable/unusable inputs provided by the user. + +Possible exceptions in multiple components are defined in the [`seedu.brokeMan.exception`](https://github.com/AY2223S2-CS2113-F13-2/tp/tree/master/src/main/java/seedu/brokeMan/exception) package. + +[back to contents](#table-of-contents) + +--- + +## Implementation + +### Entry + +Below is the UML class diagram for Entry: -## Design & implementation +![EntryClassDiagram](./images/EntryClassDiagram.png) -{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} +Entry class is the underlying superclass for Expense and Income classes. It establishes the common attributes and +methods that are necessary to represent Expenses and Incomes. Abstract class is used to represent their common features +to maximize code reusability and increase maintainability. +**Methods** -## Product scope -### Target user profile +The entry class implements getters for its attributes, as other classes may need to access information of the entry (ex. getTime()) -{Describe the target user profile} +editDescription(), editAmount(), editTime(), editCategory() -### Value proposition +* Takes in corresponding parameters to edit the private attributes. +* Used by EntryList to make edits -{Describe the value proposition: what problem does it solve?} +isSameMonth() -## User Stories +* Takes in Integer year and Month and returns if the entry is made in the date specified by parameters. -|Version| As a ... | I want to ... | So that I can ...| -|--------|----------|---------------|------------------| -|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| -|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| +[back to contents](#table-of-contents) -## Non-Functional Requirements +--- -{Give non-functional requirements} +### EntryList + +Below is the UML class diagram for EntryList: + +![EntryListFullClassDiagram](./images/EntryListFulllClassDiagram.png) + +The EntryList class represents a collection of Entry instances. It is an abstract class that serves as a superclass for +ExpenseList and IncomeList classes, providing common functionalities to minimize repetitive code and easing code +maintenance. It provides underlying methods for adding, removing, editing, and listing entries from the list, which can +be expenses or incomes depending on the subclass. + +On top of the methods that provide basic functionality of expense/income lists, the EntryList class provides additional +methods such as summing all entries or filtering the entries according to LocalDate provided to the method. Most methods +of EntryList take in a List, which is because it has to operate on a list of expenses or incomes passed by the +IncomeList or ExpenseList subclasses. + +**Methods** + +addEntry(), listEntry(), deleteEntry(), editEntry() + +* Underlying methods of the add, edit, view, and delete features of Expense and Income class. +* Edit entry has different methods for each data stored in an entry. (E.g. amount, time...etc). + - Edit method makes use of the private edit methods of the Entry class. + + +getTotalAmount(), sortEntriesByAmount(), sortEntriesByDate(), findEntriesByCategory(), selectEntryForDate(), getEntryListSum() + +* Underlying methods of subclasses of EntryList, which are used to implement features that extends beyond the CRUD features. +* They all take in a list of entries, which are IncomeLists or ExpenseLists, then returns appropriate data back to the subclass. +* Filter by date methods make use of java.stream and its filter method to choose out only the entries of appropriate date. To check if the entry is made in the date of interest, the isSameMonth() method of Entry class is used. +* As mentioned above, custom comparators are implemented in the program to sort the entries by an attribute of an entry. + +[back to contents](#table-of-contents) + +--- + +### ExpenseList, IncomeList + +Classes ExpenseList and IncomeList are responsible for keeping track of the corresponding entry instances added to the program by the user. +At a class level, it keeps a **LinkedList** of corresponding entries. +They both extend EntryList, the abstract class that represents a collection of Entry instances. +It provides static functionalities of managing and viewing entry instances at a class level. +Instances of ExpenseList and IncomeList are not created as all functionalities can be provided at the class level. + +**Methods** + +Most methods of the Income/ExpenseList make use of the underlying methods in the EntryList class. +* For example, the addIncome method makes use of addEntry method of EntryList to add a Income instance in the class-level Linked-List named incomeList. + + +listExpense() / listIncome() + +* Overloaded method, may take it no parameter or LocalDate parameter +* If it has no passed parameters, it returns all entries in the list +* If a LocalDate is passed, it returns all entries made in the month specified by LocalDate instance. + +[back to contents](#table-of-contents) + +--- + +### Budget + +The Budget class represents the user’s monthly budget. The class utilize class-level hashmaps to represent the monthly +budget, using outer key year and inner key month. It provides a methods setBudget and viewBudget to set and view budget for different months. + +It makes use of a static HashMap> to keep track of monthly budget. If the user tries to +access budget using keys that are not entered in the HashMap, it will return a warning mentioning that the inquired +budget has not been set yet. + +[back to contents](#table-of-contents) + +--- + +### SaveExpense, SaveIncome, SaveBudget + +The SaveExpense, SaveIncome, SaveBudget classes deal with saving in the user inputted data locally. +So that it can all be later accessed. +They all save once the exit command is set. +So assuming there are no bugs it should save. + +**Methods** + +writeFile(LinkedList expenses/incomes) +* writes to the file in a similar format that is entered in to make a new Expense object within the constructor. + +readExpenseFile() + +* This method reads in from the saved file either ExpenseData.txt or IncomeData.txt. +* Reads in and initialized each line as either expense or income. +* Then adds to the respective list. + + +writeFile(HashMap> budget) +* This method writes to the file under ./data/BudgetData.txt file. +* Will write upon exit. +* organizes it based on how it the information is constructed for easy reading. +* Iterates through the outer HashMap then inner. + +public static HashMap> readFile() +* On start up reads through the file ./data/BudgetData.txt. +* Reads in and the year then as a key then the monthly declared budget of the given months. +* Returns this as the initialized budget on start. + +[back to contents](#table-of-contents) + +--- + +### Wishlist (COMING SOON) + +The Wishlist class represents a good or a product the user wants to purchase in the future that are expensive enough, prompting the user to save up. Users can funnel their income entry to a specific wishlisted-product. Users can view how much percentage of the good's price they have saved up, which can give them further motivation to cut their spendings. Users will be able to add a list of wishlisted products. + +They can be implemented through a structure that is similar to Entry and EntryList. Each wishlisted product will be a separate class that stores the information of the good, such as name, price, and the date of wishlist created. + +The wishlist entry can then be arranged to a list, where users can easily navigate and compare between different wishlisted products. They can also give priority value to each wishlisted product, which can be used to sort them. + +[back to contents](#table-of-contents) + +--- + +### Spending Advisor (COMING SOON) + +The spending advisor will be integrated to the product by assisting users to make best consumption choices. The advisor will help users compare prices from different food outlets and shops. As the target user for this program is students, the program will first implement food stalls and shops in NUS, which is where the developers for this program are enrolled. In subsequent iterations of the program, the advisor will expand into other regions and recommend users of the best-value purchases. + +[back to contents](#table-of-contents) + +--- + + +## Appendix: Requirements + +### Product scope + +**Target user profile**: + +- BrokeMan is suitable for students who have to work with tight budgets +- students who want to use their money efficiently +- students who want to minimize their spending. +- students who can type fast +- prefer typing to mouse interactions +- is reasonably comfortable using CLI apps + +**Value proposition**: + +- Manage income and expenses faster than a typical mouse/GUI driven app +- The program will offer visualization of the user's incomes, expenses and budget, allowing them to recap and be mindful + about their financial status. The project will allow division of budget into multiple subcategories of expenses. In + essence, the program sets students up for a better financial future. + +[back to contents](#table-of-contents) + +--- + +### User Stories + +Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*` + +| Priority | Version | As a ... | I want to ... | So that I can ... | +|----------|---------|----------|------------------------------------------------|-----------------------------------------------------------------------------------| +| `* * *` | v1.0 | user | add my income | add my new incomes and keep track of them | +| `* * *` | v1.0 | user | delete my income entered | delete incorrectly added or unwantedincomes | +| `* * *` | v1.0 | user | edit my income previously entered | edit a component of my income without having to delete and re-entering the income | +| `* * *` | v1.0 | user | list my incomes | track all of my incomes and take a look at them at once | +| `* * *` | v1.0 | user | add my expenses | add my new expenses and keep track of them | +| `* * *` | v1.0 | user | delete my expenses entered | delete incorrectly added or unwanted expenses | +| `* * *` | v1.0 | user | edit my expense previously entered | edit a component of my expense without having to delete and re-enter the expense | +| `* * *` | v1.0 | user | list my expenses | track all my expenses and take a look at them at once | +| `* * *` | v1.0 | user | set and view my budget | set expectation of how much money I should use | +| `* * *` | v1.0 | user | view how much of the budget I spent | keep track of my spending status, as well as manage and change my spending habit as necessary | +| `* *` | v1.0 | user | view all command that I can enter | get help on the features if necessary | +| `* *` | v2.0 | user | list monthly expenses, income, and budget | refer to financial status in previous months | +| `* *` | v2.0 | user | save all my income and expenses entered | so that I can refer to it next time I reopen the program | +| `* *` | v3.0 | user | add goods on wishlist | so that I can save my incomes to purchase them | +| `* ` | v3.0 | user | compare different spending options in the area | so that I can make the best-value purchases | + +[back to contents](#table-of-contents) + +--- + +### Use cases + +(For all use cases below, the System is the `BrokeMan` and the Actor is the `user`, +unless specified otherwise) + +#### Use case: Delete an expense + +#### MSS + +1. User requests to list expenses. +2. BrokeMan shows a list of expenses. +3. User requests to delete a specific person in the list. +4. BrokeMan deletes the person. + + Use case ends. + +#### Extensions +* 2a. The list is empty. + + Use case ends. +* 3a. The given index is invalid. + * 3a1. BrokeMan shows an error message. + + Use case resumes at step 2. + +[back to contents](#table-of-contents) + +--- + +### Non-Functional Requirements + +1. Should work on any mainstream OS as long as it has Java 11 or above installed. +2. Should be able to hold up to 1000 entries without a noticeable sluggishness in performance for typical usage. +3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. + +[back to contents](#table-of-contents) + +--- ## Glossary -* *glossary item* - Definition +- **Mainstream OS**: Windows, Linux, Unix, OS-X +- Command Line Interface (CLI) -## Instructions for manual testing +[back to contents](#table-of-contents) + +--- + +## Appendix: Instructions for manual testing {Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} + +1. Download the latest .jar file from [here](https://github.com/AY2223S2-CS2113-F13-2/tp/releases/tag/v2.1). +2. Open the folder that the .jar file is in and run the program in your terminal using `java -jar CS2113-F13-2_BrokeMan.jar`. +3. Read through the user guide to get the detailed instructions for the various features of the program. +4. Additional, user can see all the available commands and a less detailed description of them by entering `help`. +5. Add an expense at 2023/04/01 at 12:00 using the command `addExpense a/ 5.0 d/ lunch t/ 2023 04 01 12 00 c/ FOOD`. +6. Delete expense using the command `deleteExpense 1`. +7. Edit an expense using the command `editExpense i/ 1 t/ amount n/ 12.5`. +8. List all expenses across the entire time period using the command `listExpense`. +9. List all expenses for the month specified using the command `listExpense t/ 2023/04`. +10. Add an income at 2023/04/01 at 12:00 using the command `addIncome a/ 4000 d/ salary t/ 2023 04 01 12 00 c/ SALARY`. +11. Delete an income using the command `deleteIncome 1`. +12. Edit an Income using the command `editIncome i/ 1 t/ info n/ stocks`. +13. List all incomes across the entire time period using the command `listIncome`. +14. List all incomes for the month specified using the command `listIncome t/ 2023/04`. +15. Set a budget for current month using the command `setBudget 500`. +16. Set a budget for a specific month using the command `setBudget 500 t/ 2023/05`. +17. View budget for current month and amount of budget remaining using the command `viewBudget`. +18. View budget for the month specified and the amount of budget remaining using the command `viewBudget t/ 2023/05`. +19. View Expenses by decreasing amount using the command `sortExpenseByAmount`. +20. View Income by decreasing amount using the command `sortIncomeByAmount`. +21. View Expenses by dates from the latest to oldest using the command `sortExpenseByDate`. +22. View incomes by dates from the latest to oldest using the command `sortIncomeByDate`. +23. Exit and save the content of the program by using the command `exit`. + +[back to contents](#table-of-contents) diff --git a/docs/README.md b/docs/README.md index bbcc99c1e7..3166368d72 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,8 +1,25 @@ -# Duke - -{Give product intro here} - -Useful links: -* [User Guide](UserGuide.md) -* [Developer Guide](DeveloperGuide.md) -* [About Us](AboutUs.md) +# BrokeMan + +``` +$$$$$___ ______ _______ $$_____ _______ $$___$$_ _______ _______ +$$__$$__ ______ _______ $$__$$_ _$$$$__ $$$_$$$_ $$$$$__ _______ +$$$$$___ $$_$$_ _$$$$__ $$_$$__ $$__$$_ $$$$$$$_ ____$$_ $$$$$__ +$$___$$_ $$$_$_ $$__$$_ $$$$___ $$$$$$_ $$_$_$$_ _$$$$$_ $$__$$_ +$$___$$_ $$____ $$__$$_ $$_$$__ $$_____ $$___$$_ $$__$$_ $$__$$_ +$$$$$$__ $$____ _$$$$__ $$__$$_ _$$$$$_ $$___$$_ _$$$$$_ $$__$$_ +``` + +Welcome to BrokeMan! + +Your personal budget manager to prevent you to become broke like me... + +--- + +Useful links: +* [User Guide](UserGuide.md) +* [Developer Guide](DeveloperGuide.md) +* [About Us](AboutUs.md) +* [Yu Sichen Sistine PPP](team/sistine-yu.md) +* [Sangjun Nam PPP](team/namsengi11.md) +* [Samuel Tan PPP](team/samueltansw.md) +* [Liam PPP](team/speciliam.md) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index abd9fbe891..8005a57979 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -1,42 +1,741 @@ # User Guide +## Table of Contents + +1. [Introduction](#introduction) +2. [Quick Start](#quick-start) +3. [Features](#features) + * [Adding an expense](#adding-an-expense-addexpense) + * [Adding an income](#adding-an-income-addincome) + * [Listing all expenses](#listing-all-expenses-listexpense) + * [Listing all income](#listing-all-income-listincome) + * [Editing an expense](#editing-an-expense-editexpense) + * [Editing an income](#editing-an-income-editincome) + * [Sorting an expense by amount](#sorting-an-expense-by-amount-sortexpensebyamount) + * [Sorting an income by amount](#sorting-an-income-by-amount-sortincomebyamount) + * [Sorting an expense by date](#sorting-an-expense-by-date-sortexpensebydate) + * [Sorting an income by date](#sorting-an-income-by-date-sortincomebydate) + * [Deleting an expense](#deleting-an-expense-deleteexpense) + * [Deleting an income](#deleting-an-income-deleteincome) + * [Set budget](#set-budget-setbudget) + * [View budget](#view-budget-viewbudget) + * [Help command](#help-command-help) + * [Exiting the program](#exiting-the-program-exit) + * [Saving the data](#saving-the-data) +4. [FAQ](#faq) +5. [Command Summary](#command-summary) + + ## Introduction -{Give a product intro} + +BrokeMan is a desktop app for managing expenses and income, optimized for use via a Command Line Interface(CLI). +If you can type fast, BrokeMan can get your expenses and income management tasks done faster than traditional GUI apps. + +[back to Contents](#table-of-contents) + +--- ## Quick Start -{Give steps to get started quickly} 1. Ensure that you have Java 11 or above installed. -1. Down the latest version of `Duke` from [here](http://link.to/duke). +2. Download the latest version of `BrokeMan` from [here](https://github.com/AY2223S2-CS2113-F13-2/tp/releases/tag/v2.1). +3. Copy the file to the folder you want to use as the home folder for your BrokeMan. +4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar CS2113-F13-2_BrokeMan.jar` command to run the application. + + A welcome message as shown below should appear. + + ``` + | ----------------------------------------------------------------------- + | ----------------------------------------------------------------------- + | + | $$$$$___ ______ _______ $$_____ _______ $$___$$_ _______ _______ + | $$__$$__ ______ _______ $$__$$_ _$$$$__ $$$_$$$_ $$$$$__ _______ + | $$$$$___ $$_$$_ _$$$$__ $$_$$__ $$__$$_ $$$$$$$_ ____$$_ $$$$$__ + | $$___$$_ $$$_$_ $$__$$_ $$$$___ $$$$$$_ $$_$_$$_ _$$$$$_ $$__$$_ + | $$___$$_ $$____ $$__$$_ $$_$$__ $$_____ $$___$$_ $$__$$_ $$__$$_ + | $$$$$$__ $$____ _$$$$__ $$__$$_ _$$$$$_ $$___$$_ _$$$$$_ $$__$$_ + | Welcome to BrokeMan! + | Your personal budget manager to prevent you to become broke like me... + | + | ----------------------------------------------------------------------- + | ----------------------------------------------------------------------- + | + | Enter command: + ``` + +5. Type the command in the command box and press Enter to execute it. Refer to the Features below for details of each command. Type `help` to receive a list of commands that are available. + +[back to Contents](#table-of-contents) + +--- + +## Features + +### Adding an expense: `addExpense` +Format: `addExpense a/ d/ t/