feat: notif telegram
This commit is contained in:
@@ -286,11 +286,13 @@ func ValidateBasket(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
req.DeliveryAddress = cmd.DeliveryAddress
|
req.DeliveryAddress = cmd.DeliveryAddress
|
||||||
|
|
||||||
// Vérifier que le client a lié son compte Telegram
|
// Vérifier que le client a lié son compte Telegram (seulement si les notifications sont activées)
|
||||||
|
if services.TelegramBot != nil && services.TelegramBot.IsNotificationsEnabled() {
|
||||||
if _, linked, err := database.GetClientTelegramChatID(usernameStr); err != nil || !linked {
|
if _, linked, err := database.GetClientTelegramChatID(usernameStr); err != nil || !linked {
|
||||||
c.JSON(http.StatusForbidden, gin.H{"error": "Vous devez lier votre compte Telegram avant de commander"})
|
c.JSON(http.StatusForbidden, gin.H{"error": "Vous devez lier votre compte Telegram avant de commander"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("🛒 [CHECKOUT] Début checkout pour: %s", usernameStr)
|
log.Printf("🛒 [CHECKOUT] Début checkout pour: %s", usernameStr)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user