MEDIUM story-mileage-reimbursement-entry-peer-mentor-006 3 pts
3
Story Points
Medium
Priority
Mileage Reimbursement Entry
Feature

User Story

As a Peer Mentor (Likeperson)
I want the app to suggest a pre-filled distance when I enter a known from/to route that I have used before
So that I can submit recurring mileage claims faster without retyping the same route and distance every time

Audience Summaries

For peer mentors making dozens of recurring visits — the HLF example from workshops cites up to 380 registrations annually — manually re-entering the same route distances every submission cycle is a compounding usability tax that directly drives abandonment risk. Distance pre-fill transforms repeat route entry from a multi-field manual task into a single confirmation gesture, aligning the product with the core workshop design principle of completing common actions in under two interactions. Reducing entry friction at this scale improves submission completion rates, lowers erroneous distance entries from fatigue, and strengthens mentor retention by making the reimbursement experience feel intelligent and respectful of their time.

This story depends on the base mileage claim submission story and the existence of a local distance cache data structure, so sequencing matters. The key delivery risk is cache consistency: if a mentor edits a pre-filled value and the update logic is incorrect, future suggestions will be corrupted. Acceptance criteria cover five distinct scenarios — cached match, cache miss, editable pre-fill, offline cache lookup, and cache update on edited submission — each of which requires a dedicated test case. UAT should include mentors with real repeat-route histories to validate suggestion accuracy.

The offline scenario requires coordination with the PWA or local storage strategy already established for the app, so confirm that dependency is resolved before this story is accepted into sprint.

Implementation requires a local distance cache (key: normalized from+to address pair, value: last-used distance) backed by IndexedDB or localStorage for offline availability. On route field input, a debounced lookup should query the cache using a normalized key (trim, lowercase, consistent address format) and populate the distance field with the cached value plus a visual 'suggested' indicator. If no match exists, the field remains empty — no fallback to zero or placeholder values. On successful claim submission, if the user edited the pre-filled distance, the cache entry for that route key must be updated to the new value.

Edge cases: address pairs with minor formatting differences (trailing spaces, abbreviations) must normalize to the same key to avoid cache fragmentation. The prefill indicator must be visually distinct but non-blocking to edits.

Acceptance Criteria

  • Given I have previously submitted a claim for a route from address A to address B, When I next enter the same from/to combination in the route input fields, Then the distance field is pre-populated with the previously used distance
  • Given the distance field is pre-populated from cache, When I review the value, Then it is clearly indicated as a suggestion (e.g., prefilled label) and I can edit it freely
  • Given no cached route exists for my input, When the prefill service finds no match, Then the distance field remains empty and no incorrect suggestion is displayed
  • Given I am offline, When I enter a route combination, Then the local distance cache is consulted and a cached value is offered if available, without requiring a network call
  • Given I edit a pre-filled distance and submit the claim, When the claim is saved, Then the new distance value is stored in the cache to update the suggestion for future identical routes

Business Value

Repeat route pre-fill directly supports the core design principle established across all workshop sessions: minimize cognitive load and reduce the number of steps for common actions. A peer mentor with 380 registrations per year (HLF example from workshops) saves significant cumulative time and effort when frequently-travelled routes are remembered by the app, reducing the risk of abandonment mid-entry.