PROJECT: MINDEF Duty Planner


Overview

Duty Planner is a desktop application used to organise and plan duties for army personnel with various functions for commanders as well as duty personnel. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10kLoC.

Summary of contributions

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

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

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

Log Out: logout coming in v2.0

Logs the user out of the program without exiting.
Format: logout

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.

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.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Model component

ModelClassDiagram
Figure 1. Structure of the Model Component

API : Model.java

The Model,

  • stores a UserPref object that represents the user’s preferences.

  • stores the Duty Personnel data.

  • stores the implementation of the Calendar and DutyDates.

  • stores the implementation of a Duty Personnel.

  • exposes an unmodifiable ObservableList<Person> that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.

  • does not depend on any of the other three components.

As a more OOP model, we can store a Tag list in Personnel Database, which Person can reference. This would allow Personnel Database to only require one Tag object per unique Tag, instead of each Person needing their own Tag object. An example of how such a model may look like is given below.

ModelClassBetterOopDiagram

Storage component

StorageClassDiagram
Figure 2. Structure of the Storage Component

API : Storage.java

The Storage component,

  • can save UserPref objects in json format and read it back.

  • can save the Personnel Database data in json format and read it back.

Duty Calendar

DutyCalendar is an attribute of PersonalDatabase. It comprises of three DutyMonth objects — namely currentMonth, nextMonth and dummyNextMonth and a DutyStorage object — dutyStorage.

  • currentMonth represents the current month.

  • nextMonth represents the upcoming month.

  • dummyNextMonth is a dummy DutyMonth object that mirrors the contents of nextMonth.

    • It is instantiated each time schedule command is called. The scheduling alogorithm is invoked to produce a viable duty schedule in dummyNextMonth.

    • When confirm command is called, nextMonth will point to the dummyNextMonth.

  • dutyStorage stores the accumulated duty points and duty records of each person.

DutyCalendar implements the following operations:

  • DutyCalendar#rollover() — replaces currentMonth with nextMonth and a new nextMonth object will be instantiated. rollover() will be called automatically when the application begins and the currentMonth object no longer correspond to the actual current month in real time.

  • DutyCalendar#scheduleDutyForNextMonth() — instantiates dummyNextMonth and runs the scheduling algorithm on it.

  • DutyCalendar#confirm() — confirms the latest duty schedule by allowing nextMonth to point to the current instantiation of dummyNextMonth.

Appendix A: User Stories

Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *

Priority As a(an) …​ I want to …​ So that I can…​

* * *

admin

see Admin Help

refer to instructions specific to the administrator privileges

* * *

admin

choose 2 users to swap duties

allow them to have their desired duty slot

* * *

admin

schedule the duties automatically

save time on scheduling

* * *

admin

make sure that the scheduling is correct and fair

* *

admin

promote a general user to an admin

let the user do admin work

* * *

admin

add a new person

* * *

admin

delete a person

remove entries that I no longer need

* * *

admin

let only admins to use certain commands

the database will be protected

* * *

user

log in

access my information

* * *

new user

see usage instructions

refer to instructions when I forget how to use the App

* * *

user

find a person by name

locate details of persons without having to go through the entire list

* * *

user

request an administrator to swap duty with another person

get my desired duty

* *

user

hide private contact details by default

minimize chance of someone else seeing them by accident

*

user with many persons in the personnel database

sort persons by name

locate a person easily

* * *

user

block certain dates

choose not to do duty on certain dates

*

user with duties

see my own duties

* * *

visual user

see all the duties in a user-friendly form

understand the whole better

* * *

general user

edit my own details

* *

general user

view my blocked dates

Use case 2 (Admin): Delete person after schedule for next month is confirmed

MSS

  1. PersonnelDatabase already has confirmed duty schedule

  2. User requests to list persons

  3. PersonnelDatabase shows a list of persons

  4. User requests to delete a specific person in the list

  5. PersonnelDatabase deletes the person

  6. PersonnelDatabase deletes the confirmed duty schedule

  7. PersonnelDatabase asks the user to schedule the duties again

    Use case ends.

Extensions

  • 2a. The given index is invalid.

    • 2a1. PersonnelDatabase shows an error message.

      Use case resumes at step 3.

Use case 5 (Admin): Schedule duties

MSS

  1. User requests to schedule duties for the upcoming month.

  2. PersonnelDatabase shows the list of duty personnel and duties for the upcoming month.

    Use case ends.

Extensions

  • 2a. The user does not exist.

    • 2a1. PersonnelDatabase shows an error message indicating that no such user is found.

      Use case ends.

  • 2b. The user does not have any duties.

    • 2b1. PersonnelDatabase shows an error message indicating that the user is not assigned to any duties.

      Use case ends. Extensions

Use case 6 (Admin): Clear all the database, including duties

MSS

  1. Admin requests to clear all personnel and duties from database.

  2. All data including personnel and upcoming duties is wiped and shown on the MainWindow UI.

Use case 7 (Admin): Approve swapping of duties

MSS

  1. The user logs into the system.

  2. PersonnelDatabase shows a list of swap requests.

  3. The user approves a swap request.

  4. PersonnelDatabase swaps the corresponding persons in respective duties.

  5. PersonnelDatabase deletes the request from the system.

    Use case ends.

Extensions

  • 2a. There are no duty swap requests.

    Use case ends.

Use case 8 (General user): See own duties

MSS

  1. User requests to see his own duties.

  2. PersonnelDatabase shows all the duties the user is assigned to.

    Use case ends.

Extensions

  • 2a. The user is the master admin.

    • 2a1. PersonnelDatabase reminds the user that the master admin cannot be assigned to duties.

      Use case ends.

  • 2b. The user is not assigned to any duties.

    • 2b1. PersonnelDatabase shows an error message indicating that the user is not assigned to any duties.

      Use case ends