package routes

import (
	"server/internal/auth"
	"server/internal/http/controllers"

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

func registerUserRoutes(app *fiber.App, authService *auth.Service) {
	userController := controllers.NewUserController()

	// Typescript: TSEndpoint= path=/users/:uuid; name=getUser; method=GET; response=models.UserProfile
	app.Get("/users/:uuid", authService.Middleware(), userController.GetUser)

	// Typescript: TSEndpoint= path=/users; name=createUser; method=POST; request=models.UserCreateInput; response=models.UserProfile
	app.Post("/users", authService.Middleware(), userController.CreateUser)

	// Typescript: TSEndpoint= path=/users/:uuid; name=updateUser; method=PUT; request=controllers.UpdateUserRequest; response=models.UserProfile
	app.Put("/users/:uuid", authService.Middleware(), userController.UpdateUser)

	// Typescript: TSEndpoint= path=/users/:uuid; name=deleteUser; method=DELETE; response=controllers.SimpleResponse
	app.Delete("/users/:uuid", authService.Middleware(), userController.DeleteUser)
}
