diff --git a/frontend/src/features/vehicles/api/vehicles.api.ts b/frontend/src/features/vehicles/api/vehicles.api.ts index ed409c7..d4c93f1 100644 --- a/frontend/src/features/vehicles/api/vehicles.api.ts +++ b/frontend/src/features/vehicles/api/vehicles.api.ts @@ -82,7 +82,7 @@ export const vehiclesApi = { }, /** - * Decode VIN using NHTSA vPIC API + * Decode VIN using VIN decode service * Requires Pro or Enterprise tier */ decodeVin: async (vin: string): Promise => { diff --git a/frontend/src/features/vehicles/components/VehicleForm.tsx b/frontend/src/features/vehicles/components/VehicleForm.tsx index cba6faa..bfe2955 100644 --- a/frontend/src/features/vehicles/components/VehicleForm.tsx +++ b/frontend/src/features/vehicles/components/VehicleForm.tsx @@ -507,7 +507,7 @@ export const VehicleForm: React.FC = ({ /** * Handle VIN decode button click - * Calls NHTSA API and populates empty form fields + * Calls VIN decode service and populates empty form fields */ const handleDecodeVin = async () => { // Check tier access first diff --git a/frontend/src/features/vehicles/components/VinOcrReviewModal.tsx b/frontend/src/features/vehicles/components/VinOcrReviewModal.tsx index acc05b3..b45dae2 100644 --- a/frontend/src/features/vehicles/components/VinOcrReviewModal.tsx +++ b/frontend/src/features/vehicles/components/VinOcrReviewModal.tsx @@ -95,8 +95,8 @@ const ReviewContent: React.FC<{ const [selectedEngine, setSelectedEngine] = useState(''); const [selectedTransmission, setSelectedTransmission] = useState(''); - // NHTSA reference values for unmatched fields - const [nhtsaRefs, setNhtsaRefs] = useState>({}); + // Source reference values for unmatched fields + const [sourceRefs, setSourceRefs] = useState>({}); // Initialize dropdown options and pre-select decoded values useEffect(() => { @@ -109,13 +109,13 @@ const ReviewContent: React.FC<{ if (!decodedVehicle) return; - // Store NHTSA reference values for unmatched fields - setNhtsaRefs({ - make: decodedVehicle.make.confidence === 'none' ? decodedVehicle.make.nhtsaValue : null, - model: decodedVehicle.model.confidence === 'none' ? decodedVehicle.model.nhtsaValue : null, - trim: decodedVehicle.trimLevel.confidence === 'none' ? decodedVehicle.trimLevel.nhtsaValue : null, - engine: decodedVehicle.engine.confidence === 'none' ? decodedVehicle.engine.nhtsaValue : null, - transmission: decodedVehicle.transmission.confidence === 'none' ? decodedVehicle.transmission.nhtsaValue : null, + // Store source reference values for unmatched fields + setSourceRefs({ + make: decodedVehicle.make.confidence === 'none' ? decodedVehicle.make.sourceValue : null, + model: decodedVehicle.model.confidence === 'none' ? decodedVehicle.model.sourceValue : null, + trim: decodedVehicle.trimLevel.confidence === 'none' ? decodedVehicle.trimLevel.sourceValue : null, + engine: decodedVehicle.engine.confidence === 'none' ? decodedVehicle.engine.sourceValue : null, + transmission: decodedVehicle.transmission.confidence === 'none' ? decodedVehicle.transmission.sourceValue : null, }); const yearValue = decodedVehicle.year.value; @@ -277,9 +277,9 @@ const ReviewContent: React.FC<{ }); }; - /** Show NHTSA reference when field had no dropdown match */ - const nhtsaHint = (field: string) => { - const ref = nhtsaRefs[field]; + /** Show source reference when field had no dropdown match */ + const sourceHint = (field: string) => { + const ref = sourceRefs[field]; if (!ref) return null; // Only show hint when no value is currently selected const selected: Record = { @@ -292,7 +292,7 @@ const ReviewContent: React.FC<{ if (selected[field]) return null; return (

- NHTSA returned: {ref} + Decoded value: {ref}

); }; @@ -409,7 +409,7 @@ const ReviewContent: React.FC<{ ))} - {nhtsaHint('make')} + {sourceHint('make')} {/* Model */} @@ -439,7 +439,7 @@ const ReviewContent: React.FC<{ ))} - {nhtsaHint('model')} + {sourceHint('model')} {/* Trim */} @@ -469,7 +469,7 @@ const ReviewContent: React.FC<{ ))} - {nhtsaHint('trim')} + {sourceHint('trim')} {/* Engine */} @@ -499,7 +499,7 @@ const ReviewContent: React.FC<{ ))} - {nhtsaHint('engine')} + {sourceHint('engine')} {/* Transmission */} @@ -529,7 +529,7 @@ const ReviewContent: React.FC<{ ))} - {nhtsaHint('transmission')} + {sourceHint('transmission')} diff --git a/frontend/src/features/vehicles/hooks/useVinOcr.ts b/frontend/src/features/vehicles/hooks/useVinOcr.ts index 9554259..11d7e0b 100644 --- a/frontend/src/features/vehicles/hooks/useVinOcr.ts +++ b/frontend/src/features/vehicles/hooks/useVinOcr.ts @@ -1,5 +1,5 @@ /** - * @ai-summary Hook to orchestrate VIN OCR extraction and NHTSA decode + * @ai-summary Hook to orchestrate VIN OCR extraction and VIN decode * @ai-context Handles camera capture -> OCR extraction -> VIN decode flow */ @@ -109,7 +109,7 @@ export function useVinOcr(): UseVinOcrReturn { ); } - // Step 2: Decode VIN using NHTSA + // Step 2: Decode VIN setProcessingStep('decoding'); let decodedVehicle: DecodedVehicleData | null = null; let decodeError: string | null = null; @@ -121,7 +121,7 @@ export function useVinOcr(): UseVinOcrReturn { if (err.response?.data?.error === 'TIER_REQUIRED') { decodeError = 'VIN decode requires Pro or Enterprise subscription'; } else if (err.response?.data?.error === 'INVALID_VIN') { - decodeError = 'VIN format is not recognized by NHTSA'; + decodeError = 'VIN format is not recognized'; } else { decodeError = 'Unable to decode vehicle information'; } diff --git a/frontend/src/features/vehicles/types/vehicles.types.ts b/frontend/src/features/vehicles/types/vehicles.types.ts index 4276714..01d8642 100644 --- a/frontend/src/features/vehicles/types/vehicles.types.ts +++ b/frontend/src/features/vehicles/types/vehicles.types.ts @@ -72,12 +72,12 @@ export type MatchConfidence = 'high' | 'medium' | 'none'; */ export interface MatchedField { value: T | null; - nhtsaValue: string | null; + sourceValue: string | null; confidence: MatchConfidence; } /** - * Decoded vehicle data from NHTSA vPIC API + * Decoded vehicle data from VIN decode * with match confidence per field */ export interface DecodedVehicleData { diff --git a/frontend/src/pages/GuidePage/sections/SubscriptionSection.tsx b/frontend/src/pages/GuidePage/sections/SubscriptionSection.tsx index 5a6c77a..c76a0b9 100644 --- a/frontend/src/pages/GuidePage/sections/SubscriptionSection.tsx +++ b/frontend/src/pages/GuidePage/sections/SubscriptionSection.tsx @@ -43,7 +43,7 @@ export const SubscriptionSection = () => {

- 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.

@@ -58,7 +58,7 @@ export const SubscriptionSection = () => {

  • A VIN OCR Review modal appears showing the detected VIN with confidence indicators
  • Confirm or correct the VIN, then click Accept
  • Click the Decode VIN button
  • -
  • The system queries the NHTSA database and auto-populates: Year, Make, Model, Engine, Transmission, and Trim
  • +
  • The system queries the vehicle database and auto-populates: Year, Make, Model, Engine, Transmission, and Trim
  • Review the pre-filled fields and complete the remaining details
  • diff --git a/frontend/src/pages/GuidePage/sections/VehiclesSection.tsx b/frontend/src/pages/GuidePage/sections/VehiclesSection.tsx index b363a54..09099cc 100644 --- a/frontend/src/pages/GuidePage/sections/VehiclesSection.tsx +++ b/frontend/src/pages/GuidePage/sections/VehiclesSection.tsx @@ -141,7 +141,7 @@ export const VehiclesSection = () => {