PROJECT: Delino


Overview

Delino is a desktop application for couriers to manage delivery tasks. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 16 kLoC.

Summary of contributions

  • Major enhancement:

    • Added insert command (Pull request #189)

      • What it does: Allows the user to insert new delivery order into the Order List. The user can add an order that contains the following attributes : Transaction ID, Name of Customer, Phone, Email, Address, Delivery Timestamp, Warehouse location, Cash on Delivery, Comment (Optional) and Type of Item (Optional)

      • Justification: This is an important feature and it is a must-have. It allows user to insert multiple orders into the list.

    • Refactor the list command (Pull request #239)

      • What it does: Instead of simply displaying all the orders, the user can choose to list :

        • Delivered orders

        • Undelivered orders

      • Justification: The feature helps the user, as a courier, to know how many orders have to be completed and how many orders are already completed.

    • Added the show command (Pull request #199)

      • What it does: It gives a more detailed information about the orders and return orders in their lists, in the form of numbers and PieChart. The information shown is :

        • Total Earnings

        • Orders Completed

        • Orders Returned

        • A PieChart to show to the user on how many orders are completed and not completed, returned and not returned.

    • Highlights:
      Ability to let user to see information based on the date(s) provided. For example, the user can enter : show 2020-02-02 2020-09-01 to see all the information about the orders that are from the date 2020-02-02 up to the date 2020-09-01. In addition, user can show statistics about everything in all the lists or just simply showing the statistics for today.

    • Credits: UI Design ideas for show Command from https://www.youtube.com/watch?v=UDi051XyQ-U&t=339s

  • Minor enhancement:

    • Fix bugs for the Application (Pull requests #309, #233)

      • What it does: Restricts user from entering any invalid values

      • Justification: This is an essential update, as the invalid values will affect the rest of the features.

  • Code contributed: [Functional code and Test code]

  • Other contributions:

    • Project management:

      • Responsible for ensuring that the team’s code is compliant with the coding standards and in charge of defining, assigning and tracking all project tasks.

    • Enhancements to existing GUI:

      • Make major changes to the UI to change from Window to TabView (Pull request #318)

    • Documentation:

      • Add Manual Testing Instructions for Developer Guide. (Pull request #81)

      • Update Developer Developer Guide. (Pull requests #171, #252)

    • Community:

      • PRs reviewed (with non-trivial review comments): (Pull requests #299, #227, #218, #193, …​)

    • Tools:

      • Integrated a third party library (Netlify) to the project (#1708e0b)

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.

Features

Insert feature

This whole section of the Insert feature can be found here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Inserting an order: insert [Done by Amos Cheong Jit Hon]

This section shows you how to use the insert Command and the relevant examples.

Whenever you have a new delivery order to make, you have to add it into your list of orders. The insert Command is in charge of this functionality.

How to use the Insert Command

Orders inserted are sorted by their delivery date and time.

Here are the steps on using the insert Command:

Step 1 : Type in the keyword insert

Step 2 : Add in the prefixes TRANSACTION_ID CUSTOMER_NAME ADDRESS PHONE_NUMBER EMAIL DELIVERY_DATE_AND_TIME WAREHOUSE_LOCATION CASH_ON_DELIVERY of the delivery orders

Step 3 (Optional) : Add in the Customer comment and type of item using the prefixes [COMMENT_BY_CUSTOMER] [TYPE_OF_ITEM]

Step 4 : Press Enter on your keyboard to see the magic!

What constitutes a valid Insert command

  • The TRANSACTION_ID refers to the transaction id of the order.

  • The CUSTOMER_NAME refers to the name of the recipient of the order.

  • The ADDRESS refers to the address of the recipient.

  • The PHONE_NUMBER refers to the phone number of the recipient.

  • The EMAIL refers to the email address of the recipient.

  • The DELIVERY_DATE_&_TIME refers to the delivery date and time of the order.

  • The WAREHOUSE_LOCATION refers to the warehouse that the courier should collect the order from.

  • The CASH_ON_DELIVERY refers to the money earned from delivering the particular order.

  • The [COMMENTS_BY_CUSTOMER] refers to the comment made by the recipient to the courier.

  • The [TYPE_OF_ITEM] refers to the type of item that the courier is delivering.

  • The prefixes tid/TRANSACTION_ID n/CUSTOMER_NAME a/ADDRESS p/PHONE_NUMBER e/EMAIL dts/DELIVERY_DATE_AND_TIME w/WAREHOUSE_LOCATION cod/CASH_ON_DELIVERY are compulsory.

  • The prefixes c/COMMENTS_BY_CUSTOMER type/TYPE_OF_ITEM are optional.

  • Any compulsory prefixes that is absent will result in the App displaying an error message.

  • There should be a spacing in between every prefixes. For example, tid/TRANSACTION_ID n/CUSTOMER_NAME is allowed but tid/TRANSACTION_IDn/CUSTOMER_NAME will be an invalid command input.

  • TRANSACTION_ID must be alphanumeric (No numbers or special characters allowed).

  • ADDRESS should contain a valid Singapore address followed by a postal code.

  • EMAIL should be a valid email address.

  • CASH_ON_DELIVERY must start with a dollar sign followed by the value.

  • CASH_ON_DELIVERY value must be strictly less than $10,000. If there is a need to add decimal places, you can only add two.

  • Do not add any commas in the value of CASH_ON_DELIVERY

  • To add the Delivery Date and Time, first type in the date in this format : YYYY-MM-DD. Followed by adding the time in 24 hour format.

  • The value for DELIVERY_DATE_AND_TIME must be a time in the future. For example, if the date and time now is 2020-04-03 1200, you are not allowed to add 2020-04-03 1159 as the DELIVERY_DATE_AND_TIME.

  • TYPE_OF_ITEM must consist of only alphabets (No numbers or special characters allowed).

  • CUSTOMER_NAME must consist of only alphabets (No numbers or special characters allowed).

  • PHONE_NUMBER should not have a spacing in between. n/90011009 is allowed,
    but n/9001 1009 is not allowed.

  • Only numbers are allowed in PHONE_NUMBER.

These are the possible combinations of the insert command:

Table 1. Possible combinations of Insert Command
Scenario Command Result

Insert the order without a comment and no item type.

insert tid/A094844 n/John Doe a/Blk 505 Tampines #10-33 S520505 p/98761111 e/johndoe@example.com dts/2020-05-20 1300 w/Yishun cod/$4

You should be able to see that the order with transaction id A094844 will be inserted into the list of delivery orders.

Insert the order with all the order attributes including the non-compulsory ones.

insert tid/C1023456789 n/Amos Cheong a/Blk 571 Hougang st 51 #02-02 S530571 e/amoscheong@example.com p/90010019 dts/2020-05-10 1650 w/Marsiling cod/$5 c/Leave it at the riser type/glass

You should see that the order with transaction id C1023456789 is inserted into the list of delivery orders.

  • List of order attribute prefixes can be found here.

List feature

This whole section of the List feature can be found here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Listing orders : list [Done by Amos Cheong Jit Hon]

In this section, you will learn more about the list command and how to use it.

As a courier, you would want to take a look at all the orders that you have in your list of orders regardless of the type of orders or the order status. The list Command will enable you to view all these orders.

How does the List Command works

Here are the steps to execute the list command:

Step 1 : Type in the keyword list.

Step 2 : If you want to simply see all your delivery and return orders. Otherwise, please proceed to Step 3. Else, skip to Step 4

Step 3 : Provide the following [KEYWORD] : done (Show all your completed orders) or undone (Show all your uncompleted orders)

Step 4 : Press Enter on your keyboard and see the magic!

What constitutes a valid List command

The syntax of a valid list command is as shown: list [KEYWORD]

These are the possible combinations of the list command:

Table 2. Possible combinations of List Command
Scenario Command Result

Display all orders.

list

Show two lists of all orders. One list for delivery orders, the other for return orders

Display all completed orders.

list done

Show two lists of all completed orders. One list for delivery orders, the other for return orders

Display all uncompleted orders.

list undone

Show two lists of all uncompleted orders. One list for delivery orders, the other for return orders

  • KEYWORD can only be either done or undone.

Show feature

This whole section of the Show feature can be found here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Showing statistics : show [Done by Amos Cheong Jit Hon]

This section will explain more about the show command and how to use it.

At some point of time, you would want to know how many orders have you delivered or what is your earnings for today. Therefore, you have to use the show command to view those information.

How to use the Show command

In this section, you will learn how to use the show Command.

Here is how you can show the statistics of your orders:

Step 1 : Type show

Step 2 : If you want to see your statistics for all the orders, simply type all and skip to Step 5

Step 3 : Type today to show the statistics for today or simply type in a date in a date format of yyyy-mm-dd

Step 4 (Optional) : Type another date in yyyy-mm-dd format to see the statistics within the date range. This date must be after or equal to the date provided previously

Step 5 : Press Enter on your keyboard to see the magic!

The show command opens up a new window that displays the following information :

  • Earnings

  • Orders Delivered

  • Orders Returned

  • PieChart that display numbers for orders delivered, not delivered, returned and not returned

What constitutes a valid Show Command

In this section, you will learn about the correct syntax for a valid show command and all the different combinations of the command.

All the syntax for a valid show command is shown below:

  • show START_DATE [END_DATE]

  • show all

  • show today

  • show DATE

  • Only one or two arguments is allowed for the show command.

  • The value of START_DATE can be just the word today (Showing statistics just for today)

  • END_DATE is an optional field. If included, the command will show statistics based on the given range (inclusive) of dates

  • START_DATE cannot be a date after END_DATE

  • show all command is the only command that accepts only one argument. It shows all the statistics in the list regardless of the dates

These are the possible combinations of the show command:

Table 3. Possible combinations of Show Command
Scenario Command Result

Showing all the orders statistics regardless of date.

show all

You will be brought to the Statistics tab and the statistics of all orders will be displayed to you.

Showing the statistics for today.

show today

You will be brought to the Statistics tab and the statistics for today’s orders will be displayed to you.

Showing the statistics for the date between today and the end date provided.

show today 2020-12-03

You will be brought to the Statistics tab and the statistics between today’s date and 2020-12-03 will be displayed to you.

Showing the statistics for just the given date.

show 2020-12-03

You will be brought to the Statistics tab and the statistics in 2020-12-03 will be displayed to you.

Showing the statistics within two given dates.

show 2020-12-03 2021-01-01

You will be brought to the Statistics tab and the statistics for the date between 2020-12-03 and 2021-01-01 will be displayed to you.

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.

Features

Insert feature

This whole section of the Insert feature can be found here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Insert Feature

In this section, the functionality of the insert feature, the expected execution path, the structure of the InsertCommand class, the structure of the InsertCommandParser class and the interactions between objects with the InsertCommand object will be discussed.

What is the Insert feature

The insert feature allows the user to insert an incoming delivery order into the list using the command line.

The order consists of : Transaction ID, Name, Phone, Address, Email, Delivery Timestamp, Warehouse location, CashOnDelivery

The order also consists of two optional fields that can be added:

  1. Type of Item

  2. Comment for Courier

Path Execution of Insert Command

The overview of the InsertCommand Activity Diagram is shown below:

InsertActivityDiagram
Figure 1. Insert Activity Diagram

After the user calls the insert command, the code will check if the command has all the compulsory prefixes present. The code will throw a ParseException when there are missing prefixes. After that is checked, it will check if the new order added is a duplicate (The Order is already inserted into the application). It will throw a CommandException when the user tries to insert a duplicate order. Otherwise, it will insert the order and prints a success message to the user.

Structure of Insert feature

The following diagrams shows the overview of the InsertCommand Class Diagram:

InsertClassDiagram
Figure 2. Insert Class Diagram

The above class diagram shows the structure of the InsertCommand and its associated classes and interfaces. Some methods and fields are not included because they are not extensively utilised in InsertCommand; such as public static fields and getter/setter methods.

Structure of InsertCommandParser Class

InsertParserClassDiagram
Figure 3. InsertCommandParser Class Diagram

The above class diagram shows the structure of the InsertCommandParser and its associated classes and interfaces. It describes all the class dependencies of the InsertCommandParser class. Some methods and fields are not included because they are not extensively utilised in InsertCommand; such as public static fields and getter/setter methods. As shown in the diagram above, the InsertParser make use of methods from classes such as using the getValue method from the ArgumentMultimap class.

Interaction between objects when the Insert Command is executed

Here is the sequence diagram for the Insert Command as shown below:

InsertCommandSequenceDiagram
Figure 4. Insert

The arguments of the insert command will be parsed using the parse method of the InsertCommandParser class.
The InsertCommandParser will tokenize the arguments parsed in using the tokenize method of ArgumentTokenizer class which returns the tokenized arguments. Using the tokenized arguments, the Parser will check if the arguments parsed in matches with the tokenized arguments using the arePrefixesPresent method.

There are two scenarios :

  1. Some compulsory prefixes are not present :
    InsertCommandParser will throw a new ParseException object to the LogicManager.

  2. All compulsory prefixes are present in the arguments :
    It will the proceed to use the getValue method of the ArgumentMultimap class to get the value of the prefix. For example, if the argument parsed in is tid/A12345, the getValue method will get the value 'A12345'. Subsequently, it will use the ParseUtil methods to get the corresponding object values and put it into the parameters of the new Order object. The order object will be put into the parameter of the InsertCommand object and this will be returned to the LogicManager class for execution.

LogicManager will call the execute() method of this InsertCommand object. In the execute() method, it will use the Model class to call hasOrder method to check for duplicates, if it is a duplicate, the order will throw a CommandException which indicates that there is a duplicate order in the OrderBook already. Else, it will successfully inserts the new order using addOrder method. Finally, it return a new CommandResult object, containing a String that indicates a successful insertion.

List feature

This whole section of the List feature can be found here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

List feature

In this section, the functionality of the list feature, the expected execution path, the structure of the ListCommand class and the interactions between objects with the ListCommand object will be discussed.

What is the List feature

List feature allows the user to see all the orders from both Delivery Orders and Return Orders.

The user can enter list to display all the orders. Besides that, the user can also input done to display all delivered orders and undone to display all orders that are not delivered.

Path execution of the List Command

ListActivityDiagram
Figure 5. List Activity Diagram

The above activity diagram shows the logic and the path execution when the list command is executed. There are only three correct syntax available for ListCommand:

  • list

  • list done

  • list undone

The code will check if the input is one of the three mentioned above. If the input is not one of the three, it will cause the code the throw an error message to the user.

Structure List feature

The structure of the List Feature is as shown below:

ListClassDiagram
Figure 6. List Class Diagram

The above class diagram shows the structure of the ListCommand and all its associated classes and interfaces. The ListCommand has dependencies on the Model class as it uses the two methods from it :

  • updateFilteredOrderList

  • updateReturnFilteredOrderList

There are other variables and strings not shown in this Class Diagrams as they are either static methods or variables.

Interaction between objects during execution of List Command

The sequence diagram for the list command is shown below:

ListCommandSequenceDiagram
Figure 7. List Command Sequence Diagram

The user first calls the command list.

The second argument of the list command can be done or undone or an empty String.

The LogicManager will call the parseCommand method of DelinoParser, which then passes the second argument into the ListCommand object. This object will then be ultimately returned to the LogicManager. Next, the LogicManager will call the execute(model) method using the ListCommand object. In this method, it wil use the Model object to call the methods : updateFilteredOrderList and updateFilteredReturnOrderList. Since in this case, the argument is empty, the predicate that is parsed to the two methods will always result to true, which means to list everything from the order book and return book. When completed, the execute(model) will return a CommandResult object to the LogicManager, indicating that the command execution is a success.

Show feature

This whole section of the Show feature can be found here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Show feature

In this section, the functionality of the show feature, the expected execution path, the structure of the ShowCommand class and the interactions between objects with the ShowCommand object will be discussed.

What is the Show feature

The show feature allows the user to see the statistical information of all the orders for both Delivery Orders and Return Orders.

There are a few ways in which the user can input to the command box to execute the show command:

  • show START_DATE [END_DATE]

  • show all

  • show today

  • show DATE

Path execution of the Show Command

ShowCommandActivityDiagram
Figure 8. Show Command Activity Diagram

The above activity diagram shows the logic and the path execution when the show command is executed.

The main logic of the ShowCommand is to check if the number of arguments in the input besides show is one or two. If it is neither, the code will throw an exception. If there is only one argument, the code will check if the word provided is either all or today or simply just a DATE the value of DATE will be validated to check if it is a valid date. It throws an error if it is invalid. When its correct, the code will execute the input accordingly. If the number is two arguments, it will check if the dates provided are valid or invalid date. It throws an error for the latter. The code will then ensure that the START_DATE is before the END_DATE. Once the input passes all the validations in the ShowCommand code, the command will then be executed and it prints a success message to the user.

Structure Show feature

The structure of the show feature is as shown below:

Show Command Class Diagram

ShowCommandClassDiagram

The above diagram shows all the methods and variables that the ShowCommand class is using when the command is executed. All the static methods and variables are not mentioned in this diagram. Furthermore, there are some methods and variables omitted from this diagram as it is irrelevant to the ShowCommand class.

Interaction between objects during execution of Show Command

The sequence diagram for the show command is shown below:

ShowCommandSequenceDiagram
Figure 9. Show Command Sequence Diagram

The user first calls the command "show all".

It can accept either one or two arguments.

The LogicManager will call the parseCommand method of DelinoParser, which then passes the second argument into the ShowCommand object. Within the object, it will call the parseData method to make sense of the dates given. After that, it returns the object to the LogicManager. Next, the LogicManager will call the execute(model) method using the ShowCommand object. When completed, the execute(model) will return a CommandResult object to the LogicManager, indicating that the command execution is a success. In this case where the input is "show all", it will have a message that indicates that the command is showing all information.

Use Cases

Use case for insert feature

This whole section on Use case for insert feature can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Use case: UC01 - Insert an order

MSS

  1. User wants to add an order.

  2. User key in the order details.

  3. Delino inserts the order details.

  4. Delino displays order added.

    Use case ends.

Extensions

  • 2a. Delino detects invalid syntax from user input.

    • 2a1. Delino shows an error message.

      Use case ends.

  • 2b. Delino detects the insertion of a duplicate order.

    • 2b1. Delino shows duplicate order message.

      Use case ends.

  • 2c. Delino detects invalid DELIVERY_TIMESTAMP, i.e. order with the given DELIVERY_TIMESTAMP is before the delivery time stamp of the order.

    • 2c1. Delino shows an error message to the user.

      Use case ends.

  • 2d. Delino detects missing parcel attributes.

    • 2d1. Delino shows an error message to the user.

      Use case ends.

Use case for show feature

This whole section on Use case for show feature can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Use case: UC13 - Show statistics

Preconditions: There should be a delivered order/return order in the list.

MSS

  1. User wants to know about their delivery statistics.

  2. User requests to see the statistics of orders or return orders.

  3. Delino displays the statistics.

Extensions

  • 2a. Delino detects invalid syntax from user input.

    • 2a1. Delino shows an error message.

  • 2b. Delino detecs an invalid date from user input.

    • 2b1. Delino shows an error message.

Use case ends.

Use case for list feature

This whole section on Use case for list feature can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Use case: UC10 - Listing all orders

MSS

  1. User wants to view all orders.

  2. User requests to view the list of orders.

  3. Delino display list of orders.

    Use case ends.

Extensions

  • 2a. Delino detects invalid syntax from user input.

    • 2a1. Delino shows an error message.

      Use case ends.

  • 3a. Delino detects no orders.

    • 3a1. Delino shows empty order list message.

      Use case ends.

Glossary

This whole section on Glossary can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Command Prefix

Table 4. Command Prefix
Prefix Order Attributes Used in the following Command(s)

ot/

Order Type

Import

tid/

Transaction ID

Edit, Insert, Return, Search, Import

n/

Customer Name

Edit, Insert, Return, Search, Import

a/

Address

Edit, Insert, Return, Search, Import

p/

Phone Number

Edit, Insert, Return, Search, Import

e/

Email

Edit, Insert, Return, Search, Import

dts/

Delivery Date And Time

Edit, Insert, Return, Search, Import

rts/

Return Date and Time

Return, Search, Import

w/

Warehouse Location

Edit, Insert, Return, Search, Import

cod/

Cash On Delivery

Edit, Insert, Search, Import

c/

Comments by Customer

Edit, Insert, Return, Search, Import

type/

Type of Item

Edit, Insert, Return, Search, Import

Appendix G: Instructions for Manual Testing

Manual Testing for insert

This whole section on manual testing for insert feature can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Inserting an order

  1. Insert a minimum of 2 orders

    1. Insert command format: insert TRANSACTION_ID CUSTOMER_NAME ADDRESS PHONE_NUMBER EMAIL DELIVERY_TIMESTAMP WAREHOUSE_LOCATION CASH_ON_DELIVERY [COMMENTS_BY_CUSTOMER] [TYPE_OF_ITEM]

    2. Test case: insert tid/9876543210 n/John Doe a/Blk 572 Hougang st 51 #10-33 S530572 p/98766789 e/johndoe@example.com dts/2020-05-20 1300 w/Yishun cod/$4
      Expected: Inserts an order with the above details to the list and displayed on the GUI

    3. Test case: insert tid/1023456789 n/Amos Cheong a/Blk 572 Hougang st 51 #11-37 S530572 p/90010019 e/amoscheong@example.com dts/2020-05-10 1650 w/Marsiling cod/$5 c/Leave it at the riser type/glass
      Expected: Inserts the order to the list, including the item type and the order comment

    4. Test case: Invalid Syntax
      Expected: No order is added. Error details shown in the response message. A help message displayed for user to insert accordingly. Status bar remain unchanged

    5. Test case: Insert order with existing Transaction ID in list
      Expected: An error will occur and a message will be displayed, stating that order with duplicate ID cannot be inserted into the list

Manual Testing for list

This whole section on manual testing for list feature can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

List orders

  1. List all the delivery orders for the user. The type of orders to be listed is dependent on the command input from the user

    1. Test case: list
      Expected: List all the delivery orders, showing all completed and uncompleted orders.

    2. Test case: list done
      Expected: List all completed delivery orders.

    3. Test case: list undone
      Expected: List all uncompleted delivery orders.

    4. Test case: list ANY_WORD_OTHER_THAN_UNDONE_AND_DONE
      Expected: An error will occur, a message will appear in the response box, indicating an invalid list command

Manual Testing for show

This whole section on manual testing for show feature can be found at here. This link is provided in the event if some of the cross links are not working, as they refer to documents done by another team member

Show

  1. Opens a window which shows the statistics of the current lists of orders. It displays information such as earnings made, orders delivered and orders returned (Including a PieChart).

    1. Test case: show all
      Expected: All statistical information of all the orders shown in the statistics tab.

    2. Test case: show today
      Expected: All statistical information today shown in the statistics tab.

    3. Test case: show today 2020-12-03
      Expected: All statistical information between the dates shown in the statistics tab.

    4. Test case: show 2020-12-03
      Expected: All statistical information for the given date shown in the statistics tab.

    5. Test case: show 2020-12-03 2021-01-01
      Expected: All statistical information within the dates shown in the statistics tab.

    6. Test case: Invalid syntax
      Expected: An error will occur and the response box will show an error message.