By: CS2103 W15-4
Since: Feb 2019
Licence: MIT
1. Introduction
MINDEF Duty Planner is a platform to assist military units in the SAF in the assignment of daily guard duties amongst the servicemen.
The application is optimized for those who prefer to work with a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI).
The software is designed to automate the process of fairly assigning duties to available servicemen for an entire month.
The application can be used by both Commanders and servicemen to plan and view duties with various specific commands for each type of user.
To start using MINDEF Duty Planner you can go to Section 3, “Quick Start”
To see a summary list of commands you can go to Section 6, “Command Summary”
2. Notation
-
Words that are highlighted with a grey background represent a
command
that is present or used in the application. -
Words that are highlighted in white represent a keyboard button that can be pressed to invoke a described function.
3. Quick Start
-
Ensure you have Java version
9
or later installed in your Computer. -
Log in into the system as an admin or a general user. NRIC corresponds to the username. Both the NRIC and the password are case-sensitive.
-
For master admin account: username is Admin, password is Admin
-
For other admin or general account: username is the user’s NRIC, password is NRIC by default which can be changed.
-
-
Type the command in the command box and press Enter to execute it.
e.g. typinghelp
and pressing Enter will open the help window. -
Some example commands you can try:
-
list
: lists all personnel -
add
n/John Doe nr/S9012345N p/98765432 c/Echo s/2 r/CFC t/injured
: adds a personnel namedJohn Doe
to the Personnel Database. -
delete
3
: deletes the 3rd contact shown in the current list -
exit
: exits the app
-
-
Refer to Section 4, “User Features” for details of each command.
-
Some commands can only be accessed by Admin type accounts and some by General type accounts.
4. User Features
4.1. Log in
4.1.1. Logging into a User account
NRIC and passwords are case-sensitive.
Enter in NRIC and password into the top and bottom text areas respectively, press enter.
Command Format
-
Words in
UPPER_CASE
are the parameters to be supplied by the user e.g. inedit 1 nr/NRIC
,NRIC
is a parameter which can be used asedit 1 nr/S01234567Z
. -
Items in square brackets are optional e.g
n/NAME [t/TAG]
can be used asn/John Doe t/friend
or asn/John Doe
. -
Items with
…
after them can be used multiple times including zero times e.g.[t/TAG]…
can be used ast/friend
,t/friend t/family
etc. -
Parameters can be in any order e.g. if the command specifies
n/NAME p/PHONE_NUMBER
,p/PHONE_NUMBER n/NAME
is also acceptable. -
An Admin and a User may have different formats for the same command
4.2. Features for all users
4.2.1. Viewing help : help
Lists out a list of commands & instructions
Format: help
4.2.2. List all the personnel: list
Lists out all personnel in the database with their details.
Format: list
4.2.3. View all duties for current month: viewCurrent
Brings up calendar view, with all duties for the current month.
Format: viewCurrent
4.2.4. View all duties for next month: viewNext
Brings up calendar view, with all duties for the next month.
Format: viewNext
4.2.5. View duties assigned to user : view
The user can see their details about their own duties assigned to them and their upcoming duties ranked by recency.
Format: view
4.2.6. View duties assigned to other users : view
The user can see the details of duties assigned to another user by keying in their NRIC.
Format: view NRIC
Example:
-
view S9012345L
4.2.7. Locating persons by name: find
Finds persons whose names contain any of the given keywords.
Format: find KEYWORD [MORE_KEYWORDS]
Examples:
-
find John
Returnsjohn
andJohn Doe
-
find Betsy Tim John
Returns any person having namesBetsy
,Tim
, orJohn
4.2.8. Listing entered commands : history
Lists all the commands that you have entered in reverse chronological order.
Format: history
Pressing the ↑ and ↓ arrows will display the previous and next input respectively in the command box. |
4.2.9. Undoing previous command : undo
Restores the address book to the state before the previous undoable command was executed.
Format: undo
Undoable commands: |
Examples:
-
delete 1
list
undo
(reverses thedelete 1
command) -
select 1
list
undo
Theundo
command fails as there are no undoable commands executed previously. -
delete 1
clear
undo
(reverses theclear
command)
undo
(reverses thedelete 1
command)
4.2.10. Redoing the previously undone command : redo
Reverses the most recent undo
command.
Format: redo
Examples:
-
delete 1
undo
(reverses thedelete 1
command)
redo
(reapplies thedelete 1
command) -
delete 1
redo
Theredo
command fails as there are noundo
commands executed previously. -
delete 1
clear
undo
(reverses theclear
command)
undo
(reverses thedelete 1
command)
redo
(reapplies thedelete 1
command)
redo
(reapplies theclear
command) -
schedule
confirm
undo
(reverses theconfirm
command)
4.2.11. Log Out: logout
coming in v2.0
Logs the user out of the program without exiting.
Format: logout
4.2.12. Exit : exit
Exits the program. User will be logged out automatically.
Format: exit
4.3. General / Non-master Admin User Features
4.3.1. Edit own details : edit
Edits user’s own details. Can edit one or more fields.
Format: edit [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD]
Examples:
-
edit p/84523546 r/CPL
and
Edits the phone number and rank of the user to be `84523546CPL
respectively. -
edit c/Hotel t/ pw/pass
Edits the company of the user to beHotel
, clears all existing tags, and changes password to 'pass'.
4.3.2. Make an open swap request : swap
The user can request for a duty swap with another user for the next month by keying in his current duty date and his requested date. This request will appear on the browser panel on the bottom right of the app for all to see. Another user can use the acceptSwap command to agree to the swap request. This is then subject to the approval of an admin user (i.e. commander).
Format: `swap ad/ALLOCATEDDUTYDATE (DDMMYY) rd/REQUESTEDDUTYDATE (DDMMYY)
Example:
-
swap ad/140219 rd/210219
4.3.3. Accept Swap Command : acceptSwap
The user can use this command to respond to and accept a certain swap at the given index on the open swap request list in the browser panel.
Format : acceptSwap INDEX
Example:
-
'acceptSwap 1'
4.3.4. Block dates : block
The user can block dates and set which dates they are unavailable to duties for the upcoming month. A user can block up to 15 days.
Format: block DATE DATE DATE …
The date entered must be a valid number for the upcoming month. For example if the next month is February, block 30 is an invalid input. |
This command can only be entered if next month’s duty schedule has not been confirmed yet. If it has been confirmed please request a swap on the day you wish to duties. |
If the user has successfully blocked dates they will not be scheduled for duties on the blocked days in the upcoming month.
Example:
-
block 3 6 15 21 30
4.3.5. View blocked dates : viewblock
The user can view the dates they have blocked for the upcoming month.
The blocked dates for the upcoming month will then be printed out for the user to see.
Format: viewblock
4.3.6. Remove blocked dates : removeblock
The user can remove the dates they have blocked for the upcoming month. This will remove all blocked days from the upcoming month.
Format: removeblock
A specific date cannot be removed from the list of blocked dates. If a user wishes to remove only a certain day he can removeblock and run the block command again. |
4.4. Admin Features
4.4.1. Adding a user : add
Add a user to the system with the corresponding NRIC, company, section, rank, name and contact number.
Format: add nr/NRIC c/COMPANY s/SECTION r/RANK n/NAME p/PHONE [t/TAG]
Each of the following fields entered by the user following each prefix are compulsory, and must adhere to the following format (Only the Tag field is optional):
Example:
-
add nr/S9012345L c/Echo s/2 r/CFC n/William Tan p/91234567 t/injured
Adds CFC William Tan in Echo Company Section 2 into the database.
4.4.2. Deleting a person : delete
Deletes the specified person from the duty planner.
Format: delete INDEX
Note that the program will exit if you delete your own account. |
Examples:
-
list
delete 2
Deletes the 2nd person in the duty planner personnel list. -
find Betsy
delete 1
Deletes the 1st person in the results of thefind
command.
4.4.3. Clearing all entries : clear
Clears all entries from the duty planner.
Format: clear
4.4.4. Edit any user’s details : edit
Edits an existing user’s details in the personnel list.
Format: edit INDEX [nr/NRIC] [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD] [u/A or G]
Examples:
-
edit 2 p/84523546 r/CPL u/A
Edits the phone number and rank of the 2nd person to be84523546
andCPL
respectively, and grants the person’s account administrator privileges. -
edit 1 c/Hotel t/ pw/pass
Edits the company of the 1st person to beHotel
, clears all existing tags, and changes password to 'pass'.
4.4.5. View duty points : points
Displays the duty points accumulated by each person. Additional records of each person (i.e. duties allocated, points rewarded, points penalized) can also be viewed.
Format: points [INDEX]
Calling the command without index (points ) provides a list of all persons and their accumulated duty points while calling the command with index (points INDEX ) provides the accumulated duty points of an individual person and his record (i.e. duties, points rewarded, points penalized).
|
Examples:
-
points 2
Retrieves the duty points of the 2nd person on the contact list, as well as his records with information such as duties allocated, points rewards and points penalized. -
points
Displays a list of all persons and their respective duty points.
4.4.6. Reward points : reward
Manually reward duty points to a person or a list of persons.
Format: reward i/INDEX [INDEX] [INDEX] … p/POINTS
-
Points rewarded can range from 1 to 100 for each command call.
Examples:
-
reward i/1 2 4 5 p/20
Rewards 20 points each to the 1st, 2nd, 4th and 5th person on the contact list. -
reward i/3 p/4
Rewards 4 points to the 3th person on the contact list.
4.4.7. Penalize points : penalize
Manually penalize duty points for a person or a list of persons.
Format: penalize i/INDEX [INDEX] [INDEX] … p/POINTS
-
Points penalized can range from 1 to 100 for each command call.
-
The duty points of a person can fall to less than zero.
Examples:
-
penalize i/1 2 4 5 p/20
Penalize 20 points each for the 1st, 2nd, 4th and 5th person on the contact list. -
penalize i/3 p/4
Penalize 4 points for the 3th person on the contact list.
4.4.8. View and edit duty settings (points and manpower needed for each day of the week) : settings
View and edit duty settings. Duty settings refer to the manpower needed and points rewarded for each duty based on the day of the week (e.g. Sunday, Monday, etc)
Format: settings [d/DAYOFWEEK m/MANPOWER p/POINTS]
-
DAYOFWEEK
: Mon / Tue / Wed / Thur / Fri / Sat / Sun (full spelling e.g. Monday, Tuesday etc. works as well) -
MANPOWER
: Number ranging from 1 to 10 -
POINTS
: Number ranging from 1 to 100
Calling the command settings alone displays the current duty settings while calling the command settings with the day of the week, manpower and points enables the editing of the duty settings.
|
The updated duty settings will only take effect the next time a schedule is confirmed. If schedule for next month has already been confirmed, the confirmed schedule will still follow the specifications of the previous duty settings. |
Examples:
-
settings
Displays the duty settings - for each day of the week, the manpower needed and points to be rewarded. -
settings d/sun m/3 p/4
Duty settings edited. Sunday duties now require 3 persons and 4 points will be rewarded to each person assigned a Sunday duty. -
settings d/monday m/2 p/3
Duty settings edited. Monday duties now require 2 persons and 3 points will be rewarded to each person assigned a Monday duty.
4.4.9. Schedule duties : schedule
Creates a viable duty schedule for the upcoming month. The scheduling algorithm takes into account the manpower needs of each duty day, blocked dates of each person, the current duty points of each person and points rewarded for each duty to generate a fair schedule.
Format: schedule
The algorithm is optimized such that a person with low duty points will be allocated to duties which rewards high points and possibly be given more duties. It automatically attempts to balance out the points of each person after scheduling.
The command schedule merely provides a viable duty schedule and does not confirm the schedule to the calendar. Duty points have also yet been updated. The schedule generated is not deterministic and calling schedule again will regenerate a new duty schedule.
|
Once a satisfactory duty schedule is generated, the administrator can go ahead to confirm the duty schedule. (See 4.4.10 Confirm a schedule)
Calling schedule
after next month’s duties have already been confirm will only display the confirmed duty schedule.
4.4.10. Confirm a schedule : confirm
Confirms the duty schedule that was previously generated (from the schedule
command) for the upcoming month.
Format: confirm
A confirmed duty schedule can be viewed on the calendar (using the viewNext
command). Duty points will be updated accordingly to reward those who were assigned duties.
4.4.11. Manually replace a person in the duty : replace
coming in v2.0
Replaces the particular person assigned to the duty with the given person.
Format : replace d/DUTYDATE(DDMMYY) o/NRIC n/NRIC
If the person the user is trying to replace with is already assigned to that particular duty, the system will throw an exception. Both the person getting replaced and the person replacing have to be present in the database.
Example:
-
replace d/140219 o/S9012345L n/G9043214N
Replaces the person with NRIC S9012345L in duty on 14th Feb 2019 with the person with NRIC G9043214N.
4.4.12. View Swaps Command : viewSwaps
Used to view all the swap requests that have a requester-accepter pair. The list will be shown in the results display. The Admin User can then accept or reject the swap using the AcceptSwap or RejectSwap command.
Format : viewSwaps
4.4.13. Approve Swap Command : approveSwap
The Admin User can use this command to approve a certain swap at the given index in the list of paired swap requests in the results display after a viewSwaps command. This will edit the duties in the schedule as well as the points for each user. Thereafter, the request will be deleted.
Format : approveSwap INDEX
Example: 'approveSwap 1'
4.4.14. Reject Swap Command : rejectSwap
The Admin User can use this command to reject a certain swap at the given index in the list of paired swap requests in the results display after a viewSwaps command. Thereafter, the request will be deleted.
Format : rejectSwap INDEX
Example:'rejectSwap 1'
5. FAQ
Q: What if I want to swap my duty with another person?
A: Use "swap" command to request a swap. If you receive no updates about it, contact your administrator.
Q: What is the main feature of this app?
A: The main feature is the automated duty allocation system, which significantly minimizes the amount of work that the admin has to do.
Q: What is my username and password?
A: Your username is by default your NRIC, used so prevalently in the SAF.
Your password is also your NRIC by default, unless you or your administrator changed it. you can use the 'edit' command to edit your password later on.
Q: What if I forgot my password?
A: Contact your administrator for help.
Q: What should I do if I need help with the app?
A: You can enter 'help' in the command line, or press Help > Help, or simply press F1. This will open up the User Guide in a new window.
6. Command Summary
6.1. All Users
-
Viewing help :
help
-
Viewing own duties :
view
-
View all duties for current month :
viewCurrent
-
View all duties for next month :
viewNext
-
Viewing other’s duties :
view NRIC
-
Make swap request :
swap
-
List all the users :
list
-
Locate person by name :
find KEYWORD [MORE_KEYWORDS]
-
List entered commands :
history
-
Undo command :
undo
-
Redo command :
redo
-
Exit :
exit
6.2. General / non-master admin accounts
-
Edit own info :
edit [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD]
-
Block dates :
block
-
View Blocked Dates :
viewblock
-
Remove Blocked Dates :
removeblock
-
Accept Swaps :
acceptSwap INDEX
6.3. Admin accounts
-
Add a user :
add nr/NRIC c/COMPANY s/SECTION r/RANK n/NAME p/PHONE [t/TAG]
-
Edit any user :
edit INDEX [nr/NRIC] [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD] [u/A or G]
-
Delete a user :
delete INDEX
-
Scheduling duties :
schedule
-
Confirm schedule :
confirm
-
Clear entries :
clear
-
Duty Settings :
settings
orsettings d/DAY m/MANPOWER p/POINTS
-
View Swaps :
viewSwaps
-
Approve Swaps :
ApproveSwap INDEX
-
Reject Swaps :
rejectSwap INDEX