Skip to content

Commit

Permalink
Merge pull request #207 from nixonwidjaja/master
Browse files Browse the repository at this point in the history
Update UG
  • Loading branch information
nixonwidjaja authored Nov 13, 2023
2 parents 52d2b10 + 8018c84 commit cea0498
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,12 @@ Executing command: `leave 1 m/1,3`

Views all employees who are on leave, with optional filters of month and department.

Format: `view_leave [m/Month] [d/DEPARTMENT]`
Format: `view_leave [m/MONTHS] [d/DEPARTMENT]`

- Gives a list of **all employees** who have leaves planned for the year.
- The month and department are optional arguments.
- If no one in the specified department has planned leave dates for the month, an output indicating **no employees is taking leave** is shown.
- Trailing commas in `MONTHS` (`view_leave m/1,2,3,,,`) will be ignored, but empty months elsewhere (`view_leave m/1,,,2`) will raise an error.

Examples:
- `view_leave` displays all employees who have planned leave dates in the current year.
Expand Down Expand Up @@ -326,6 +327,7 @@ Format: `birthday [m/MONTH(s)]`
- The month argument is optional. If **no month** is provided, the birthdays in the **current month** are listed.
- If there is no birthday in the month provided, return **No employees have birthdays in this month**.
- Months are separated using ",", e.g. to inquire the employees who have birthdays in Mar and Apr, the input is `birthday m/3,4`.
- Trailing commas in `MONTH(s)` (`birthday m/1,2,3,,,`) will be ignored, but empty months elsewhere (`birthday m/1,,,2`) will raise an error.

Examples:
- `birthday` displays all employees who have their birthday in the current month.
Expand Down Expand Up @@ -377,7 +379,7 @@ Executing command: `sort name desc`

### Undoing previous commands: `undo`

Undo the most recent commands that modified the employee list, i.e., `add`, `edit`, `delete`, `leave`, `clear`, `sort`, `redo` commands.
Undo the most recent commands that modified the employee list, i.e., `add`, `edit`, `delete`, `leave`, `reset_leaves`, `clear`, `sort`, `redo` commands.

Format: `undo`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class LeaveCommandParserTest {
@Test
public void parse_validArgs_returnsLeaveCommand() {
assertParseSuccess(parser, " 1 m/2", new LeaveCommand(INDEX_FIRST_PERSON, "0+0000000000"));
assertParseSuccess(parser, " 1 m/2,,,", new LeaveCommand(INDEX_FIRST_PERSON, "0+0000000000"));
assertParseSuccess(parser, " 1 m/-2", new LeaveCommand(INDEX_FIRST_PERSON, "0-0000000000"));
}

Expand Down Expand Up @@ -45,5 +46,9 @@ public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, " 1 m/13", LeaveCommand.MESSAGE_INVALID_MONTH + LeaveCommand.MESSAGE_USAGE);

assertParseFailure(parser, " 1 m/-13", LeaveCommand.MESSAGE_INVALID_MONTH + LeaveCommand.MESSAGE_USAGE);

assertParseFailure(parser, " 1 m/1,,,3", LeaveCommand.MESSAGE_INVALID_MONTH + LeaveCommand.MESSAGE_USAGE);

assertParseFailure(parser, " 1 m/1,123", LeaveCommand.MESSAGE_INVALID_MONTH + LeaveCommand.MESSAGE_USAGE);
}
}

0 comments on commit cea0498

Please sign in to comment.