The project is structured as follows:
src/main/java/org/nixes/
contains the source codesrc/test/java/
contains the tests
- expected-trips-full.csv - The hand executed expected results when following all rules and assumptions
- taps.csv - The input file provided in the task description
- trips.csv - The output file generated by this program
Depends on:
- a java 21 JDK.
- Apache Maven
mvn clean install
Run 'TripProcessCommand' with an input taps.csv in the working directory.
java -cp target\lp-trip-calc-1.0-SNAPSHOT.jar org.nixes.TripProcessCommand
mvn test
- The input file is in the correct format
- The input file is in the working directory
- The input file is named taps.csv
- The case of fields in the input file is consistent with the example provided in the task description
- The fare rule is as per the example provided in the task description
- Fare rules do not change during the course of processing a file.
- Cancelled/incomplete trips use the same from and to StopId
- Cancelled/incomplete trips use the first DateTimeUTC as both the Started and Finished values
- Assumed the names of the various trip statuses are "COMPLETED", "INCOMPLETE", "CANCELLED". Only COMPLETED was provided.
- The DurationSecs in the example output seems incorrect. The difference in mins between the Started and Finished times is 5 mins which is 300 seconds. The originally provided output says 900 seconds.
- The started and finished times in the example output do not match the relevant tap ids in the input taps.csv file
- There are some cases of tap offs without tap ons in the example data. I have assumed that these should be considered as incomplete trips. But this would need to be confirmed with the business.
- What is the cause of these isolated tapOffs, is there a data quality/consistency issue?