package admin

import (
	"server/internal/roles"

	"github.com/gofiber/fiber/v3"
)

func RegisterAdminRoutes(app *fiber.App) {
	adminController := NewAdminController()

	// Typescript: TSEndpoint= path=/admin/users; name=listUsers; method=POST; request=admin.ListUsersRequest; response=users.[]User
	app.Post("/admin/users", adminController.ListUsers)
	roles.RegisterEndpoint("POST/admin/users", int(roles.AdminPermission))

	// Typescript: TSEndpoint= path=/admin/users/:uuid/block; name=blockUser; method=PUT; request=admin.BlockUserRequest; response=users.User
	app.Put("/admin/users/:uuid/block", adminController.BlockUser)
	roles.RegisterEndpoint("PUT/admin/users/:uuid/block", int(roles.AdminPermission))
}
