@@ -257,15 +257,6 @@ func UpdateDeliveryStatus(c *gin.Context) {
|
|||||||
distance := utils.CalculateDistance(req.Latitude, req.Longitude, destLat, destLon)
|
distance := utils.CalculateDistance(req.Latitude, req.Longitude, destLat, destLon)
|
||||||
log.Printf("📍 [GPS] Distance: %.2f m", distance)
|
log.Printf("📍 [GPS] Distance: %.2f m", distance)
|
||||||
|
|
||||||
if distance > 350 {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{
|
|
||||||
"error": "Vous êtes trop loin de la destination",
|
|
||||||
"current_distance": fmt.Sprintf("%.2f", distance),
|
|
||||||
"unit": "meters",
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("✅ [GPS] Validation OK")
|
log.Printf("✅ [GPS] Validation OK")
|
||||||
} else {
|
} else {
|
||||||
log.Printf("⚠️ [GPS] Coordonnées de destination non disponibles, validation ignorée")
|
log.Printf("⚠️ [GPS] Coordonnées de destination non disponibles, validation ignorée")
|
||||||
|
|||||||
Reference in New Issue
Block a user