package menu

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

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

func RegisterRoutes(protected *gin.RouterGroup, h *Handler) {
	protected.GET("/navigation/menus", h.NavigationMenus)

	protected.GET("/system/menus", middleware.RequirePermission("menu:view"), h.ListSystemMenus)
	protected.POST("/system/menus", middleware.RequirePermission("menu:create"), h.CreateMenu)
	protected.PATCH("/system/menus/:id", middleware.RequirePermission("menu:update"), h.UpdateMenu)
	protected.DELETE("/system/menus/:id", middleware.RequirePermission("menu:delete"), h.DeleteMenu)
	protected.PATCH("/system/menus/:id/visible", middleware.RequirePermission("menu:visible"), h.UpdateMenuVisible)
	protected.PUT("/system/menus/sort", middleware.RequirePermission("menu:sort"), h.SortMenus)
}
