1.2 KiB
1.2 KiB
Stations Feature Capsule
Summary
Search nearby gas stations via Google Maps and manage users' saved stations.
API Endpoints (JWT required)
POST /api/stations/search— Search nearby stationsPOST /api/stations/save— Save a station to user's favoritesGET /api/stations/saved— List saved stations for the userDELETE /api/stations/saved/:placeId— Remove a saved station
Structure
- api/ - HTTP endpoints, routes, validators
- domain/ - Business logic, types, rules
- data/ - Repository, database queries
- migrations/ - Feature-specific schema
- external/ - External API integrations
- events/ - Event handlers
- tests/ - All feature tests
- docs/ - Detailed documentation
Dependencies
- Internal: core/auth, core/cache
- External: Google Maps API (Places)
- Database: stations table
Quick Commands
# Run feature tests
npm test -- features/stations
# Run feature migrations
npm run migrate:feature stations
Clarifications Needed
- Search payload structure (required fields, radius/filters)?
- Saved station schema and required fields?
- Caching policy for searches (TTL, cache keys)?
- Rate limits or quotas for Google Maps calls?