[M3] Inline Field Errors & Pre-Flight Validation Checks #5

Closed
opened 2026-09-04 15:00:19 +02:00 by JackPrince · 0 comments
Owner

Part of Epic #2

Description

Improve error transparency so drivers understand why a trip cannot be saved, replacing generic toasts with inline field errors and pre-flight checklist validation.

Tasks

  • Propagate backend HTTP 422 payload.errors through ApiClient (api.ts) down to the form.
  • Render field-specific error messages beneath offending input fields in TripFormCard.tsx.
  • Implement a pre-flight checklist above the submit buttons:
    • Start odometer matches previous trip's end odometer
    • End time is strictly after start time
    • End odometer is greater than start odometer
    • No temporal overlap with existing trips
    • Mandatory confirmation fields completed (for final submit)
  • Add positive visual cues (green checkmarks, trip distance badge).

Acceptance Criteria

  • Drivers receive instant, localized error indicators on exact fields instead of a generic "The given data was invalid" toast.
Part of Epic #2 ## Description Improve error transparency so drivers understand why a trip cannot be saved, replacing generic toasts with inline field errors and pre-flight checklist validation. ## Tasks - [ ] Propagate backend HTTP 422 `payload.errors` through `ApiClient` (`api.ts`) down to the form. - [ ] Render field-specific error messages beneath offending input fields in `TripFormCard.tsx`. - [ ] Implement a pre-flight checklist above the submit buttons: - [x] Start odometer matches previous trip's end odometer - [x] End time is strictly after start time - [x] End odometer is greater than start odometer - [x] No temporal overlap with existing trips - [x] Mandatory confirmation fields completed (for final submit) - [ ] Add positive visual cues (green checkmarks, trip distance badge). ## Acceptance Criteria - Drivers receive instant, localized error indicators on exact fields instead of a generic *"The given data was invalid"* toast.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
JackPrince/GoBDLogBook#5
No description provided.