package api

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

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

func registerFleetStatusRoutes(v1 fiber.Router, h *handlers.FleetStatusHandler, authMiddleware fiber.Handler, authSvc *service.AuthService) {
	g := v1.Group("/fleet-status", authMiddleware)
	g.Post("/create", middleware.PermissionRequired(authSvc, "flight.create"), h.Create)
	g.Get("/get/:id", middleware.PermissionRequired(authSvc, "flight.read"), h.GetByID)
	g.Get("/get-by-helicopter/:helicopter_id", middleware.PermissionRequired(authSvc, "flight.read"), h.GetByHelicopterID)
	g.Get("/get-all", middleware.PermissionRequired(authSvc, "flight.read"), h.List)
	g.Get("/get-all/dt", middleware.PermissionRequired(authSvc, "flight.read"), h.ListDatatable)
	g.Get("/history/:helicopter_id", middleware.PermissionRequired(authSvc, "flight.read"), h.ListHistoryByHelicopter)
	g.Post("/mark-serviced/:id", middleware.PermissionRequired(authSvc, "flight.update"), h.MarkServiced)
	g.Patch("/update/:id", middleware.PermissionRequired(authSvc, "flight.update"), h.Update)
	g.Delete("/delete/:id", middleware.PermissionRequired(authSvc, "flight.delete"), h.Delete)
}
