package api

import (
	"github.com/gofiber/fiber/v2"

	"wucher/internal/service"
	"wucher/internal/transport/http/handlers"
	"wucher/internal/transport/http/middleware"
)

func registerLandRoutes(v1 fiber.Router, landHandler *handlers.LandHandler, authMiddleware fiber.Handler, authSvc *service.AuthService) {
	land := v1.Group("/land", authMiddleware)
	land.Post("/create", middleware.PermissionRequired(authSvc, "country.create"), landHandler.Create)
	land.Get("/get-all", middleware.PermissionRequired(authSvc, "country.read"), landHandler.List)
	land.Get("/get-all/dt", middleware.PermissionRequired(authSvc, "country.read"), landHandler.ListDatatable)
	land.Patch("/update/:id", middleware.PermissionRequired(authSvc, "country.update"), landHandler.Update)
	land.Delete("/delete/:id", middleware.PermissionRequired(authSvc, "country.delete"), landHandler.Delete)
}
