Skip to content

fix: base pickup distance and ETA on same source and offer endpoint test (#4) - #50

Open
Amey-Bhavsar wants to merge 1 commit into
wncc:mainfrom
Amey-Bhavsar:fix-pickup-distance-source
Open

Amey-Bhavsar wants to merge 1 commit into
wncc:mainfrom
Amey-Bhavsar:fix-pickup-distance-source

Conversation

@Amey-Bhavsar

Copy link
Copy Markdown
Contributor

Follow-up for #4 addressing review feedback:

1. **Unified Distance and ETA Source**:
   - Added `pickup_estimate` to `EtaProvider`, `RouterEta`, and     
   `StraightLineEta` in `matching/eta.py`.
   - Updated `RouteService.pickup_estimate` in
   `backend/app/services/routes.py` so that distance and ETA both   
   come from the road route when roads are loaded (`RouterEta`), and
   from straight-line when not (`StraightLineEta`).
2. **Offer Endpoint Assertions and Dedicated Test**:
   - Restored the `/drivers/me/offer` assertion in
   `test_full_ride_lifecycle`.
   - Added dedicated `test_driver_offer_endpoint` in
   `backend/tests/test_api.py`.
3. **Unit Tests**:
   - Added `test_pickup_estimate_uses_road_distance` in
   `tests/test_matching.py` ensuring road distance (~7.1 km across
   bridge) is returned instead of straight-line distance (~780 m).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant