This is the fourth part of the series. The links for the remaining posts are introduction, application execution, screens, basic testing, detailed testing.
Overview
Initial order data is uploaded to the database during application startup. The data is mentioned in a json format. The jar contains two json files – order.json for the default profile and orders-test.json for the test profile. In the json file, one can define orders in various states, default dishes for orders and orders for search.
JSON to Java Mapping
The json file is mapped by the OrderData.JsonOrderData class. The table.count property in the application properties should be equal or greater than the largest table number in the json file. Below table describes the various options available.
Parameter Name | Description | Value Type / Java Object |
singleDefaultDish | Used for an order with a default single dish. | InputDishData |
multipleDefaultDishes | Used for an order with default multiple dishes. | InputDishData Array |
[ordered\preparing\ready\served]StatusSingleDishTables | Table numbers of default single dish orders in ORDERED, PREPARING, READY, SERVED status. | Integer Array |
[ordered\preparing\ready\served]StatusMutipleDishTables | Table numbers of default multiple dishes orders in ORDERED, PREPARING, READY, SERVED status. | Integer Array |
[billed\cancelled]StatusSingleDishCount | Count of single dish orders in BILLED, CANCELLED status. | Integer |
[billed\cancelled]StatusMultipleDishesCount | Count of multiple dishes orders in BILLED, CANCELLED status. | Integer |
individualTables | Orders with custom dishes in different status. | InputOrderData Array |
searchOrders | Search orders with default single dish orders with varying past modification times. | InputSearchOrderData Array |
An external custom json data file can be created based on requirements. This can be done by creating a new profile with the table.count and data.path properties with the json file location. Else these properties can be given as command arguments to an existing profile. Both of these methods are described here.