Skip to content

Commit

Permalink
Merge pull request #3 from boonhaii/Week-9
Browse files Browse the repository at this point in the history
Merging Week 9 with master to rebranch
  • Loading branch information
boonhaii authored Oct 12, 2021
2 parents 035d831 + ca2f0db commit 494b4f5
Show file tree
Hide file tree
Showing 21 changed files with 118 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Example usages:
* To assist in managing HR administrative tasks such as:
* tracking leave and offs
* tracking leaves and offs
* calculating overtime pay
* updating payroll information like salaries and bank account numbers
* To allow users to quickly assess the balance of work between employees.
Expand Down
38 changes: 19 additions & 19 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
| `* * *` | user | delete an employee | remove entries that I no longer need. |
| `* * * ` | user | edit an employee's data | |
| `* * *` | user with many employees in the app | search for an employee's data easily | locate details of employees without having to go through the entire list. |
| `* * *` | user | keep track of my employee's current leave | determine if a given employee's request for leave is valid. |
| `* * *` | user | update leave for certain employees | have a more accurate count of their remaining leave. |
| `* * *` | user | keep track of an employee's unpaid leave | know how much to deduct from their monthly hourlySalary. |
| `* * *` | user | get all the offs and leave that every employee has | get those with remaining leave to clear them before the end of the year. |
| `* * *` | user | keep track of my employee's current leaves | determine if a given employee's request for leave is valid. |
| `* * *` | user | update leaves for certain employees | have a more accurate count of their remaining leaves. |
| `* * *` | user | keep track of an employee's unpaid leaves | know how much to deduct from their monthly salary. |
| `* * *` | user | get all the offs and leaves that every employee has | get those with remaining leaves to clear them before the end of the year. |
| `* * *` | user | calculate the pay of all employees and view them easily | make it easier to complete administrative tasks. |
| `* * *` | user | have an application to account for factors like unpaid leave and overtime when calculating hourlySalary | reduce chances of errors by manual calculations. |
| `* * *` | user | have an application to account for factors like unpaid leaves and overtime when calculating salary | reduce chances of errors by manual calculations. |
| `* * *` | user | keep track of employees which I have not paid yet | ensure all employees are paid. |
| `* * *` | user | get all the overtime that every employee has done for the month | keep track of each employee and analyze the amount of overtime being done in the company. |
| `* * *` | organized user | group up employees into specified groups | sort through them easily with color coding and tags. |
Expand Down Expand Up @@ -340,13 +340,13 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case resumes at step 2.

**Use case: Add leave to an employee**
**Use case: Add leaves to an employee**

**MSS**

1. User requests to list employees
2. HeRon shows a list of employees
3. User requests to add a certain number of leave to a specific employee in the list
3. User requests to add a certain number of leaves to a specific employee in the list
4. HeRon adds the leave to the employee

Use case ends.
Expand All @@ -363,20 +363,20 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case resumes at step 2.

* 3b. The number of leave to be added is invalid. (If the input is not a positive integer)
* 3b. The number of leaves to be added is invalid. (If the input is not a positive integer)

* 3b1. HeRon shows an error message.

Use case resumes at step 2.

**Use case: Remove leave from an employee**
**Use case: Remove leaves from an employee**

**MSS**

1. User requests to list employees
2. HeRon shows a list of employees
3. User requests to remove a certain number of leave from a specific employee in the list
4. HeRon removes the leave from the employee
3. User requests to remove a certain number of leaves from a specific employee in the list
4. HeRon removes the leaves from the employee

Use case ends.

Expand All @@ -392,13 +392,13 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case resumes at step 2.

* 3b. The number of leave to be removed is invalid. (If the input is not a positive integer)
* 3b. The number of leaves to be removed is invalid. (If the input is not a positive integer)

* 3b1. HeRon shows an error message.

Use case resumes at step 2.

* 3c. The number of leave to be removed is greater than the amount of leave the employee actually has.
* 3c. The number of leaves to be removed is greater than the amount of leaves the employee actually has.

* 3c1. HeRon shows an error message.

Expand Down Expand Up @@ -467,14 +467,14 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case resumes at step 2.

**Use case: Calculate an employee's hourlySalary**
**Use case: Calculate an employee's salary**

**MSS**

1. User requests to list employees
2. HeRon shows a list of employees
3. User requests to calculate the hourlySalary of a specific employee in the list
4. HeRon calculates and displays the hourlySalary of that employee
3. User requests to calculate the salary of a specific employee in the list
4. HeRon calculates and displays the salary of that employee

Use case ends.

Expand Down Expand Up @@ -621,10 +621,10 @@ testers are expected to do more *exploratory* testing.
3. Test case: `edit`<br>
Expected: No data is being edited. Error details shown in status message. Status bar remains the same.

4. Test case: `edit 1 p/91234567 s/2000`<br>
Expected: First employee's phone number and hourlySalary is updated as `91234567` and `2000` respectively together. Details of edited contact shown in the status message. Timestamp in the status bar is updated.
4. Test case: `edit 1 p/91234567 s/9.50`<br>
Expected: First employee's phone number and salary is updated as `91234567` and `9.50` respectively together. Details of edited contact shown in the status message. Timestamp in the status bar is updated.

5. Other incorrect edit commands to try: `edit x` (where x is larger than list size), `edit 1 s/-200` (hourlySalary should not be negative) etc. <br>
5. Other incorrect edit commands to try: `edit x` (where x is larger than list size), `edit 1 s/-2.00` (salary should not be negative) etc. <br>
Expected: No employee data is being edited. Error details shown in the status message. Status bar remains the same.

2. _{ possibly more test cases? …​ }_
Expand Down
28 changes: 14 additions & 14 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: User Guide
---

HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leave and offs, calculating pay and updating payroll information. It is optimized for use via a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI). If you are a fast typer, HeRon can get your tasks done faster as compared to traditional GUI apps.
HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leaves and offs, calculating pay and updating payroll information. It is optimized for use via a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI). If you are a fast typer, HeRon can get your tasks done faster as compared to traditional GUI apps.


* Table of Contents
Expand Down Expand Up @@ -110,7 +110,7 @@ Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [r/ROLE] [l/LEAVES]
* The value of SALARY **must be a non-negative number.**

Examples:
* `edit 1 p/91234567 e/[email protected] l/15` Edits the phone number, email address and leave of the 1st employee to be `91234567`, `[email protected]` and `15` respectively.
* `edit 1 p/91234567 e/[email protected] l/15` Edits the phone number, email address and leaves of the 1st employee to be `91234567`, `[email protected]` and `15` respectively.
* `edit 2 n/Betsy Crower t/` Edits the name of the 2nd employee to be `Betsy Crower` and clears all existing tags.

### Locating employees by name: `find`
Expand All @@ -123,12 +123,12 @@ Format: `find [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [r/ROLE] [l/LEAVES] [s/SA
* The keyword search is not case-sensitive.
* For each field, you can search using multiple keywords.
* For example, `find n/John Mike r/Manager` will return all employees with the role "Manager" and with the names John or Mike.
* You can query employees who meet the specified condition for the number of leave by entering `l/<LEAVES` (for less than LEAVES) or `l/>LEAVES` (for more than LEAVES)
* For example, enter `find l/>5` to find all employees who still have more than 5 leave remaining.
* You can query employees who meet the specified condition for the number of leaves by entering `l/<LEAVES` (for less than LEAVES) or `l/>LEAVES` (for more than LEAVES)
* For example, enter `find l/>5` to find all employees who still have more than 5 leaves remaining.

Examples:
* `find n/John` returns `john` and `John Doe`
* `find n/alex david l/<3` returns `Alex Yeoh`, `David Li` as long as they have less than 3 leave left.<br>
* `find n/alex david l/<3` returns `Alex Yeoh`, `David Li` as long as they have less than 3 leaves left.<br>
![result for 'find alex david'](images/findAlexDavidResult.png)

### Deleting an employee : `delete`
Expand All @@ -146,13 +146,13 @@ Examples:
* `list` followed by `delete 2` deletes the 2nd employee in the employee book.
* `find Betsy` followed by `delete 1` deletes the 1st employee in the results of the `find` command.

### Add number of leave for an employee : `addLeaves`
### Add number of leaves for an employee : `addLeaves`

Adds the specified number of days to the current leave quota (number of days of leave left) of a chosen employee.

Format: `addLeaves INDEX NO_OF_DAYS`

* Adds the specified number to the number of leave of the employee at the specified `INDEX`.
* Adds the specified number to the number of leaves of the employee at the specified `INDEX`.
* The index refers to the index number shown in the displayed employee list.
* The index **must be a positive integer** 1, 2, 3, …
* The number of days **must be a positive integer** 1, 2, 3, …
Expand All @@ -161,13 +161,13 @@ Examples:
* `list` followed by `addLeaves 3 4` adds 4 days of leave to the 3rd employee in the employee book.
* `find Sam` followed by `addLeaves 1 1` adds 1 day of leave to the 1st employee in the results of the `find` command.

### Remove number of leave for an employee : `removeLeaves`
### Remove number of leaves for an employee : `removeLeaves`

Removes the specified number of days from the current leave quota (number of days of leave left) of a chosen employee.

Format: `removeLeaves INDEX NO_OF_DAYS`

* Removes the specified number from the number of leave of the employee at the specified `INDEX`.
* Removes the specified number from the number of leaves of the employee at the specified `INDEX`.
* The index refers to the index number shown in the displayed employee list.
* The index **must be a positive integer** 1, 2, 3, …
* The number of days **must be a positive integer** 1, 2, 3, …
Expand All @@ -188,17 +188,17 @@ Exits the program.

Format: `exit`

### Calculating hourlySalary : `calculate` `[to be implemented in v1.2]`
### Calculating Salary : `calculate` `[to be implemented in v1.2]`

Calculate and display the monthly hourlySalary of the specified employee.

Format: `calculate INDEX`
* Calculate and displays the monthly hourlySalary of the employee at the specified `INDEX`.
* Calculate and displays the monthly Salary of the employee at the specified `INDEX`.
* The index refers to the index number shown in the displayed employee list.
* The index **must be a positive integer** 1, 2, 3, …​

Example:
* `find Betsy` followed by `calculate 2` gets the hourlySalary of the 2nd employee in the results of the `find` command.
* `find Betsy` followed by `calculate 2` gets the salary of the 2nd employee in the results of the `find` command.

### Saving the data

Expand Down Expand Up @@ -227,13 +227,13 @@ _Details coming soon ..._

Action | Format, Examples
--------|------------------
**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS r/ROLE l/LEAVES s/SALARY hw/HOURSWORKED [t/TAG]…​` <br> e.g., `add n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01 r/Admin Assistant l/14 s/9.50 hw/40 t/friend t/colleague`
**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS r/ROLE l/LEAVES s/HOURLYSALARY hw/HOURSWORKED [t/TAG]…​` <br> e.g., `add n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01 r/Admin Assistant l/14 s/9.50 hw/40 t/friend t/colleague`
**Add Leaves** | `addLeaves INDEX NO_OF_DAYS` <br> e.g., `addLeaves 1 2`
**Remove Leaves** | `removeLeaves INDEX NO_OF_DAYS` <br> e.g., `removeLeaves 4 1`
**Clear** | `clear`
**Calculate** | `calculate INDEX`<br> e.g., `calculate 3`
**Delete** | `delete INDEX`<br> e.g., `delete 3`
**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [r/ROLE] [l/LEAVES] [s/SALARY] [h/HOURS_WORKED] [t/TAG]…​`<br> e.g.,`edit 2 n/James Lee e/[email protected] l/15`
**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [r/ROLE] [l/LEAVES] [s/HOURLYSALARY] [h/HOURS_WORKED] [t/TAG]…​`<br> e.g.,`edit 2 n/James Lee e/[email protected] l/15`
**Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake`
**List** | `list`
**Help** | `help`
2 changes: 1 addition & 1 deletion docs/team/beefham.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Wee Han's Project Portfolio Page

### Project: HeRon

HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leave and offs, calculating pay and updating payroll information.
HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leaves and offs, calculating pay and updating payroll information.

HeRon is a project adapted from AddressBook - Level 3.
Given below are my contributions to the project.
Expand Down
2 changes: 1 addition & 1 deletion docs/team/boonhaii.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Boon Hai's Project Portfolio Page

### Project: HeRon

HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leave and offs, calculating pay and updating payroll information.
HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leaves and offs, calculating pay and updating payroll information.

HeRon is a project adapted from AddressBook - Level 3.

Expand Down
2 changes: 1 addition & 1 deletion docs/team/danielsimre.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Daniel Sim's Project Portfolio Page

### Project: HeRon

HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leave and offs, calculating pay and updating payroll information.
HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leaves and offs, calculating pay and updating payroll information.

HeRon is a project adapted from AddressBook - Level 3. It is written in Java, and has about 10 kLoC.

Expand Down
2 changes: 1 addition & 1 deletion docs/team/szelongq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Quek Sze Long's Project Portfolio Page

### Project: HeRon

HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leave and offs, calculating pay and updating payroll information.
HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leaves and offs, calculating pay and updating payroll information.

HeRon is a project adapted from AddressBook - Level 3.

Expand Down
4 changes: 3 additions & 1 deletion docs/team/weikiat.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ title: Wei Kiat's Project Portfolio Page
// Still in progress //
### Project: HeRon Level 3

HeRon is a desktop application for Human Resource Managers in companies to increase the convenience of managing employee information
HeRon is a desktop application for HR managers to assist in managing HR administrative tasks such as tracking leaves and offs, calculating pay and updating payroll information.

HeRon is a project adapted from AddressBook - Level 3.

Given below are my contributions to the project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.util.List;
import java.util.function.Predicate;

/**
* Tests that a {@code Person}'s {@code Address} contains any of the keywords given.
* Addresses match if the specified keywords are present in the Address.
*/
public class AddressContainsKeywordsPredicate implements Predicate<Person> {
private final List<String> keywords;

Expand Down
Loading

0 comments on commit 494b4f5

Please sign in to comment.