chore: remove NHTSA code and update documentation (refs #227)
Delete vehicles/external/nhtsa/ directory (3 files), remove VPICVariable and VPICResponse from platform models. Update all documentation to reflect Gemini VIN decode via OCR service architecture. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ The platform provides vehicle hierarchical data lookups:
|
||||
VIN decoding is planned but not yet implemented. Future capabilities will include:
|
||||
- `GET /api/platform/vehicle?vin={vin}` - Decode VIN to vehicle details
|
||||
- PostgreSQL-based VIN decode function
|
||||
- NHTSA vPIC API fallback with circuit breaker
|
||||
- Gemini VIN decode via OCR service
|
||||
- Redis caching (7-day TTL for successful decodes)
|
||||
|
||||
**Data Source**: Vehicle data from standardized sources
|
||||
|
||||
@@ -74,7 +74,7 @@ docker compose exec mvp-frontend npm test -- --coverage
|
||||
|
||||
Example: `vehicles.service.test.ts`
|
||||
- Tests VIN validation logic
|
||||
- Tests vehicle creation with mocked vPIC responses
|
||||
- Tests vehicle creation with mocked OCR service responses
|
||||
- Tests caching behavior with mocked Redis
|
||||
- Tests error handling paths
|
||||
|
||||
@@ -194,7 +194,7 @@ All 15 features have test suites with unit and/or integration tests:
|
||||
- `vehicles` - Unit + integration tests
|
||||
|
||||
### Mock Strategy
|
||||
- **External APIs**: Completely mocked (vPIC, Google Maps)
|
||||
- **External APIs**: Completely mocked (OCR service, Google Maps)
|
||||
- **Database**: Real database with transactions
|
||||
- **Redis**: Mocked for unit tests, real for integration
|
||||
- **Auth**: Mocked JWT tokens for protected endpoints
|
||||
@@ -319,9 +319,9 @@ describe('Error Handling', () => {
|
||||
).rejects.toThrow('Invalid VIN format');
|
||||
});
|
||||
|
||||
it('should handle vPIC API failure', async () => {
|
||||
mockVpicClient.decode.mockRejectedValue(new Error('API down'));
|
||||
|
||||
it('should handle OCR service failure', async () => {
|
||||
mockOcrClient.decodeVin.mockRejectedValue(new Error('API down'));
|
||||
|
||||
const result = await vehicleService.create(validVehicle, 'user123');
|
||||
expect(result.make).toBeNull(); // Graceful degradation
|
||||
});
|
||||
|
||||
@@ -644,7 +644,7 @@ When you attempt to use a Pro feature on the Free tier, an **Upgrade Required**
|
||||
|
||||
### VIN Camera Scanning and Decode (Pro)
|
||||
|
||||
**What it does:** Use your device camera to photograph your vehicle's VIN plate, and the system automatically reads the VIN using OCR (Optical Character Recognition) and decodes it from the NHTSA database.
|
||||
**What it does:** Use your device camera to photograph your vehicle's VIN plate, and the system automatically reads the VIN using OCR (Optical Character Recognition) and decodes it from the vehicle database.
|
||||
|
||||
**How to use it:**
|
||||
|
||||
@@ -655,7 +655,7 @@ When you attempt to use a Pro feature on the Free tier, an **Upgrade Required**
|
||||
5. A **VIN OCR Review modal** appears showing the detected VIN with confidence indicators
|
||||
6. Confirm or correct the VIN, then click **Accept**
|
||||
7. Click the **Decode VIN** button
|
||||
8. The system queries the NHTSA database and auto-populates: Year, Make, Model, Engine, Transmission, and Trim
|
||||
8. The system queries the vehicle database and auto-populates: Year, Make, Model, Engine, Transmission, and Trim
|
||||
9. Review the pre-filled fields and complete the remaining details
|
||||
|
||||
This eliminates manual data entry errors and ensures accurate vehicle specifications.
|
||||
|
||||
Reference in New Issue
Block a user