Initial Commit

This commit is contained in:
Eric Gullickson
2025-09-17 16:09:15 -05:00
parent 0cdb9803de
commit a052040e3a
373 changed files with 437090 additions and 6773 deletions

View File

@@ -0,0 +1,35 @@
import { apiClient } from '../../../core/api/client';
import { CreateFuelLogRequest, FuelLogResponse, EnhancedFuelStats, FuelType, FuelGradeOption } from '../types/fuel-logs.types';
export const fuelLogsApi = {
async create(data: CreateFuelLogRequest): Promise<FuelLogResponse> {
const res = await apiClient.post('/fuel-logs', data);
return res.data;
},
async getUserFuelLogs(): Promise<FuelLogResponse[]> {
const res = await apiClient.get('/fuel-logs');
return res.data;
},
async getFuelLogsByVehicle(vehicleId: string): Promise<FuelLogResponse[]> {
const res = await apiClient.get(`/fuel-logs/vehicle/${vehicleId}`);
return res.data;
},
async getVehicleStats(vehicleId: string): Promise<EnhancedFuelStats> {
const res = await apiClient.get(`/fuel-logs/vehicle/${vehicleId}/stats`);
return res.data;
},
async getFuelTypes(): Promise<{ value: FuelType; label: string; grades: FuelGradeOption[] }[]> {
const res = await apiClient.get('/fuel-logs/fuel-types');
return res.data.fuelTypes;
},
async getFuelGrades(fuelType: FuelType): Promise<FuelGradeOption[]> {
const res = await apiClient.get(`/fuel-logs/fuel-grades/${fuelType}`);
return res.data.grades;
}
};