chore: build
Frontend Admin - EAS Build / build (push) Canceled after 0s
Frontend Client - EAS Build / build (push) Canceled after 0s
Backend - Build & Lint / build (push) Failing after 25m18s
Frontend Web - Build & Lint / build (push) Failing after 9m58s

This commit is contained in:
Xor290
2026-08-06 12:06:05 +02:00
parent c034088bee
commit 22a8d5026c
174 changed files with 30315 additions and 16120 deletions
-66
View File
@@ -15,72 +15,6 @@ import (
"time"
)
// GeocodeWithTomTom géocode une adresse via l'API TomTom Search.
func GeocodeWithTomTom(address string) (*GeoLocation, error) {
client := &http.Client{Timeout: 10 * time.Second}
buildReq := func(key string) (*http.Request, error) {
u := &url.URL{
Scheme: "https",
Host: "api.tomtom.com",
Path: fmt.Sprintf("/search/2/geocode/%s.json", url.PathEscape(address)),
}
q := url.Values{}
q.Set("key", key)
q.Set("countrySet", "FR")
q.Set("limit", "1")
u.RawQuery = q.Encode()
return http.NewRequest(http.MethodGet, u.String(), nil)
}
resp, err := tomTomKeys.Do(client, buildReq)
if err != nil {
return nil, fmt.Errorf("TomTom geocode: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
body, _ := io.ReadAll(resp.Body)
return nil, fmt.Errorf("TomTom geocode %d: %s", resp.StatusCode, string(body))
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("TomTom geocode lecture: %w", err)
}
var parsed struct {
Results []struct {
Position struct {
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
} `json:"position"`
Address struct {
FreeformAddress string `json:"freeformAddress"`
} `json:"address"`
MatchConfidence struct {
Score float64 `json:"score"`
} `json:"matchConfidence"`
} `json:"results"`
}
if err := json.Unmarshal(body, &parsed); err != nil {
return nil, fmt.Errorf("TomTom geocode parsing: %w", err)
}
if len(parsed.Results) == 0 {
return nil, fmt.Errorf("TomTom geocode: aucun résultat pour '%s'", address)
}
r := parsed.Results[0]
log.Printf("📍 [GEO] TomTom geocode '%s' → %s (%.6f, %.6f) conf=%.2f",
address, r.Address.FreeformAddress, r.Position.Lat, r.Position.Lon, r.MatchConfidence.Score)
return &GeoLocation{
Latitude: r.Position.Lat,
Longitude: r.Position.Lon,
DisplayName: r.Address.FreeformAddress,
}, nil
}
func GetETAWithTraffic(from, to Coordinates) (etaMinutes int, distanceKm float64, err error) {
client := &http.Client{Timeout: 10 * time.Second}