package productionstandards

import (
	m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
	controller "gitlab.com/mbugroup/lti-api.git/internal/modules/master/production-standards/controllers"
	productionStandard "gitlab.com/mbugroup/lti-api.git/internal/modules/master/production-standards/services"
	user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"

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

func ProductionStandardRoutes(v1 fiber.Router, u user.UserService, s productionStandard.ProductionStandardService) {
	ctrl := controller.NewProductionStandardController(s)

	route := v1.Group("/production-standards")
	route.Use(m.Auth(u))

	route.Get("/", m.RequirePermissions(m.P_Production_Standart_GetAll), ctrl.GetAll)
	route.Post("/", m.RequirePermissions(m.P_Production_Standart_CreateOne), ctrl.CreateOne)
	route.Get("/:id", m.RequirePermissions(m.P_Production_Standart_GetOne), ctrl.GetOne)
	route.Patch("/:id", m.RequirePermissions(m.P_Production_Standart_UpdateOne), ctrl.UpdateOne)
	route.Delete("/:id", m.RequirePermissions(m.P_Production_Standart_DeleteOne), ctrl.DeleteOne)
}
