diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-12-28 15:59:32 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-12-28 15:59:50 +0100 |
| commit | 4fb2fe683b75464917dec4b1a0aaee63830f3b9a (patch) | |
| tree | 40b48d9717061db2bc3434b5db085eeeaae6cd76 /src/Costasdev.Busurbano.Backend/Types | |
| parent | 1fd17d4d07d25a810816e4e38ddc31ae72b8c91a (diff) | |
feat: Refactor NavBar and Planner components; update geocoding services
- Removed unused Navigation2 icon from NavBar.
- Updated usePlanner hook to manage route history and improve local storage handling.
- Enhanced PlannerApi with new fare properties and improved itinerary handling.
- Added recent routes feature in StopList with navigation to planner.
- Implemented NominatimGeocodingService for autocomplete and reverse geocoding.
- Updated UI components for better user experience and accessibility.
- Added translations for recent routes in multiple languages.
- Improved CSS styles for map controls and overall layout.
Diffstat (limited to 'src/Costasdev.Busurbano.Backend/Types')
3 files changed, 79 insertions, 42 deletions
diff --git a/src/Costasdev.Busurbano.Backend/Types/Nominatim/NominatimModels.cs b/src/Costasdev.Busurbano.Backend/Types/Nominatim/NominatimModels.cs new file mode 100644 index 0000000..a73cdd2 --- /dev/null +++ b/src/Costasdev.Busurbano.Backend/Types/Nominatim/NominatimModels.cs @@ -0,0 +1,75 @@ +using System.Text.Json.Serialization; + +namespace Costasdev.Busurbano.Backend.Types.Nominatim; + +public class NominatimSearchResult +{ + [JsonPropertyName("place_id")] + public long PlaceId { get; set; } + + [JsonPropertyName("licence")] + public string? Licence { get; set; } + + [JsonPropertyName("osm_type")] + public string? OsmType { get; set; } + + [JsonPropertyName("osm_id")] + public long OsmId { get; set; } + + [JsonPropertyName("lat")] + public string? Lat { get; set; } + + [JsonPropertyName("lon")] + public string? Lon { get; set; } + + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + [JsonPropertyName("address")] + public NominatimAddress? Address { get; set; } + + [JsonPropertyName("extratags")] + public Dictionary<string, string>? ExtraTags { get; set; } + + [JsonPropertyName("category")] + public string? Category { get; set; } + + [JsonPropertyName("type")] + public string? Type { get; set; } + + [JsonPropertyName("importance")] + public double Importance { get; set; } +} + +public class NominatimAddress +{ + [JsonPropertyName("house_number")] + public string? HouseNumber { get; set; } + + [JsonPropertyName("road")] + public string? Road { get; set; } + + [JsonPropertyName("suburb")] + public string? Suburb { get; set; } + + [JsonPropertyName("city")] + public string? City { get; set; } + + [JsonPropertyName("municipality")] + public string? Municipality { get; set; } + + [JsonPropertyName("county")] + public string? County { get; set; } + + [JsonPropertyName("state")] + public string? State { get; set; } + + [JsonPropertyName("postcode")] + public string? Postcode { get; set; } + + [JsonPropertyName("country")] + public string? Country { get; set; } + + [JsonPropertyName("country_code")] + public string? CountryCode { get; set; } +} diff --git a/src/Costasdev.Busurbano.Backend/Types/Otp/OtpModels.cs b/src/Costasdev.Busurbano.Backend/Types/Otp/OtpModels.cs index b67663d..2c076a2 100644 --- a/src/Costasdev.Busurbano.Backend/Types/Otp/OtpModels.cs +++ b/src/Costasdev.Busurbano.Backend/Types/Otp/OtpModels.cs @@ -163,43 +163,3 @@ public class OtpWalkStep [JsonPropertyName("lon")] public double Lon { get; set; } } - -// Geocoding Models (Pelias-like) -public class OtpGeocodeResponse -{ - [JsonPropertyName("features")] - public List<OtpGeocodeFeature> Features { get; set; } = new(); -} - -public class OtpGeocodeFeature -{ - [JsonPropertyName("geometry")] - public OtpGeocodeGeometry? Geometry { get; set; } - - [JsonPropertyName("properties")] - public OtpGeocodeProperties? Properties { get; set; } -} - -public class OtpGeocodeGeometry -{ - [JsonPropertyName("coordinates")] - public List<double> Coordinates { get; set; } = new(); // [lon, lat] -} - -public class OtpGeocodeProperties -{ - [JsonPropertyName("name")] - public string? Name { get; set; } - - [JsonPropertyName("postalcode")] - public string? PostalCode { get; set; } - - [JsonPropertyName("localadmin")] - public string? LocalAdmin { get; set; } - - [JsonPropertyName("region")] - public string? Region { get; set; } - - [JsonPropertyName("layer")] - public string? Layer { get; set; } -} diff --git a/src/Costasdev.Busurbano.Backend/Types/Planner/PlannerResponse.cs b/src/Costasdev.Busurbano.Backend/Types/Planner/PlannerResponse.cs index f88942f..a0cf754 100644 --- a/src/Costasdev.Busurbano.Backend/Types/Planner/PlannerResponse.cs +++ b/src/Costasdev.Busurbano.Backend/Types/Planner/PlannerResponse.cs @@ -16,8 +16,10 @@ public class Itinerary public double TransitTimeSeconds { get; set; } public double WaitingTimeSeconds { get; set; } public List<Leg> Legs { get; set; } = []; - public decimal? CashFareEuro { get; set; } - public decimal? CardFareEuro { get; set; } + public decimal? CashFare { get; set; } + public bool? CashFareIsTotal { get; set; } + public decimal? CardFare { get; set; } + public bool? CardFareIsTotal { get; set; } } public class Leg |
