feat: Transportation refactor — subtype-conditional form, Google Places, Amadeus alignment#51
Conversation
Add structured location data (pickup/dropoff name, lat, lng, placeId), enhanced car rental fields (company, booking ref, car class, fuel policy), and station/terminal fields for train/ferry/bus. Supports Google Places integration and Amadeus Transfer API compatibility. fixes #23, fixes #26 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Returns hotels, airports, ports, and day locations from trip activities for use as autocomplete suggestions in the transportation form. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds structured location, car rental, and station fields to validation, defaults, field list, and API payload mapper. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… snapshot builder Explicitly maps pickup/dropoff location, car rental, and station fields in create/update/format field maps and proposal snapshot builder. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Combines Google Places Autocomplete with trip location suggestions. Trip locations (hotels, airports, ports) appear above search results. Uses Google Places API v1 with NEXT_PUBLIC_GOOGLE_MAPS_API_KEY. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ndering - Add section visibility map for all 9 subtypes - Replace pickup/dropoff address Input with TransportationAddressInput - Add Station/Terminal card for train/ferry/bus - Enhance car rental section with company, booking ref, class, fuel policy - Add stale field clearing on subtype change - Wrap Vehicle, Driver, Features, Flight sections with showSection() checks - Wire useTripLocations for address autocomplete suggestions - Add 14 new fields to AUTO_SAVE_FIELDS fixes #23, fixes #26 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds 14 new transportation fields to the snapshot DTO type used by buildProposalItinerary() to fix TypeScript compilation error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. TransportationAddressInput: propagate manual text on blur and clear form state when input is emptied (Codex issue #1) 2. detail-mapper: add coerce.toNumber for parsing numeric DB strings 3. transportation-details.service: use toNullableStrict for lat/lng on create (preserves 0), toNumber on format (string→number) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove separate Station/Terminal card — for train/ferry/bus subtypes, pickup/dropoff labels change to Departure/Arrival Station with appropriate icons and placeholders. Less redundancy, cleaner UX. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Form now shows only the type selector and a hint prompt until the user picks a transportation type. Sections then appear based on the subtype visibility matrix — cleaner, more adaptive UX. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a transfer is selected from Amadeus results and its currency differs from the trip currency (e.g., EUR vs CAD), automatically convert using the existing exchange-rates API. Shows the conversion in notes: "Approx. conversion: EUR 72.72 → CAD 109.50 (rate: 1.5062). Provider quotes in EUR." Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Transfer results now display prices in trip currency (e.g., ~CAD 109.50) with original provider currency below (EUR 72.72). Fetches FX rates via existing exchange-rates API when results load. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request extends the transportation activity management system with trip-scoped location autocomplete (hotels, airports, ports), subtype-driven UI visibility for different transport modes, and structured field storage for pickup/dropoff coordinates, car rental details, and station information. Address inputs now integrate Google Places API with trip location suggestions, and transfer pricing includes automatic currency conversion to the trip currency via exchange rate lookups. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Form as Transportation Form
participant AddressInput as TransportationAddressInput
participant TripLocations as useTripLocations<br/>(React Query)
participant GooglePlaces as Google Places API
participant API as Backend API
User->>Form: Open transportation form
Form->>TripLocations: Request trip locations
TripLocations->>API: GET /trips/{id}/locations
API-->>TripLocations: [hotels, airports, ports, day_locations]
TripLocations-->>Form: locations loaded
User->>AddressInput: Focus pickup address field
AddressInput->>AddressInput: Display trip locations in dropdown
User->>AddressInput: Type address query
AddressInput->>AddressInput: Debounce & check trip locations
AddressInput->>GooglePlaces: Autocomplete request (if no trip match)
GooglePlaces-->>AddressInput: Prediction suggestions
AddressInput->>AddressInput: Display combined results
User->>AddressInput: Select suggestion
alt Trip Location Selected
AddressInput->>AddressInput: Use location coords directly
else Google Prediction Selected
AddressInput->>GooglePlaces: Fetch Place Details
GooglePlaces-->>AddressInput: Formatted address, coords
end
AddressInput->>Form: onChange({address, name, lat, lng, placeId})
Form->>Form: Store in form state
sequenceDiagram
actor User
participant Form as Transportation Form
participant TransferPanel as TransferSearchPanel
participant SearchAPI as Search/Transfer API
participant ExchangeAPI as Exchange Rates API
participant Backend as Backend Service
participant DB as Database
User->>TransferPanel: Search transfers
TransferPanel->>SearchAPI: Request transfers
SearchAPI-->>TransferPanel: Results (provider currency)
TransferPanel->>TransferPanel: Extract provider currencies
TransferPanel->>ExchangeAPI: Fetch missing FX rates
ExchangeAPI-->>TransferPanel: Rate conversions
TransferPanel->>TransferPanel: Display prices in trip currency with subtext
User->>Form: Select transfer option
Form->>Form: Convert price to trip currency (async)
Form->>ExchangeAPI: POST /exchange-rates/convert
ExchangeAPI-->>Form: Converted amount
Form->>Form: Update totalPriceCents, currency, notes
Form->>Form: Show "Transfer Details Applied" toast
User->>Form: Submit transportation form
Form->>Backend: POST /trips/{id}/transportation
Backend->>DB: INSERT transportation_details
DB-->>Backend: Stored with converted pricing
Backend-->>Form: Success
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Complete transportation activity refactor addressing issues #23 and #26:
transportation_detailsfor structured location data (pickup/dropoff lat/lng/placeId/name), enhanced car rental fields (company, booking ref, class, fuel policy), and station fields (departure/arrival)Files changed (13 files, ~1100 lines added)
Database:
transportation_detailsAPI:
GET /trips/:id/locationsendpoint for trip location suggestionsSharedTransportDetailDtotype updatedAdmin:
TransportationAddressInputcomponent (Google Places v1 + trip suggestions)useTripLocationshookshowSection()visibility mapCodex validated
Test plan
fixes #23, fixes #26
Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Improvements