feat: add ownership cost fields to vehicle form (refs #15)
- Add CostInterval type and TCOResponse interface - Add TCO fields to Vehicle, CreateVehicleRequest, UpdateVehicleRequest - Add "Ownership Costs" section to VehicleForm with: - Purchase price and date - Insurance cost and interval - Registration cost and interval - TCO display toggle - Add getTCO API method - Mobile-responsive grid layout with 44px touch targets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { apiClient } from '../../../core/api/client';
|
||||
import { Vehicle, CreateVehicleRequest, UpdateVehicleRequest, DecodedVehicleData } from '../types/vehicles.types';
|
||||
import { Vehicle, CreateVehicleRequest, UpdateVehicleRequest, DecodedVehicleData, TCOResponse } from '../types/vehicles.types';
|
||||
|
||||
// All requests (including dropdowns) use authenticated apiClient
|
||||
|
||||
@@ -88,5 +88,13 @@ export const vehiclesApi = {
|
||||
decodeVin: async (vin: string): Promise<DecodedVehicleData> => {
|
||||
const response = await apiClient.post('/vehicles/decode-vin', { vin });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Total Cost of Ownership data for a vehicle
|
||||
*/
|
||||
getTCO: async (vehicleId: string): Promise<TCOResponse> => {
|
||||
const response = await apiClient.get(`/vehicles/${vehicleId}/tco`);
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user