chore: update

This commit is contained in:
2026-03-03 23:42:23 +01:00
parent 52b059fafa
commit 0073f80a48
95 changed files with 2720 additions and 40619 deletions
+25
View File
@@ -359,6 +359,31 @@ func UpdateDeliveryStatus(c *gin.Context) {
}
database.AddCommandLog(commandID, req.Status, message, usernameStr)
// ✅ NOTIFICATION CLIENT
clientUsername, _ := command["username"].(string)
if clientUsername != "" {
var clientMsg string
switch req.Status {
case "support":
clientMsg = fmt.Sprintf("Votre commande #%d est prise en charge", commandID)
case "en_route":
if etaMinutes > 0 {
clientMsg = fmt.Sprintf("Votre commande #%d est en route ! Arrivée dans ~%d min", commandID, etaMinutes)
} else {
clientMsg = fmt.Sprintf("Votre commande #%d est en route !", commandID)
}
case "arrived":
clientMsg = fmt.Sprintf("Votre livreur est arrivé pour la commande #%d", commandID)
case "livre":
clientMsg = fmt.Sprintf("Votre commande #%d a été livrée. Merci !", commandID)
case "failed":
clientMsg = fmt.Sprintf("Échec de livraison pour la commande #%d", commandID)
}
if clientMsg != "" {
database.NotifyClient(clientUsername, commandID, req.Status, clientMsg)
}
}
// ✅ GESTION SPÉCIALE SELON LE STATUT
switch req.Status {
case "livre":