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

Update UG #207

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
Loading