PROJECT: Deliveria


Introduction

This document serves as a project portfolio for Deliveria. It summarises the contributes that I have made and the features I have implemented.

Project Overview

Deliveria is a desktop application that allows a delivery manager to manage and assign delivery tasks efficiently. While it consists of a Graphical User Interface (GUI) that is user-friendly, Deliveria is optimized for those who prefer to work with a Command Line Interface (CLI) which allows fast management of the delivery tasks in an organisation.

This is what Deliveria looks like:

Deliveria GUI label
Figure 1. The graphical user interface (GUI) of Deliveria

Summary of contributions

This section shows the enchancements that I have contributed to Deliveria.

  • Major enhancements

    • Major enhancement 1: added the enhancement to generate delivery task summary in a PDF Document. (#208)

      • What it does: It generates delivery tasks' information of each driver for the day in PDF.

      • Justification: This feature will save time for delivery mangers to instruct the drivers. It acts as a instruction manual that contains essential information needed for the drivers to execute their tasks.

      • Highlights: This enhancement organises the drivers', customers' and tasks' information in a standardised table format that is easy to understand and refer. An in-depth understanding of iText7 is required to implement this enhancement.

      • Credits: A third-party library, iText7 is heavily utilized to generate the PDF document.

    • Major enhancement 2: added the enhancement to generate delivery orders in a PDF Document. (#239)

      • What it does: Generates a delivery order layout that encompasses the goods', customers' and company’s information in PDF format.

      • Justification: This feature will save time to create delivery orders which is necessary for every delivery tasks. It contains all the essential information needed to be used as a proof between the delivery company and the receiver, that goods delivered are as per order and accepted in good condition.

      • Highlights: This enhancement allows integration of company’s information in the delivery order as a header. Updating of company’s information can be achieved through a single command. An in-depth understanding of iText7 is required to implement this enhancement.

      • Credits: A third-party library, iText7 is heavily utilized to generate the PDF document.

  • Minor enhancements

    • Refactor storage and introduced a CentralManager to encapsulates all the data needed to be saved and loaded, which makes it easier to access the data. (#118)

    • Added storage for Task and Driver. (#91, #113)

    • Added Create, Read, Update, Delete (CRUD) commands for Delivery Tasks. (#91, #100, #120, #121)

  • Code contributed: [RepoSense]

  • Other contributions:

    • Project management:

      • Integrated Coveralls for checking test coverage and Codacy for checking code quality: (#218)

      • Managed the User stories in the Github Project Dashboard (StoryBoard)

      • Managed Milestones on Github (Milestones)

    • Enhancements:

      • Introduced IdManager to keep track of the unique ID used by each entities. (Task, Customer & Driver) ((#113)

      • Added test cases to Task and TaskList. #125

      • Added test cases to SavePdfCommand, DoneCommand and EditTaskCommand. (#230)

    • Documentation:

      • Added implementation and diagrams of AddTaskCommand and SavePdfCommand in developer guide. (#107, #220)

      • Added and updated the diagrams for storage component in the developer guide. (#107, #124)

      • Added add task, delete task, edit task commands usage instructions in user guide. (#107, #124)

    • Community:

      • Reviewed most of my teammates' pull requests (with non-trivial review comments): (#234, #139, #98, #80)

    • Tools:

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.


Add a delivery task: addT

Adds a delivery task to the task manager.
Format: addT [g/DESCRIPTION OF GOODS] [c/CUSTOMER ID] [dt/DATE OF DELIVERY]

  • DATE OF DELIVERY must be today onwards. Date format: d/M/yyyy.

  • All fields are compulsory.

Examples:

  • addT g/100 frozon boxes of red grouper c/13 dt/10/12/2019

  • addT g/1x washing machine c/10 dt/12/1/2020 ''' ==== Edits a delivery task : editT

Edits a existing delivery task in the task manager.
Format: editT [TASK ID] [g/DESCRIPTION OF GOODS] [c/CUSTOMER ID] [dt/DATE OF DELIVERY]

  • Edited DATE OF DELIVERY must be today onwards. Date format: d/M/yyyy.

  • Only indicate fields that you want to change.

  • Edited DATE OF DELIVERY must be today onwards. Date format: d/M/yyyy.

  • COMPLETED tasks cannot be edited.

Examples:

  • editT 3 g/50 frozen boxes of catfish
    Edits the description of the task (Task ID: 3) to be 50 frozen boxes of catfish.

  • editT 5 c/2 dt/10/12/2019
    Edits the customer and date of delivery of the task (Task ID: 5) to be Customer (Customer ID: 2) and 10/12/2019 respectively. ''' ==== Deletes a delivery task / driver / customer: del

Deletes a task / driver / customer from its respective managers.
Format: del [c/CUSTOMER ID] | del [t/DRIVER ID] | del [t/TASK ID]

  • Cannot delete a DELIVERY TASK that is on-going. Remove the driver from the task first before deleting.

  • Cannot delete a DRIVER that is assigned to a on-going task. Remove the driver from the task first before deleting.

Examples:

  • del t/1
    Deletes task (Task ID: 1) from the task manager.

  • del d/2
    Deletes driver (Driver ID: 2) from the driver manager. ==== Views completed delivery tasks delivered to Customer

Displays a list of completed tasks delivered to the customer, located in the completed delivery list under History tab.

Examples:

  • viewC 1
    View the tasks delivered to the customer (Customer ID: 1).

Views completed delivery tasks delivered by Driver

Displays a list of completed tasks delivered by the driver, located in the completed delivery list under History tab.

Examples:

  • viewD 1
    View the tasks delivered by the driver (Driver ID: 1).

Saves assigned delivery tasks for a specific date into PDF document: savepdf

The PDF document is arranged in a table format to allow easy reference of the delivery tasks that is assigned to each drivers for the date. Its purpose is for user reference and archive.
Refer to [PdfLayout] for sample.
Format: savepdf [DATE]

  • DATE format is dd/mm/yyy.

  • DATE field is OPTIONAL. If date field is not declared, it will take the date of today.

  • PDF document will be saved in a folder in the same directory as where you put the deliveria.jar.

    • PDF Task Summary will be saved in DeliveryTasks folder as DeliveryTasks [DATE].pdf.

    • PDF Delivery Order will be saved in "DeliveryOrders" folder as DeliveryOrders [DATE].pdf.

  • Use the update command to update the company’s information displayed in the Delivery Order PDF.

Examples:

  • savepdf pdf/order
    Saves the delivery orders in PDF format for today.

  • savepdf pdf/summary dt/15/11/2019
    Saves the task summary in PDF format for 15/11/2019.

Customer Management Commands

Add a Customer addC

Adds customer to the customer manager.
Format: addC [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAGS]

  • All fields are compulsory.

Examples:

  • addC n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 t/friends

View full Customer details viewCW

Opens a separate window with all Customer details and a map showing location of Customer Address.
Format: viewCW CUSTOMERID

Working internet connection and valid address is needed for map to work.
  • All fields are compulsory.

Examples:

  • viewCW 1 === Driver Management Commands

Add a Driver addD

Adds driver to the driver manager.
Format: addD [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAGS]

  • All fields are compulsory.

Examples:

  • addD n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 t/friends ==== View full Driver details viewDW Opens a separate window with all Driver details
    Format: viewDW DRIVERID

  • All fields are compulsory.

Examples:

  • viewDW 1

Company Commands

Updates the company’s information: update

Updates the information of the company so that it can be displayed in the Delivery Order PDF. Refer to savepdf command on how to generate Delivery Order PDF.
Format: update [n/NAME] [a/ADDRESS] [p/PHONE] [f/FAX] [e/EMAIL] [r/CO REG. NO.] [gst/GST REG. NO]

  • Only GST Registration Number is a optional field and can be removed by typing update gst/-

Examples

  • update n/Fast Supply Pte Ltd p/67331928
    Updates the company’s name to "Fast Supply Pte Ltd" and phone no to "67331928".

  • update r/18387752B gst/-
    Updates the company’s registration number to "18387752B" and remove GST registration number.

Saving the data

Deliveria data are saved in the hard disk automatically after any command that changes the data.
There is no need to save manually.

FAQ

Q: How do I transfer my data to another Computer?
A: Install the app in the other computer and overwrite the empty data file it creates with the data file in your previous computer.

Q: Where is the saved file at?
A: It is located in the same folder where the .jar file is. There will be a folder called data.

Q: How do I know the list of commands?
A: The help command will give a list of available commands.

Appendix

DeliveryTasks Pdf Layout
Figure 2. PDF Task Summary generated by savepdf command.
Delivery Order Pdf
Figure 3. PDF Delivery Order generated by savepdf command.

Appendix

DeliveryTasks Pdf Layout
Figure 4. PDF Task Summary generated by savepdf command.
Delivery Order Pdf
Figure 5. PDF Delivery Order generated by savepdf command.

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.

Storage component

StorageClassDiagram
Figure 6. Structure of the Storage Component
CentralManager
Figure 7. Structure of the CentralManager

API : Storage.java

The Storage component,

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

  • uses CentralManager to consolidate all the data that needs to be saved. (e.g. Task Manager’s data)

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


Task Feature (E.g. Add Delivery Task)

Implementation

The Add Delivery Task feature adds a new task into a task list.
It uses the AddTaskCommand, which extends Command, to add a Task into the TaskManager. AddTaskCommandParser is also utilised to parse and validate the user inputs before sending it to AddTaskCommand to execute. 'AddTaskCommand' requires the following fields: Task, customerId. The attributes of Task is as follows:

Task
Figure 8. Class Diagram of Task class.

As seen in the above class diagram, driver and eventTime are optional fields that are not mandatory when adding a task. They will be assigned subsequently using assign command. (Refer to Assign feature) The mandatory fields for users are: 'description', 'date' and 'Customer'. After the validation is completed, AddTaskCommand will fetch Customer using the customerId through the CustomerManager. A unique id will also be allocated to the task for differentiation.

The following sequence diagrams show how the add task operation works:

AddTaskCommand
Figure 9. Sequence Diagram of adding a task.
ModelInteractWithManagers
Figure 10. Sequence Diagram of Model interaction with the CustomerManager and TaskManager for adding a task.
The flow of how the task is being accessed and managed as shown above is the same for other task related command such as edit task command (editT) and delete task command (del).

Design Considerations

Aspect: Coupling of Task and other entities (Driver and Customer)
  • Alternative 1 (current choice): Task class contains Driver and Customer classes as attributes.

    • Pros: Centralised Task class that encapsulates all the information, which makes it easy to manage task.

    • Cons: Task will have to depend on Driver and Customer. Decreases testability.

  • Alternative 2: Driver and Customer classes have Task class as attribute.

    • Pros: Easy to access tasks through the respective classes. (Driver and Customer classes)

    • Cons: Having 2 classes depend on Task class. Decreases testability.


Generate Task Summary and Delivery Orders in PDF Feature

Implementation

Generation of PDF documents is handled by PdfManager. It is responsible in taking the essential inputs required to generate the document. The following inputs are required to generate a PDF document such as a PDF Delivery Order:

  • filePath - the directory where the pdf document is to be saved.

  • data - the data that is to be displayed in the PDF document.

The PdfManager utilizes PdfCreator to create and save the PDF document as well as formatting the layouts. It is implemented with the help of an external library, iText7.

Regarding iText’s license, it can be used for free in situations where you distribute your software for free. It is a Affero General Public License (AGPL) library.
Information updated as of 6 November 2019. For more information, please visit the iText official website.

To show how the PDF document is generated, generating PDF Task Summary will be used as an example for this showcase. The following sequence diagram shows how the user command savepdf is being executed and handled.

SavePdfCommand
Figure 11. Sequence Diagram of how PDF task summary is saved.
The lifeline for SavePdfCommandParser should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.

Notice that only the filepath and the date of delivery is needed when calling generateTaskSummaryPdf. This is because only the saving location of the PDF file and the date, where the task summary will be based on, are the only fields needed for the PdfManager. The rest of the components, such as fetching of the tasks, will be handled in the Model while the formatting will be handled by PdfCreator.

The following sequence diagram shows how the model interact with PdfManager to generate the PDF task summary.

GeneratePdfSequenceDiagram
Figure 12. Sequence Diagram of how the model interact with PdfManager to generates the PDF task summary.

The PdfWrapperLayout provides a outer canvas to encapsulates all the layouts. The following layouts are mainly what makes up the task summary:

  • PdfDriverLayout class - wraps driver details.

  • PdfCustomerLayout class - wraps customer details.

  • PdfTaskLayout class - wraps task details.

The following activity diagram shows what happens when a user executes the savepdf command:

GeneratePdfActivityDiagram
Figure 13. Activity Diagram of how a PDF task summary is generated.

Design Considerations

Aspect:
  • Alternative 1 (current choice): Abstract the layout of each part of the PDF document (Eg. Class that handles task layout is separated from class that handles customer layout.)

    • Pros: Encourages reuse and easier to manage and add on.

    • Cons: Harder to implement.

  • Alternative 2: Do the whole PDF document layout in 1 class.

    • Pros: Easy to implement.

    • Cons: Harder to manage.