package api

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

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

func registerHEMSOperationRoutes(v1 fiber.Router, h *handlers.HEMSOperationHandler, authMiddleware fiber.Handler, authSvc *service.AuthService) {
	r := v1.Group("/hems-operation", authMiddleware)
	r.Post("/create", middleware.PermissionRequired(authSvc, "hems_operation.create"), h.Create)
	r.Get("/get-all", middleware.PermissionRequired(authSvc, "hems_operation.read"), h.List)
	r.Get("/get-all/dt", middleware.PermissionRequired(authSvc, "hems_operation.read"), h.ListDatatable)
	r.Get("/get/:uuid", middleware.PermissionRequired(authSvc, "hems_operation.read"), h.Get)
	r.Patch("/update/:uuid", middleware.PermissionRequired(authSvc, "hems_operation.update"), h.Update)
	r.Delete("/delete/:uuid", middleware.PermissionRequired(authSvc, "hems_operation.delete"), h.Delete)
}
