BMMRO-tech / BMMRO

MIT License
3 stars 5 forks source link

Ending a Trip #505

Open Rodrjen opened 4 months ago

Rodrjen commented 4 months ago

Context As a user I want to be able to end a Trip from the Trip Summary page so that I can record the end time of the trip.

In-scope

Scenarios

Scenario 1: End trip button GIVEN I am on the Trip Summary page for a specific trip, WHEN I click on the "End Trip" button, THEN a confirmation window appears for the user to either end the trip or cancel this action

Scenario 2: Canceling ending a trip GIVEN I am prompted with the confirmation window to end a trip WHEN I click on the "Stay on this page" button THEN I am redirected to the Trip Summary page

Scenario 3: Saving the end time on the Firebase database GIVEN I am prompted with the confirmation window to end a trip WHEN I click on the "Save & Continue" button THEN a new logbook entry is created automatically AND the current time is saved to the this entry

Scenario 4: Trip miles GIVEN I am prompted with the confirmation window to end a trip WHEN the pop-up window opens THEN I can type a positive number with maximum to decimals as the trip miles value AND clicking on the "Save & Continue" button saves the value to the last logbook entry AND I am redirected to the "Trip Summary" page AND the "End Trip" button is not present in the "Trip Summary" page

Scenario 5: Ending a trip on a different day as the start date GIVEN I want to end a trip on a different day as the start date WHEN I click the "Save & Continue" button on the confirmation window to end a trip THEN I am prompted with a pop-up window with a field to manually add the time when the trip is ended AND this value is saved to the last logbook entry

Acceptance Criteria

  1. Clicking the "End Trip" button triggers the creation of the last logbook entry in the Firebase DB
  2. Clicking the "End trip" button triggers a confirmation window to cancel or confirm the ending of a trip
  3. The confirmation window has an input field to manually introduce the trip miles
  4. The trip miles field is optional
  5. The trip miles field accepts only positive numbers up to 2 decimals
  6. The trip miles value is saved in the last logbook entry in the Firebase DB
  7. The time of the last logbook entry is the current time when the user clicks on the "Save & Continue" button on the confirmation window
  8. If the date of ending a trip differs from the start date, then the user sees a field to input the end time manually on the confirmation window
  9. If the user enters the end time manually on the confirmation window, this value is saved to the last logbook entry on the Firebase database
  10. Upon ending a trip, the status is updated in the Firebase DB as to indicate that the trip has ended
  11. The last logbook entry contains the entries: "time" and “trip miles"
  12. The last logbook entry is added to the comments in the CSV file when exporting the trip
  13. Once the trip status is ended, the "End trip" button is no longer visible in the Trip Summary page of that specific trip