diff --git a/API Server/internal/models/models.go b/API Server/internal/models/models.go index 00b7b02..e9c8eb2 100644 --- a/API Server/internal/models/models.go +++ b/API Server/internal/models/models.go @@ -54,7 +54,7 @@ type Car struct { BrakeFluidSpec string `json:"brakeFluidSpec"` // e.g. "DOT 4" CoolantSpec string `json:"coolantSpec"` // e.g. "Toyota Super Long Life Coolant" - FuelType string `json:"fuelType"` // petrol | diesel | hybrid | electric + FuelType string `json:"fuelType"` // petrol | petrol_lpg | diesel | diesel_lpg | hybrid | electric | hydrogen BuildDate string `json:"buildDate"` // ISO YYYY-MM-DD (date-only) FirstRegistrationDate string `json:"firstRegistrationDate"` // ISO YYYY-MM-DD (date-only) diff --git a/API Server/scripts/setup-pocketbase.mjs b/API Server/scripts/setup-pocketbase.mjs index 791049a..c3b212a 100644 --- a/API Server/scripts/setup-pocketbase.mjs +++ b/API Server/scripts/setup-pocketbase.mjs @@ -245,7 +245,17 @@ const DESIRED = { F.text("brake_fluid_spec"), F.text("coolant_spec"), F.number("current_km"), - F.select("fuel_type", ["petrol", "diesel", "hybrid", "electric"]), + // Bi-fuel LPG conversions are their own choice rather than a flag: the car + // runs on either tank, so "petrol + LPG" is what an owner picks it out as. + F.select("fuel_type", [ + "petrol", + "petrol_lpg", + "diesel", + "diesel_lpg", + "hybrid", + "electric", + "hydrogen", + ]), F.text("build_date"), // ISO YYYY-MM-DD (date-only; VIN 10th digit ≈ model year) F.text("first_registration_date"), // ISO YYYY-MM-DD // Owner of this car. Non-cascading on purpose: deleting a user must not diff --git a/Phone App/lib/models.dart b/Phone App/lib/models.dart index 5738f41..165ae17 100644 --- a/Phone App/lib/models.dart +++ b/Phone App/lib/models.dart @@ -18,7 +18,7 @@ class Car { final String differentialOilSpec; final String brakeFluidSpec; final String coolantSpec; - final String fuelType; // petrol | diesel | hybrid | electric + final String fuelType; // petrol | petrol_lpg | diesel | diesel_lpg | hybrid | electric | hydrogen final String buildDate; // ISO YYYY-MM-DD (date-only) final String firstRegistrationDate; // ISO YYYY-MM-DD (date-only) final int serviceIntervalDays; diff --git a/Phone App/lib/screens/car_detail_screen.dart b/Phone App/lib/screens/car_detail_screen.dart index 93f3068..84c355c 100644 --- a/Phone App/lib/screens/car_detail_screen.dart +++ b/Phone App/lib/screens/car_detail_screen.dart @@ -456,9 +456,12 @@ class _InfoTab extends StatelessWidget { static const Map _fuelLabels = { "petrol": "Petrol (gasoline)", + "petrol_lpg": "Petrol (gasoline) + LPG", "diesel": "Diesel", + "diesel_lpg": "Diesel + LPG", "hybrid": "Hybrid", "electric": "Electric", + "hydrogen": "Hydrogen", }; static String _fuelLabel(String v) => _fuelLabels[v] ?? "—"; diff --git a/Phone App/lib/screens/car_form_sheet.dart b/Phone App/lib/screens/car_form_sheet.dart index 19d4041..7058855 100644 --- a/Phone App/lib/screens/car_form_sheet.dart +++ b/Phone App/lib/screens/car_form_sheet.dart @@ -198,9 +198,12 @@ class _CarFormSheetState extends State { labelText: "Fuel type", border: OutlineInputBorder(), isDense: true), items: const [ DropdownMenuItem(value: "petrol", child: Text("Petrol (gasoline)")), + DropdownMenuItem(value: "petrol_lpg", child: Text("Petrol (gasoline) + LPG")), DropdownMenuItem(value: "diesel", child: Text("Diesel")), + DropdownMenuItem(value: "diesel_lpg", child: Text("Diesel + LPG")), DropdownMenuItem(value: "hybrid", child: Text("Hybrid")), DropdownMenuItem(value: "electric", child: Text("Electric")), + DropdownMenuItem(value: "hydrogen", child: Text("Hydrogen")), ], onChanged: (v) => setState(() => _fuelType = v ?? ""), ), diff --git a/Web App/web/src/components/CarFormModal.vue b/Web App/web/src/components/CarFormModal.vue index 229016c..c34b40c 100644 --- a/Web App/web/src/components/CarFormModal.vue +++ b/Web App/web/src/components/CarFormModal.vue @@ -110,9 +110,12 @@ async function submit() {
diff --git a/Web App/web/src/views/CarDetail.vue b/Web App/web/src/views/CarDetail.vue index 1e9f9fa..da2a304 100644 --- a/Web App/web/src/views/CarDetail.vue +++ b/Web App/web/src/views/CarDetail.vue @@ -390,9 +390,12 @@ function yn(v) { const FUEL_LABELS = { petrol: "Petrol (gasoline)", + petrol_lpg: "Petrol (gasoline) + LPG", diesel: "Diesel", + diesel_lpg: "Diesel + LPG", hybrid: "Hybrid", electric: "Electric", + hydrogen: "Hydrogen", }; function fuelLabel(v) { return FUEL_LABELS[v] || "—";