PROJECT: Bank Address Book


Overview

Bank Address Book (BankAB) is a business process management and workflow application platform, whereby its users are all the employees in a banking environment. This platform supports the basic daily routine of each employee such as:

  • Checking working schedule

  • Applying for leave application

  • Checking in and out during working hours

The managers and administrators will have higher priority access level of BankAB such as changing the priority level of the employee and approve or reject leave requests.

Summary of contributions

  • Major enhancement: implemented scheduling system.

    • What it does: This allows all users to have a unique schedule to be updated on where and when to work for the day.

    • Justification: This feature is a core component of the product as certain functions (such as leave application), require user authentication. Both command can be executed by any user to view and set their own schedule. However, a user with priority level of ADMINISTRATOR is needed to view and set schedule for others.

    • Highlights: This is the only variable within a Person object that is more OOP oriented as Schedule is an object that contains 3 variables: TimeStart, TimeEnd and Venue. When a Person object is first created, the Schedule object can be null if not defined. Calling the toString() method will return either the details of the Schedule in string format or the nullPointerException will return 'No schedule is allocated'.

  • Code contributed: Code Dashboard

  • Other contributions:

    • Code quality:

      • Ensure Coverage is above 90 percent: #106

    • Community:

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.

Scheduling

List schedule: schedule

List schedule for the employee.

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, …​

  • ADMINISTRATOR priority level is required to view schedule of other employees

Example: schedule 1

  • Shows the schedule of employee with ID 1 in the list.

Sample output:
schedule cmd

Set schedule: setschedule

Set schedule of the employee.

Format: setschedule INDEX ts/TIME_START te/TIME_END v/VENUE

  • Set the 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, …​

  • TIME_START and TIME_END must be in HHMM 24 hour format

  • 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

Sets a schedule for 1st user to work in Toilet from 1100 hours to 1600 hours

  • setschedule 2 ts/2200 te/0800 v/Main Door

Sets a schedule for 2nd user to work at Main Door from 2200 hours to 0800 hours of the following day

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.

Schedule Feature

Implementation

The setschedule is a command that set a particular department employee’s schedule. The setschedule mechanism is facilitated by the SetScheduleCommandParser, which parses input arguments and creates a new SetScheduleCommand object. The SetScheduleCommandParser, which implements the Parser interface, parses the arguments inputted in to the CLI, and checks if the user input conforms the expected format.

Code snippet from SetScheduleCommandParser.java that shows the parsing of arguments and checking for invalid arguments:

public SetScheduleCommand parse(String args) throws ParseException {

    ...
    ...

    EditPersonDescriptor editPersonDescriptor = new EditPersonDescriptor();
    if (argMultimap.getValue(PREFIX_TIME_START).isPresent()
            && argMultimap.getValue(PREFIX_TIME_END).isPresent()
            && argMultimap.getValue(PREFIX_VENUE).isPresent()) {
        Schedule schedule = ParserUtil.parseSchedule(
                argMultimap.getValue(PREFIX_TIME_START).get(),
                argMultimap.getValue(PREFIX_TIME_END).get(),
                argMultimap.getValue(PREFIX_VENUE).get());

        Set<Schedule> scheduleList = new HashSet<>();
        scheduleList.add(schedule);

        editPersonDescriptor.setSchedule(scheduleList);
    }

    ...
    ...

}

The sequence diagram below demonstrates parse() function of SetScheduleCommandParser:

SetScheduleCommandParserSequenceDiagram
Figure 1. Sequence diagram of SetScheduleCommandParser

The sequence diagram below demonstrates execute() function of SetScheduleCommand:

SetScheduleCommandSequenceDiagram
Figure 2. Sequence diagram of SetScheduleCommand

Design Considerations

Aspect: Storage for schedule
  • Alternative 1 (current choice): Store with AddressBook XML.

    • Pros: Easier to implement (able to add onto existing parser).

    • Cons: May require extra parameters to create a Person object.

  • Alternative 2: Store in a different XML file.

    • Pros: Easy to implement (duplicate existing parser but for different XML file).

    • Cons: Consumes extra time to delete schedule when a particular person is deleted.

  • Alternative 3: Store in a different file format.

    • Pros: Easier to understand.

    • Cons: Consumes extra time to implement different parser from scratch.

Scheduling

List schedule

  1. Lists the schedule of an employee in address book as a non-administrator.

    1. Prerequisites: Logged in as any non-administrator user and is listed at index 4.

    2. Test case: schedule 4
      Expected: Displays own schedule. Details of schedule shown in status message.

    3. Test case: schedule 3
      Expected: User has invalid priority level. Error details shown in status message.

    4. Test case: schedule 0
      Expected: Index 0 is invalid. Error details shown in status message.

  2. Lists the schedule of an employee in address book as an administrator.

    1. Prerequisites: Logged in as any administrator and is listed at index 1.

    2. Test case: schedule 1
      Expected: Displays own schedule. Details of schedule shown in status message.

    3. Test case: schedule 3
      Expected: Displays schedule of employee at index 3. Details of schedule shown in status message.

    4. Test case: schedule 0
      Expected: Index 0 is invalid. Error details shown in status message.

Set schedule

  1. Sets the schedule of an employee in address book as a non-administrator.

    1. Prerequisites: Logged in as any non-administrator user and is listed at index 4.

    2. Test case: setschedule 4 ts/0900 te/1700 v/Level 5
      Expected: Successfully set own schedule. Message is shown in the status message.

    3. Test case: setschedule 3 ts/0900 te/1700 v/Level 5
      Expected: User has invalid priority level. Error detail shown in the status message.

    4. Test case: setschedule 4 ts/0900 te/0900 v/Level 5
      Expected: Time start and time end are the same. Error detail shown in the status message.

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

    1. Prerequisites: Logged in as any administrator and is listed at index 1.

    2. Test case: setschedule 1 ts/0900 te/1700 v/Level 5
      Expected: Successfully set own schedule. Message is shown in the status message.

    3. Test case: setschedule 3 ts/0900 te/1700 v/Level 5
      Expected: Successfully set schedule for employee at index 3. Message is shown in the status message.

    4. Test case: setschedule 4 ts/0900 te/0900 v/Level 5
      Expected: Time start and time end are the same. Error detail shown in the status message.