Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement add contacts #28

Closed
wants to merge 14 commits into from
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
[![CI Status](https://github.com/AY2324S2-CS2103T-T17-4/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2324S2-CS2103T-T17-4/tp/actions)
[![codecov](https://codecov.io/gh/AY2324S2-CS2103T-T17-4/tp/graph/badge.svg?token=LPV8FKMOGM)](https://codecov.io/gh/AY2324S2-CS2103T-T17-4/tp)

![Ui](docs/images/Ui.png)

* This is **a sample project for Software Engineering (SE) students**.<br>
Example usages:
* as a starting point of a course project (as opposed to writing everything from scratch)
* as a case study
* The project simulates an ongoing software project for a desktop application (called _AddressBook_) used for managing contact details.
* It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC) than what students usually write in beginner-level SE modules, without being overwhelmingly big.
* It comes with a **reasonable level of user and developer documentation**.
* It is named `AddressBook Level 3` (`AB3` for short) because it was initially created as a part of a series of `AddressBook` projects (`Level 1`, `Level 2`, `Level 3` ...).
* For the detailed documentation of this project, see the **[Address Book Product Website](https://se-education.org/addressbook-level3)**.
* This project is a **part of the se-education.org** initiative. If you would like to contribute code to this project, see [se-education.org](https://se-education.org#https://se-education.org/#contributing) for more info.
This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org).

# BistroBoss
BistroBoss is a desktop application for managing staff and operations in a restaurant.
It streamlines the process of salary distribution, shift scheduling, and manpower allocation for various staff roles.
With the high turnover rate in the F&B industry, particularly among part-time student employees,
the tool also features an archiving function to retain ex-staff records for potential future reemployment.

Example usages:
* As a bistro manager, I can store the contact and banking details of my employees for easy referral when I want to contact them or transfer their salary.
* As a bistro manager, I can remove the details of my employees so that I can free up space in my address book.
* As a bistro manager, I can view the contacts of all my employees so that I can have an overview of all contacts in my address book.
* As a bistro manager, I can use the application to store the accumulated work hours of my employee for later use of salary calculation.

For the detailed documentation of this project, see the **[BistroBoss Product Website](https://ay2324s2-cs2103t-t17-4.github.io/tp/)**.
25 changes: 13 additions & 12 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ You can reach us at the email `seer[at]comp.nus.edu.sg`

## Project team

### John Doe
### Chua Joon Peng, Gabriel

<img src="images/johndoe.png" width="200px">
<img src="images/gabrielchua.png" width="200px">

[[homepage](http://www.comp.nus.edu.sg/~damithch)]
[[github](https://github.com/johndoe)]
[[portfolio](team/johndoe.md)]
[[homepage](https://www.linkedin.com/in/gabriel-chua-087543229/)]
[[github](https://github.com/1rbg)]
[[portfolio](team/gabrielchua.md)]

* Role: Project Advisor
* Role: Developer
* Responsibilities: Documentation + UI

### Jane Doe
### Martin Ng Jinn Kai

<img src="images/johndoe.png" width="200px">
<img src="images/martinng.png" width="200px">

[[github](http://github.com/johndoe)]
[[portfolio](team/johndoe.md)]
[[github](http://github.com/martinng01)]
[[portfolio](team/martinng.md)]

* Role: Team Lead
* Responsibilities: UI
* Role: Developer
* Responsibilities: Testing

### Johnny Doe

Expand Down
209 changes: 135 additions & 74 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: "AB-3"
title: "BistroBoss"
theme: minima

header_pages:
Expand All @@ -8,7 +8,7 @@ header_pages:

markdown: kramdown

repository: "se-edu/addressbook-level3"
repository: "AY2324S2-CS2103T-T17-4/tp"
github_icon: "images/github-icon.png"

plugins:
Expand Down
Binary file modified docs/images/Ui.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/images/gabrielchua.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/images/martinng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/team/gabrielchua.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: page
title: Gabriel Chua's Project Portfolio Page
---

### Project: AddressBook Level 3

AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Given below are my contributions to the project.

* **New Feature**: Added the ability to undo/redo previous commands.
* What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
* Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
* Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
* Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}*

* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys.

* **Code contributed**: [RepoSense link]()

* **Project management**:
* Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub

* **Enhancements to existing features**:
* Updated the GUI color scheme (Pull requests [\#33](), [\#34]())
* Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]())

* **Documentation**:
* User Guide:
* Added documentation for the features `delete` and `find` [\#72]()
* Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]()
* Developer Guide:
* Added implementation details of the `delete` feature.

* **Community**:
* PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]()
* Contributed to forum discussions (examples: [1](), [2](), [3](), [4]())
* Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]())
* Some parts of the history feature I added was adopted by several other class mates ([1](), [2]())

* **Tools**:
* Integrated a third party library (Natty) to the project ([\#42]())
* Integrated a new Github plugin (CircleCI) to the team repo

* _{you can add/remove categories in the list above}_
File renamed without changes.
46 changes: 46 additions & 0 deletions docs/team/jinxunze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: page
title: John Doe's Project Portfolio Page
---

### Project: AddressBook Level 3

AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Given below are my contributions to the project.

* **New Feature**: Added the ability to undo/redo previous commands.
* What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
* Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
* Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
* Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}*

* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys.

* **Code contributed**: [RepoSense link]()

* **Project management**:
* Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub

* **Enhancements to existing features**:
* Updated the GUI color scheme (Pull requests [\#33](), [\#34]())
* Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]())

* **Documentation**:
* User Guide:
* Added documentation for the features `delete` and `find` [\#72]()
* Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]()
* Developer Guide:
* Added implementation details of the `delete` feature.

* **Community**:
* PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]()
* Contributed to forum discussions (examples: [1](), [2](), [3](), [4]())
* Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]())
* Some parts of the history feature I added was adopted by several other class mates ([1](), [2]())

* **Tools**:
* Integrated a third party library (Natty) to the project ([\#42]())
* Integrated a new Github plugin (CircleCI) to the team repo

* _{you can add/remove categories in the list above}_
53 changes: 53 additions & 0 deletions docs/team/martinng.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
layout: page
title: Martin Ng's Project Portfolio Page
---

### Project: AddressBook Level 3

AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user
interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Given below are my contributions to the project.

* **New Feature**: Added the ability to undo/redo previous commands.
* What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed
by using the redo command.
* Justification: This feature improves the product significantly because a user can make mistakes in commands and
the app should provide a convenient way to rectify them.
* Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth
analysis of design alternatives. The implementation too was challenging as it required changes to existing
commands.
* Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in
the feature so that a reader can make a more accurate judgement of how much effort went into the feature}*

* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys.

* **Code contributed**: [RepoSense link]()

* **Project management**:
* Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub

* **Enhancements to existing features**:
* Updated the GUI color scheme (Pull requests [\#33](), [\#34]())
* Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull
requests [\#36](), [\#38]())

* **Documentation**:
* User Guide:
* Added documentation for the features `delete` and `find` [\#72]()
* Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]()
* Developer Guide:
* Added implementation details of the `delete` feature.

* **Community**:
* PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]()
* Contributed to forum discussions (examples: [1](), [2](), [3](), [4]())
* Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]())
* Some parts of the history feature I added was adopted by several other class mates ([1](), [2]())

* **Tools**:
* Integrated a third party library (Natty) to the project ([\#42]())
* Integrated a new Github plugin (CircleCI) to the team repo

* _{you can add/remove categories in the list above}_
46 changes: 46 additions & 0 deletions docs/team/teohaowei.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: page
title: John Doe's Project Portfolio Page
---

### Project: AddressBook Level 3

AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Given below are my contributions to the project.

* **New Feature**: Added the ability to undo/redo previous commands.
* What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
* Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
* Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
* Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}*

* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys.

* **Code contributed**: [RepoSense link]()

* **Project management**:
* Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub

* **Enhancements to existing features**:
* Updated the GUI color scheme (Pull requests [\#33](), [\#34]())
* Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]())

* **Documentation**:
* User Guide:
* Added documentation for the features `delete` and `find` [\#72]()
* Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]()
* Developer Guide:
* Added implementation details of the `delete` feature.

* **Community**:
* PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]()
* Contributed to forum discussions (examples: [1](), [2](), [3](), [4]())
* Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]())
* Some parts of the history feature I added was adopted by several other class mates ([1](), [2]())

* **Tools**:
* Integrated a third party library (Natty) to the project ([\#42]())
* Integrated a new Github plugin (CircleCI) to the team repo

* _{you can add/remove categories in the list above}_
10 changes: 5 additions & 5 deletions src/main/java/seedu/address/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

/**
* The main entry point to the application.
*
* <p>
* This is a workaround for the following error when MainApp is made the
* entry point of the application:
*
* Error: JavaFX runtime components are missing, and are required to run this application
*
* <p>
* Error: JavaFX runtime components are missing, and are required to run this application
* <p>
* The reason is that MainApp extends Application. In that case, the
* LauncherHelper will check for the javafx.graphics module to be present
* as a named module. We don't use JavaFX via the module system so it can't
* find the javafx.graphics module, and so the launch is aborted.
*
* <p>
* By having a separate main class (Main) that doesn't extend Application
* to be the entry point of the application, we avoid this issue.
*/
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Messages {
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
"Multiple values specified for the following single-valued field(s): ";

/**
* Returns an error message indicating the duplicate prefixes.
Expand All @@ -39,10 +39,14 @@ public static String format(Person person) {
builder.append(person.getName())
.append("; Phone: ")
.append(person.getPhone())
.append("; Email: ")
.append(person.getEmail())
.append("; Sex: ")
.append(person.getSex())
.append("; Employment Type: ")
.append(person.getEmploymentType())
.append("; Address: ")
.append(person.getAddress())
.append("; Bank Details: ")
.append(person.getBankDetails())
.append("; Tags: ");
person.getTags().forEach(builder::append);
return builder.toString();
Expand Down
23 changes: 16 additions & 7 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_BANKDETAILS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMPLOYMENTTYPE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_FIRSTNAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_LASTNAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_SEX;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import seedu.address.commons.util.ToStringBuilder;
Expand All @@ -13,6 +16,7 @@
import seedu.address.model.Model;
import seedu.address.model.person.Person;


/**
* Adds a person to the address book.
*/
Expand All @@ -22,15 +26,20 @@ public class AddCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_FIRSTNAME + "FIRST NAME "
+ PREFIX_LASTNAME + "LAST NAME "
+ PREFIX_PHONE + "PHONE "
+ PREFIX_EMAIL + "EMAIL "
+ PREFIX_ADDRESS + "ADDRESS "
+ PREFIX_SEX + "SEX "
+ PREFIX_EMPLOYMENTTYPE + "EMPLOYMENT TYPE "
+ "[" + PREFIX_ADDRESS + "ADDRESS] "
+ "[" + PREFIX_BANKDETAILS + "BANK DETAILS] "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
+ PREFIX_FIRSTNAME + "John "
+ PREFIX_LASTNAME + "Doe "
+ PREFIX_PHONE + "98765432 "
+ PREFIX_EMAIL + "[email protected] "
+ PREFIX_SEX + "m "
+ PREFIX_EMPLOYMENTTYPE + "ft "
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 "
+ PREFIX_TAG + "friends "
+ PREFIX_TAG + "owesMoney";
Expand Down
Loading
Loading