package adjustments

import (
	m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
	controller "gitlab.com/mbugroup/lti-api.git/internal/modules/inventory/adjustments/controllers"
	adjustment "gitlab.com/mbugroup/lti-api.git/internal/modules/inventory/adjustments/services"
	user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"

	"github.com/gofiber/fiber/v2"
)

func AdjustmentRoutes(v1 fiber.Router, u user.UserService, s adjustment.AdjustmentService) {
	ctrl := controller.NewAdjustmentController(s)

	route := v1.Group("/adjustments")
	route.Use(m.Auth(u))
	// Standard CRUD routes following master data pattern
	route.Get("/", m.RequirePermissions(m.P_AdjustmentGetAll), ctrl.AdjustmentHistory) // Get all with pagination and filters
	route.Post("/", m.RequirePermissions(m.P_AdjustmentCreate), ctrl.Adjustment)       // Create adjustment
	route.Get("/:id", m.RequirePermissions(m.P_AdjustmentGetOne), ctrl.GetOne)
	route.Delete("/:id", m.RequirePermissions(m.P_AdjustmentDeleteOne), ctrl.DeleteOne)

}
