Overview
Delino is a desktop delivery 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
Given below are the summary of the contributions I have made for this project. |
-
Major enhancement:
-
Added
import
command (Pull request #215)-
What it does: Allows the user to add multiple orders and return orders via a CSV file.
-
Justification: This is an essential update, which allows the user to save time from adding multiple orders and return order one by one.
-
Highlights: This enhancement depends heavily on
InsertCommandParser
andReturnCommandParser
to process the data retrieve from the data. Considerations have to be made to differentiate the data forOrder
andReturnOrder
, as they have different attributes in their models.
-
-
Add return order book for storage (Pull request #186)
-
What it does: Stores return orders in json file.
-
Justification: The storage of return orders is important, as the return orders are required to be separate from orders and store as a separate json file in the hard disk from the orders.
-
Highlights: Considerations are to be made for how to store and retrieve the return order data from the json file which is stored in hard disk.
-
-
Modify the
clear
command (Pull requests #180, #218)-
What it does: Gives the user to clear either both order lists or only one of them.
-
Justification: This is an essential update, which prevent the user from having the trouble clearing the orders or return orders one by one.
-
Highlights: Considerations are to be made for the clearing either one of the list or both order list and return order list, as clearing the wrong list, the data in that list would be lost permanently.
-
-
-
Minor enhancement:
-
Add
timestamp
field into the model(Pull requests #175, #198)-
What it does: Allows orders and return orders to keep track of the delivery date and time.
-
Justification: This is an essential update, which allows user to input timestamp for the order and return order.
-
-
Add
comment
field into the model(Pull request #172)-
What it does: Allows orders and return orders to store customer comment.
-
Justification: This is an essential update, which allows the courier to be able to take note about the customer’s request for that delivery.
-
-
-
Code contributed: [Functional code & Test code]
-
Other contributions:
-
Project management:
-
Co-team lead of the project, in charge of defining, assigning, and tracking project tasks. Furthermore, ensure project deliverables are done on time and in the right format.
-
-
Documentation:
-
Updated the product website’s heading and navigation bar. (Pull request #119)
-
Edited various parts of the User Guide (Pull requests #173, #226)
-
Added use cases and updated the Storage and Implementation part of the Developer Guide for saving, import and clear features (Pull requests #186, #197, #218)
-
-
Community:
-
Tools:
-
Integrated a new Github plugin (AppVeyor) to the team repo (#37b0cd1)
-
-
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. |
Clearing all entries : clear
[Done by - Eng Xuan En]
In this section, you will be able to find out how to use the clear
command and
the possible combinations of the clear
command.
If you wish to delete huge amount of orders and return orders from Delino, the clear
command will provide you the means
to do so.
How to use the Clear command
Here is how you can clear the order list and return order list by following the steps below:
Step 1 : Type in the keyword clear
.
Step 2 (Optional) : Provides the -f
flag if you confirm that you would like to force clear both order list and return order list.
Step 3 (Optional) : Provides the -o
or -r
flag if you only want to clear either order list or return order list respectively.
Step 4 : Press Enter
on your keyboard to send the instruction to Delino.
|
What constitutes a valid Clear command
In this section, you will learn about the syntax for a valid clear
command and the possible combinations of the command.
The syntax for a valid clear
command can be seen below:
-
clear
[FLAG]
|
These are the possible combinations of the clear
command:
Scenario | Command | Result |
---|---|---|
If you want to have a confirmation notice before clearing both lists. |
|
Pop-up will appear and ask the user for confirmation to clear both order list and return order list. |
If you don’t want to get prompt before clearing both lists. |
|
Both order list and return order list will be cleared immediately. |
If you want to have a confirmation notice before clearing return order list. |
|
Pop-up will appear and ask the user for confirmation to clear the return order list. |
If you don’t want to get prompt before clearing return order list. |
|
Only return order list is cleared immediately. |
If you want to have a confirmation notice before clearing order list. |
|
Pop-up will appear and ask the user for confirmation to clear the order list. |
If you don’t want to get prompt before clearing order list. |
|
Only order list is cleared immediately. |
Importing a list of orders : import
[Done by - Eng Xuan En]
In this section, you will be able to find out how to use the import
command and
the possible combination of the import
command.
If you wish to add huge amount of orders and return orders to Delino, the import
command will provide you the means
to do so.
How to use Import command
Here is how you can import the orders and return orders into Delino by following the steps below:
Step 1 : Type in the keyword import
.
Step 2 : Provide the CSV file name that you would like to import with the .csv extension behind.
Step 3 : Press Enter
on your keyboard to send the instruction to Delino.
What constitutes a valid Import command
In this section, you will learn about the syntax of a valid import
command, the format for both orders and return orders in the CSV file
and the possible combination for the import
command.
The syntax for a valid import
command can be seen below:
-
import
FILE_NAME
import
is the command andFILE_NAME
is the file name that is required to import with the .csv extension behind.
|
Figure 1. CSV File Save Type
|
The data in the CSV file
should be written in the following format:
-
Order data format:
ot/ORDER_TYPE
,tid/TRANSACTION_ID
,n/NAME
,a/ADDRESS
,p/PHONE_NUMBER
,e/EMAIL
,dts/DELIVERY_DATE_&_TIME
,w/WAREHOUSE_LOCATION
,cod/CASH_ON_DELIVERY
,[c/COMMENTS_BY_CUSTOMER]
,[type/TYPE_OF_ITEM]
Example:
-
Return order data format:
ot/ORDER_TYPE
,tid/TRANSACTION_ID
,n/NAME
,a/ADDRESS
,p/PHONE_NUMBER
,e/EMAIL
,rts/RETURN_DATE_&_TIME
,w/WAREHOUSE_LOCATION
,[c/COMMENTS_BY_CUSTOMER]
,[type/TYPE_OF_ITEM]
Example:
|
There is only one possible combination for the import
Command:
Scenario | Command | Result |
---|---|---|
If you want to import all of the orders and return orders at once via a CSV file. |
|
Import the contents of the CSV file, |
Command Summary
In this section, you can find out more about the commands supported by Delino (their respective format and example).
If you would like to know more about a specific command, you can view more information by clicking the provided link in the table below.
Command | Format | Example |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Command Prefix
Prefix | Order Attributes | Used in the following Command(s) |
---|---|---|
ot/ |
Order Type |
|
tid/ |
Transaction ID |
|
n/ |
Customer Name |
|
a/ |
Address |
|
p/ |
Phone Number |
|
e/ |
||
dts/ |
Delivery Date And Time |
|
rts/ |
Return Date and Time |
|
w/ |
Warehouse Location |
|
cod/ |
Cash On Delivery |
|
c/ |
Comments by Customer |
|
type/ |
Type of Item |
Command Flags
Flag | Meaning | Used in the following Command(s) |
---|---|---|
-f |
Force clear, no user confirmation will be requested |
|
-o |
Order flag, Operation on order list |
|
-r |
Return Order flag, Operation on return order list |
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
API : Storage.java
The Storage component,
-
can save UserPref objects in json format and read it back.
-
can save both OrderBook and ReturnOrderBook data in json format and read it back.
Clear feature
In this section, the functionality of the clear
feature,
the expected execution path,
the structure of the ClearCommand class and the interactions
between objects with the ClearCommand object will be discussed.
What is the Clear feature
The clear
feature was implemented as a ClearCommand in the logic package.
The clear
feature allows the user to remove the orders and return orders by input one command line.
Execution paths of Clear Command
The execution path of the clear
command is shown below:
After user enter the clear
command, the ClearCommandParser will run the following two checks:
-
Check if flag in the arguments do not belong to one of the three valid flags:
-f
,-r
and-o
-
Check if both
-r
and-o
flags found in the arguments
If either one of the conditions occurs, exception will be thrown and the error message will be display to the user. Afterward, the new ClearCommand object will be executed.
During the execution of the clear
command:
-
If
-f
flag is found in flags, the respective orders will be cleared and display a success message to the user. -
If there are no
-f
flag found in flags, a pop up will appeared with the confirmation message. User would be required to press either one of the following two buttons:-
Yes
button - The respective orders will be cleared and display successful clear message to the user. -
No
button - Pop up closed and end of activity.
-
Structure of Clear Command
The following diagrams shows the overview of the clear
command Class Diagram:
In the ClearCommand class, there are also some static messages for the different input command the user has key in:
-
MESSAGE_USAGE
clear: Clear either both order list and return order list or one of them.
Parameters: -o/-r/-f
Example: clear -o -f -
MESSAGE_SUCCESS_ORDER_LIST
Inform the user that order list has been cleared successfully. -
MESSAGE_SUCCESS_RETURN_LIST
Inform the user that return order list has been cleared successfully. -
MESSAGE_SUCCESS_BOTH_LIST
Inform the user that both order lists have been cleared successfully. -
MESSAGE_ENQUIRY_ORDER_LIST
Confirmation message to the user if the user want to clear order list. -
MESSAGE_ENQUIRY_RETURN_LIST
Confirmation message to the user if the user want to clear return order list. -
MESSAGE_ENQUIRY_BOTH_LIST
Confirmation message to the user if the user want to clear both order lists.
Interactions between objects when Clear Command is executed
In this section, the interactions between objects when clear
command is executed will be display in the Clear Command
Sequence Diagram below:
The above sequence diagram illustrate how the clear
Command is being processed when the user inputs
clear -f
to force clear all of the orders and return orders without any prompt.
After the user input. the arguments passed to the clear
command will be parsed by the ClearCommandParser class
If the given arguments are valid, a new ClearCommand object will be returned.
In ClearCommandParser, there will be two validation checks:
1. Ensure the flag is one of the three flags: -f
, -o
and -r
2. Ensure the arguments do not have both -o
and -r
flags.
After the two validation checks, the flag will be added into HashSet, flags which will then passed to
the new ClearCommand object created by ClearCommandParser and it is being returned to the LogicManager.
The LogicManager will start to run the execute the clear
command, which will be
shown in details in below diagram:
After LogicManager call the ClearCommand#execute(model), the clear
command will update the model by pass a new
OrderBook object and a new ReturnOrderBook object to Model. The Model will then update its own orderBook and
returnOrderBook. In addition, the clear
command will pass back a new CommandResult object with the success message
in it to the LogicManager at the end of the execution.
Import feature
In this section, the functionality of the import
feature, the expected execution path, the structure of the
ImportCommand class and the interactions between objects with the ImportCommand object will be discussed.
What is the Import feature
The import
feature was implemented as the ImportCommand in the logic package.
The import
feature allows users to save the trouble of adding the delivery orders and the return orders one by one
when they have large amount of delivery orders or return orders to add into Delino.
Execution paths of Import Command
The execution path of the ImportCommand is shown below:
After the user enter the import
command, there are three validation check for the file based on the input argument, FILE_NAME
:
-
Check if the input argument has the .csv file extension at the back:
-
If
Yes
, continue with the next validation check. -
If
No
, display error message to the user.
-
-
Check if the filePath is valid:
-
If
Yes
, continue with the next validation check. -
If
No
, display error message to the user.
-
-
Check if the file able to read:
-
If
Yes
, retrieve the data from the CSV file and process the data. -
If
No
, display the error message to the user.
-
Afterward, a new ImportCommand will be created and executed. For every data inside the list, either order or return order
will be added into the order book and return order book respectively based on the orderType
value.
If the orderType
is invalid, add the data into the result, which will be displayed to the user after processing.
Structure of Import Command
The following diagram shows the overview structure of the ImportCommand Class Diagram:
In the ImportCommand Class, there are also a few static message to display to the user for the various scenarios occurred
during the importing of data from the CSV file:
-
MESSAGE_USAGE
import: Import the data in .csv file into Delino
Parameters: fileName.csv
Example: import orders.csv -
INVALID_MESSAGE
Invalid order type encountered. -
DUPLICATE_ORDER_MESSAGE
Duplicate order encountered. -
DUPLICATE_RETURN_MESSAGE
Duplicate return order encountered. -
MESSAGE_INVALID_CSV_FILEPATH
The csv file is not found in the data folder. -
PROCESS_FAILED_MESSAGE
Failed to process the data.
This could be due to invalid order type encountered or invalid data input for the attributes in order and return order.
Interactions between objects when Import Command is executed
In this section, the interactions between the objects when ImportCommand is executed will be shown in the Import Command
Sequence Diagram below:
The arguments passed to the import
command will be parsed by the ImportCommandParser class.
Then, the ImportCommandParser will called the ParseUtil#parseCsvFile() to get the filePath based
on the input the user provides. Afterward, CsvProcessor will be called to retrieve the data from the csv file
and return the processed fileData
back to ParseUtil. The fileData
will be further pass to ImportCommandParser
and to the constructor of ImportCommand.
CsvProcessor is a helper class that helps to retrieve the data from the csv file and process the data before giving to ImportCommand. |
Afterward, the ImportCommand object is being returned to the LogicManager and the LogicManager will start to run the execute the ImportCommand, which will be shown at the diagram below.
The ImportCommand#execute() will first check if the data given starts with
order or return and pass to the InsertCommandParser or ReturnCommandParser respectively.
Afterwards, InsertCommandParser or ReturnCommandParser will return a new InsertCommand or ReturnCommand respectively if it successfully parse the data. The ImportCommand will then call the InsertCommand#execute() or ReturnCommand#execute() depend whether it is delivery order or return order. This will cause a delivery order or return order being added into the Model.
The ImportCommand will call its own printResult() function and return a String message to the CommandResult object which is then pass back to the LogicManager.
Use Cases
Use case: UC02 - Clear all orders
MSS
-
User wants to clear all orders.
-
User requests to clear all orders.
-
Delino clear all existing orders.
-
Delino displays order cleared message.
Use case ends.
Extensions
-
2a. Delino detects invalid syntax from user input.
-
2a1. Delino shows an error message.
Use case ends.
-
-
2b. Delino detects no flag
-f
.-
2b1. Delino trigger pop-up message.
-
2b2a. User select
yes
button.-
2b2a1. Return to step 2.
-
-
2b2b. User select
no
button.-
2b2b1. Use case ends.
-
-
-
-
2c. Delino detects no orders.
-
2c1. Delino shows no order to be cleared message.
Use case ends.
-
Use case: UC09 - Importing order details
MSS
-
User wants to import a specific orders from an external csv file.
-
User requests to import orders from an external csv file.
-
Delino checks for file existence.
-
Delino imports all orders from the external csv file.
-
Delino displays all orders imported.
Use case ends.
Extensions
-
2a. Delino detects invalid syntax from user input.
-
2a1. Delino shows an error message.
Use case ends.
-
-
3a. Delino detects invalid file path.
-
3a1. Delino shows the invalid file path error message
Use case ends.
-
-
4a. Delino is unable to open the file.
-
4a1. Delino shows permission denied error message.
Use case ends.
-
Glossary
Prefix | Meaning | Used in the following Command(s) |
---|---|---|
ot/ |
Order Type |
|
tid/ |
Transaction ID |
|
n/ |
Customer Name |
|
a/ |
Address |
|
p/ |
Phone Number |
|
e/ |
||
dts/ |
Delivery Date And Time |
|
rts/ |
Return Date and Time |
|
w/ |
Warehouse Location |
|
cod/ |
Cash On Delivery |
|
c/ |
Comments by Customer |
|
type/ |
Type of Item |
Flag | Meaning | Used in the following Command(s) |
---|---|---|
-f |
Force clear, no user confirmation will be requested |
|
-o |
Order flag, Operation on order list |
|
-r |
Return Order flag, Operation on return order list |
Clear orders
-
Clear all orders while all orders are listed
-
Clear command format:
clear
[FLAG]
-
Test case:
clear
Expected: Confirmation message will display in status message.-
If Yes button is pressed, the both order and return order lists will be cleared. Notify the user that both order lists have been cleared in the status message.
-
If No button is pressed, no order list is cleared.
-
-
Test case:
clear
-f
Expected: Both order list and return order list will be cleared. Notify the user that both order lists have been cleared in the status message. -
Test case:
clear
-f
-r
Expected: Only return order list will be cleared. Notify the user that return order list has been cleared in the status message. -
Test case:
clear
-r
-r
-f
Expected: Only return order list will be cleared. Notify the user that return order list has been cleared in the status message. -
Test case:
clear
-r
-o
Expected: Invalid command input, as both-r
and-o
cannot be in a single command.
Error details shown in the response message. A help message displayed for the user to type the correct command. Status bar remains unchanged -
Test case:
clear
-r-f
Expected: Invalid command input, as space is required in between flags.
Error details shown in the response message. A help message displayed for the user to type the correct command. Status bar remains unchanged
-
Import orders
-
Import a new list of orders from a .csv file given by the company
-
Import command format:
import
NAME_OF_FILE.csv
-
Prerequisites : The import file must be a
.csv file
and thecsv file
should be insidedata
folder which is the same directory as the JAR file. Otherwise, it will cause the app to raise an exception and print the error message. Should not import a file that is non-existent -
Test case:
import
customers_20_02_2020.csv
Expected: In the response box, a message will appear to indicate that the import is successful. At the same time, the contents of the .csv file will be shown to the user in the form of a list of orders
-