package routes

import (
	"sheetless-server/handlers"
	"sheetless-server/middleware"

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

func SetupRoutes(r *gin.Engine) {
	// Public routes
	auth := r.Group("/auth")
	{
		auth.POST("/register", handlers.Register)
		auth.POST("/login", handlers.Login)
	}

	// Protected routes
	api := r.Group("/api")
	api.Use(middleware.AuthMiddleware())
	{
		sheets := api.Group("/sheets")
		{
			sheets.POST("/upload", handlers.UploadSheet)
			sheets.GET("/list", handlers.ListSheets)
			sheets.GET("/get/:id", handlers.DownloadSheet)
		}
	}
}
