This commit is contained in:
Eric Gullickson
2025-11-04 18:38:06 -06:00
parent d8d0ada83f
commit d4156cf521
20 changed files with 1149 additions and 186 deletions

View File

@@ -12,12 +12,17 @@ Primary entity for vehicle management consuming MVP Platform Vehicles Service. H
- `PUT /api/vehicles/:id` - Update vehicle details
- `DELETE /api/vehicles/:id` - Soft delete vehicle
### Hierarchical Vehicle Dropdowns (Platform Service Proxy)
- `GET /api/vehicles/dropdown/makes?year={year}` - Get makes for year
- `GET /api/vehicles/dropdown/models?year={year}&make_id={make_id}` - Get models for make/year
- `GET /api/vehicles/dropdown/trims?year={year}&make_id={make_id}&model_id={model_id}` - Get trims
- `GET /api/vehicles/dropdown/engines?year={year}&make_id={make_id}&model_id={model_id}` - Get engines
- `GET /api/vehicles/dropdown/transmissions?year={year}&make_id={make_id}&model_id={model_id}` - Get transmissions
### Hierarchical Vehicle Dropdowns
**Status**: Dropdown methods are TODO stubs in vehicles service. Frontend directly consumes platform module endpoints.
Frontend consumes (via `/platform` module, not vehicles feature):
- `GET /api/platform/years` - Get all years
- `GET /api/platform/makes?year={year}` - Get makes for year
- `GET /api/platform/models?year={year}&make_id={make_id}` - Get models for make/year
- `GET /api/platform/trims?year={year}&make_id={make_id}&model_id={model_id}` - Get trims
- `GET /api/platform/engines?year={year}&make_id={make_id}&model_id={model_id}&trim_id={trim_id}` - Get engines
- `GET /api/platform/transmissions?year={year}&make_id={make_id}&model_id={model_id}` - Get transmissions
- `GET /api/platform/vehicle?vin={vin}` - Decode VIN
## Authentication
- All vehicles endpoints (including dropdowns) require a valid JWT (Auth0).
@@ -90,22 +95,18 @@ vehicles/
│ └── vehicles.validation.ts
├── domain/ # Business logic
│ ├── vehicles.service.ts
── vehicles.types.ts
── vehicles.types.ts
│ └── name-normalizer.ts
├── data/ # Database layer
│ └── vehicles.repository.ts
├── migrations/ # Feature schema
│ └── 001_create_vehicles_tables.sql
├── external/ # Platform Service Integration
│ └── platform-vehicles/
│ ├── platform-vehicles.client.ts
│ └── platform-vehicles.types.ts
├── tests/ # All tests
│ ├── unit/
│ │ ── vehicles.service.test.ts
│ │ └── platform-vehicles.client.test.ts
│ │ ── vehicles.service.test.ts
│ └── integration/
│ └── vehicles.integration.test.ts
└── docs/ # Additional docs
└── (Platform integration: dropdown/VIN decode via shared platform module in features/platform/)
```
## Key Features
@@ -185,11 +186,10 @@ vehicles/
## Testing
### Unit Tests
- `vehicles.service.test.ts` - Business logic with mocked dependencies
- `platform-vehicles.client.test.ts` - Platform service client with mocked HTTP
- `vehicles.service.test.ts` - Business logic with mocked dependencies (VIN decode, caching, CRUD operations)
### Integration Tests
- `vehicles.integration.test.ts` - Complete API workflow with test database
- `vehicles.integration.test.ts` - Complete API workflow with test database (create, read, update, delete vehicles)
### Run Tests
```bash