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

V1.4 Interval Review Changes #161

Merged
merged 5 commits into from
Nov 12, 2018
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
17 changes: 10 additions & 7 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1481,14 +1481,17 @@ Use case ends.

* 2a. User is not logged in
** 2a1. AddressBook shows an error message.
+
Use case ends.

* 2b. No user schedule found.
** 2b1. Address book displays message `No schedule allocated`.
** 2b1. Address book displays message showing there are no schedule allocated.
+
Use case ends.

* 2c. Inappropriate parameters.
** 2c1. AddressBook shows an error message.
+
Use case ends.

+
Expand All @@ -1508,16 +1511,16 @@ Use case ends.

* 2a. User is not logged in
** 2a1. AddressBook shows an error message.
+
Use case ends.

* 2b. Target is not user and user is not ADMINISTRATOR priority level.
** 2b1. AddressBook shows an error message.
+
Use case ends.

* 2c. Inappropriate parameters.
** 2c1. AddressBook shows an error message.
Use case ends.

+
Use case ends.

Expand Down Expand Up @@ -1895,7 +1898,7 @@ Expected: No employee at index 0. Error details is shown in the status message.
==== List schedule
. Lists the schedule of an employee in address book as a non-administrator.

.. Prerequisites: Logged in as an any non-administrator user and is listed at index 4. +
.. Prerequisites: Logged in as any non-administrator user and is listed at index 4. +
.. Test case: `schedule 4` +
Expected: Displays own schedule. Details of schedule shown in status message.
.. Test case: `schedule 3` +
Expand All @@ -1904,7 +1907,7 @@ Expected: User has invalid priority level. Error details shown in status message
Expected: Index 0 is invalid. Error details shown in status message.

. Lists the schedule of an employee in address book as an administrator.
.. Prerequisites: Logged in as an any administrator and is listed at index 1. +
.. Prerequisites: Logged in as any administrator and is listed at index 1. +
.. Test case: `schedule 1` +
Expected: Displays own schedule. Details of schedule shown in status message.
.. Test case: `schedule 3` +
Expand All @@ -1915,7 +1918,7 @@ Expected: Index 0 is invalid. Error details shown in status message.
==== Set schedule
. Sets the schedule of an employee in address book as a non-administrator.

.. Prerequisites: Logged in as an any non-administrator user and is listed at index 4. +
.. Prerequisites: Logged in as any non-administrator user and is listed at index 4. +
.. Test case: `setschedule 4 ts/0900 te/1700 v/Level 5` +
Expected: Successfully set own schedule. Message is shown in the status message.
.. Test case: `setschedule 3 ts/0900 te/1700 v/Level 5` +
Expand All @@ -1925,7 +1928,7 @@ Expected: Time start and time end are the same. Error detail shown in the status

. Sets the schedule of an employee in address book as an administrator.

.. Prerequisites: Logged in as an any administrator and is listed at index 1. +
.. Prerequisites: Logged in as any administrator and is listed at index 1. +
.. Test case: `setschedule 1 ts/0900 te/1700 v/Level 5` +
Expected: Successfully set own schedule. Message is shown in the status message.
.. Test case: `setschedule 3 ts/0900 te/1700 v/Level 5` +
Expand Down
28 changes: 17 additions & 11 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,13 @@ Format: `schedule INDEX` +
* Shows schedule at the specified `INDEX`.
* The index refers to the index number shown in the displayed leave list.
* The index *must be a positive integer* 1, 2, 3, ...
* You need to have administrator privilege to view other user's schedule.
****

[NOTE]
====
* `ADMINISTRATOR` priority level is required to view schedule of other employees
====

Example: `schedule 1`

****
Expand All @@ -446,12 +450,6 @@ Sample output: +
image:schedule_cmd.png[]

==== Set schedule: `setschedule`
[NOTE]
====
* This operations requires administrator privilege to perform.
* If `TIME_START` is later than `TIME_END`, `TIME_END` refers to the following day.
====

Set schedule of the employee. +

Format: `setschedule INDEX ts/TIME_START te/TIME_END v/VENUE` +
Expand All @@ -463,6 +461,13 @@ Format: `setschedule INDEX ts/TIME_START te/TIME_END v/VENUE` +
* `TIME_START` and `TIME_END` must be in HHMM 24 hour format
****

[NOTE]
====
* If `TIME_START` is later than `TIME_END`, `TIME_END` refers to the following day.
* `TIME_START` cannot be the same as `TIME_END`.
* `ADMINISTRATOR` priority level is required to set schedule of other employees
====

Examples: +

* `setschedule 1 ts/1100 te/1600 v/Toilet` +
Expand Down Expand Up @@ -660,6 +665,7 @@ Pressing the kbd:[↑] and kbd:[↓] arrows will display the previous and

// tag::check[]
==== Check in/out working hours: `check`

Updates check in/out status for employees. +
Format: `check m/MODE` +
Examples: +
Expand Down Expand Up @@ -791,12 +797,12 @@ alphabet. NRIC for every single individuals must be unique.
| pwd/NeUeR2018

| Phone
| p/PHONE_NUMBER
| p/PHONE
| Phone numbers should contain only numbers, and should have at least three digits.
| p/81667800

| Email
| e/EMAIL_ADDRESS
| e/EMAIL
| Emails should be of the format local-part@domain, and also satisfy the following requirements: +
1) "local-part" should contain only alphanumeric characters and an underscore '_' +
2) "domain" can consist of alphanumeric characters, a period, or hyphen, but should start and end with only
Expand Down Expand Up @@ -845,12 +851,12 @@ Department names should start with a name, and ends with 'Management'.
|Parameter |Prefix |Constraints |Example

| Start Time
| ts/START_TIME
| ts/TIME_START
| Start Time should only be in numeric HHMM 24 hour format, and it should not be blank
| ts/0900

| End Time
| te/END_TIME
| te/TIME_END
| End Time should only be in numeric HHMM 24 hour format, and it should not be blank
| te/1800

Expand Down
Binary file modified docs/images/schedule_cmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ScheduleCommand extends Command {
+ "\nExample: "
+ COMMAND_WORD + " 1";

public static final String MESSAGE_SCHEDULE_SUCCESS = "Your allocated schedule:\n%s";
public static final String MESSAGE_SCHEDULE_SUCCESS = "%s's schedule:\n%s";
public static final String MESSAGE_SCHEDULE_FAIL = "Schedule Command Failed.";
public static final String MESSAGE_NO_SCHEDULE = "No schedule allocated.";

Expand Down Expand Up @@ -70,6 +70,6 @@ public CommandResult execute(Model model, CommandHistory history) throws Command
schedule = MESSAGE_NO_SCHEDULE;
}

return new CommandResult(String.format(MESSAGE_SCHEDULE_SUCCESS, schedule));
return new CommandResult(String.format(MESSAGE_SCHEDULE_SUCCESS, targetPerson.getName().toString(), schedule));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void execute_otherUserAsAdmin_success() {
List<Person> personList = model.getFilteredPersonList();
Person expectedPerson = personList.get(INDEX_FIRST_PERSON.getZeroBased());
Schedule expectedSchedule = expectedPerson.getSchedule();
String expectedResponse = "Your allocated schedule:\n" + expectedSchedule.toString();
String expectedResponse = expectedPerson.getName().toString() + "'s schedule:\n" + expectedSchedule.toString();

assertCommandSuccess(new ScheduleCommand(INDEX_FIRST_PERSON), model,
commandHistory, expectedResponse, expectedModel);
Expand All @@ -101,7 +101,7 @@ public void execute_otherUserAsAdmin_success() {
@Test
public void execute_otherUserWithNoSchedule_success() {
Index index = Index.fromOneBased(6);
String expectedResponse = "Your allocated schedule:\nNo schedule allocated.";
String expectedResponse = "Fiona Kunz's schedule:\nNo schedule allocated.";

assertCommandSuccess(new ScheduleCommand(index), model,
commandHistory, expectedResponse, expectedModel);
Expand Down