package router

import (
	"git.umbach.dev/app-idea/rest-api/routers/api/v1/picture"
	"git.umbach.dev/app-idea/rest-api/routers/api/v1/user"

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

func SetupRoutes(app *fiber.App) {
	api := app.Group("/api/v1")

	u := api.Group("/user")
	u.Post("/", user.SessionIdCheck, user.GetUser)
	u.Post("/login", user.Login)
	u.Delete("/", user.DeleteUser)

	// mails
	u.Get("/action/:actionType/:actionId", user.HandleActions)

	s := api.Group("/sessions")
	s.Post("/", user.AuthSession)
	s.Delete("/:id", user.SessionIdCheck, user.DeleteSession)

	users := api.Group("/users")
	users.Post("/", user.NewUser)
	users.Post("/:id", user.SessionIdCheck, user.GetUserById)
	users.Delete("/:id", user.SessionIdCheck, user.DeleteUser)

	pictures := api.Group("/pictures")
	pictures.Post("/", user.SessionIdCheck, picture.Test)
}
