package luckygift

import (
	"hyapp-admin-server/internal/middleware"

	"github.com/gin-gonic/gin"
)

func RegisterRoutes(protected *gin.RouterGroup, h *Handler) {
	if h == nil {
		return
	}

	// 幸运礼物当前只保留 v2 规则接口：外部路径显式带 v2，避免后台或前端再误接旧 gift_id 规则模型。
	protected.GET("/admin/activity/lucky-gifts/v2/config", middleware.RequirePermission("lucky-gift:view"), h.GetLuckyGiftConfig)
	protected.PUT("/admin/activity/lucky-gifts/v2/config", middleware.RequirePermission("lucky-gift:update"), h.UpsertLuckyGiftConfig)
	protected.GET("/admin/activity/lucky-gifts/v2/configs", middleware.RequirePermission("lucky-gift:view"), h.ListLuckyGiftConfigs)
	protected.GET("/admin/activity/lucky-gifts/v2/draws", middleware.RequirePermission("lucky-gift:view"), h.ListLuckyGiftDraws)
	protected.GET("/admin/activity/lucky-gifts/v2/draw-summary", middleware.RequirePermission("lucky-gift:view"), h.GetLuckyGiftDrawSummary)
}
