chore: refacto

This commit is contained in:
2026-05-14 19:33:39 +02:00
parent e0c354d76c
commit dce417c209
19 changed files with 63 additions and 1435 deletions
-22
View File
@@ -13,11 +13,6 @@ import (
"github.com/gin-gonic/gin"
)
// ============================================
// GÉOCODAGE D'ADRESSES
// ============================================
// geo_handlers.go
func GeocodeAddress(c *gin.Context) {
geoService := c.MustGet("geoService").(*services.GeoService)
@@ -323,9 +318,6 @@ func AutoAssignNearestDeliveryPerson(c *gin.Context) {
log.Printf("📍 Adresse géocodée: %s -> (%.6f, %.6f)", address, location.Latitude, location.Longitude)
// ============================================
// 🔹 SAUVEGARDER LES COORDONNÉES DANS LE CACHE REDIS
// ============================================
destCacheKey := fmt.Sprintf("command:destination:%d", commandID)
coordsJSON, _ := json.Marshal(map[string]float64{
"lat": location.Latitude,
@@ -555,10 +547,6 @@ func AutoAssignNearestDeliveryPerson(c *gin.Context) {
})
}
// ============================================
// ASSIGNATION EN MASSE (TOUTES LES COMMANDES PENDING)
// ============================================
// AutoAssignAllPendingCommands assigne toutes les commandes en attente
// POST /api/v2/admin/protected/commands/auto-assign-all
func AutoAssignAllPendingCommands(c *gin.Context) {
@@ -716,10 +704,6 @@ func AutoAssignAllPendingCommands(c *gin.Context) {
})
}
// ============================================
// RÉCUPÉRER L'ÉTAT DES QUEUES DES LIVREURS
// ============================================
// GetAllDeliveryQueues retourne l'état de toutes les queues des livreurs
// GET /api/v2/admin/protected/delivery/queues
func GetAllDeliveryQueues(c *gin.Context) {
@@ -769,12 +753,6 @@ func GetAllDeliveryQueues(c *gin.Context) {
})
}
// ============================================
// RÉCUPÉRER LA QUEUE D'UN LIVREUR SPÉCIFIQUE
// ============================================
// GetDeliverymanQueue retourne la queue d'un livreur spécifique
// GET /api/v2/admin/protected/delivery/:username/queue
func GetDeliverymanQueue(c *gin.Context) {
database := c.MustGet("database").(*db.Database)