package library

import (
	"gitlab.thpeetz.de/kontor/kontor-go/pkg/auth"

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

// GetRoutes returns all routes for library related data.
func GetRoutes(router *gin.Engine) {
	libraryRoutes := router.Group("/library")
	{
		libraryRoutes.GET("/", auth.EnsureLoggedIn(), showBookList)
		libraryRoutes.GET("/book", auth.EnsureLoggedIn(), showBookList)
		libraryRoutes.GET("/author", auth.EnsureLoggedIn(), showAuthorList)
		libraryRoutes.GET("/publisher", auth.EnsureLoggedIn(), showPublisherList)
		libraryRoutes.POST("/publisher", auth.EnsureLoggedIn(), showPublisherList)
		libraryRoutes.GET("/publisher/view/:publisher_id", auth.EnsureLoggedIn(), showPublisherDetails)
		libraryRoutes.POST("/publisher/validate", auth.EnsureLoggedIn(), validatePublisherDetails)
		libraryRoutes.GET("/publisher/create", auth.EnsureLoggedIn(), showPublisherCreation)
	}
}
