Added Documents Feature
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Stations Feature Capsule
|
||||
|
||||
## Summary
|
||||
Search nearby gas stations via Google Maps and manage users' saved stations.
|
||||
## Quick Summary (50 tokens)
|
||||
Search nearby gas stations via Google Maps and manage users' saved stations with user-owned saved lists. Caches search results for 1 hour. JWT required for all endpoints.
|
||||
|
||||
## API Endpoints (JWT required)
|
||||
- `POST /api/stations/search` — Search nearby stations
|
||||
@@ -22,7 +22,7 @@ Search nearby gas stations via Google Maps and manage users' saved stations.
|
||||
## Dependencies
|
||||
- Internal: core/auth, core/cache
|
||||
- External: Google Maps API (Places)
|
||||
- Database: stations table
|
||||
- Database: stations table (see `docs/DATABASE-SCHEMA.md`)
|
||||
|
||||
## Quick Commands
|
||||
```bash
|
||||
@@ -32,9 +32,6 @@ 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?
|
||||
|
||||
## Notes
|
||||
- Search payload and saved schema to be finalized; align with Google Places best practices and platform quotas. Caching policy: 1 hour TTL (key `stations:search:{query}`).
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
import { env } from '../../../../core/config/environment';
|
||||
import { appConfig } from '../../../../core/config/config-loader';
|
||||
import { logger } from '../../../../core/logging/logger';
|
||||
import { cacheService } from '../../../../core/config/redis';
|
||||
import { GooglePlacesResponse, GooglePlace } from './google-maps.types';
|
||||
import { Station } from '../../domain/stations.types';
|
||||
|
||||
export class GoogleMapsClient {
|
||||
private readonly apiKey = env.GOOGLE_MAPS_API_KEY;
|
||||
private readonly apiKey = appConfig.secrets.google_maps_api_key;
|
||||
private readonly baseURL = 'https://maps.googleapis.com/maps/api/place';
|
||||
private readonly cacheTTL = 3600; // 1 hour
|
||||
|
||||
|
||||
Reference in New Issue
Block a user