package job

import (
	"hyapp-admin-server/internal/middleware"

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

func RegisterRoutes(protected *gin.RouterGroup, h *Handler) {
	protected.GET("/jobs", middleware.RequirePermission("job:view"), h.ListJobs)
	protected.GET("/jobs/:id", middleware.RequireAnyPermission("job:view", "country:update", "app-user:export"), h.GetJob)
	protected.POST("/jobs/:id/cancel", middleware.RequirePermission("job:cancel"), h.CancelJob)
	protected.GET("/jobs/:id/artifact", middleware.RequireAnyPermission("job:view", "app-user:export"), h.DownloadJobArtifact)
	protected.POST("/exports/users", middleware.RequirePermission("export:create"), h.CreateUserExportJob)
}
