package gamemanagement

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/game/platforms", middleware.RequirePermission("game:view"), h.ListPlatforms)
	protected.POST("/admin/game/platforms", middleware.RequirePermission("game:update"), h.CreatePlatform)
	protected.PATCH("/admin/game/platforms/:platform_code", middleware.RequirePermission("game:update"), h.UpdatePlatform)
	protected.GET("/admin/game/games", middleware.RequirePermission("game:view"), h.ListCatalog)
	protected.POST("/admin/game/games", middleware.RequirePermission("game:create"), h.CreateCatalog)
	protected.PATCH("/admin/game/games/:game_id", middleware.RequirePermission("game:update"), h.UpdateCatalog)
	protected.PATCH("/admin/game/games/:game_id/status", middleware.RequirePermission("game:status"), h.SetGameStatus)
}
