chore: build

This commit is contained in:
2026-06-14 17:50:35 +02:00
parent 3c92a0371f
commit 3a0f725159
93 changed files with 5311 additions and 4224 deletions
+13 -11
View File
@@ -595,10 +595,6 @@ func ValidateDelivery(c *gin.Context) {
})
}
// ============================================
// GESTION ADMIN
// ============================================
// GetAvailableDeliveryPersons récupère les livreurs disponibles
// GET /api/v1/admin/delivery-persons/available
func GetAvailableDeliveryPersons(c *gin.Context) {
@@ -778,13 +774,6 @@ func GetClientCommandsHistory(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// ============================================
// NOTIFICATIONS CLIENT
// ============================================
// NotifyClientToDescend envoie une notification push au client pour descendre récupérer sa commande
// POST /api/v2/admin/protected/orders/:id/notify-client
// POST /api/v1/cabine/commands/:id/notify-client
func NotifyClientToDescend(c *gin.Context) {
database := c.MustGet("database").(*db.Database)
@@ -1119,6 +1108,19 @@ func UpdateCommandStatusAdmin(c *gin.Context) {
return
}
if req.Status == "cancelled" {
current, errCmd := database.GetCommandByID(commandID)
if errCmd == nil {
currentStatus, _ := current["status"].(string)
alreadyDone := currentStatus == "cancelled" || currentStatus == "approved" || currentStatus == "livre"
if !alreadyDone {
if err := database.RestoreCommandStock(commandID); err != nil {
log.Printf("⚠️ [STATUS_ADMIN] Erreur restauration stock cmd %d: %v", commandID, err)
}
}
}
}
if err := database.UpdateCommandStatus(commandID, req.Status); err != nil {
utils.ServerErr(c, "Impossible de mettre à jour le statut", err)
return