package vipconfig

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

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

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

	protected.GET("/admin/activity/vip-program", middleware.RequirePermission("vip-config:view"), h.GetProgram)
	protected.PUT("/admin/activity/vip-program", middleware.RequirePermission("vip-config:update"), h.UpdateProgram)
	protected.GET("/admin/activity/vip-levels", middleware.RequirePermission("vip-config:view"), h.ListLevels)
	protected.PUT("/admin/activity/vip-levels", middleware.RequirePermission("vip-config:update"), h.UpdateLevels)
	protected.POST("/admin/activity/vip-trial-card-grants", middleware.RequirePermission("vip-config:grant"), h.GrantVIPTrialCard)
	// 旧 App 仍使用直接会员赠送，保留原路由直到其 program.grant_mode 切换为 trial_card。
	protected.POST("/admin/activity/vip-grants", middleware.RequirePermission("vip-config:grant"), h.GrantVIP)
}
