package chickins

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

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

func ChickinRoutes(v1 fiber.Router, u user.UserService, s chickin.ChickinService) {
	ctrl := controller.NewChickinController(s)

	route := v1.Group("/chickins")
	route.Use(m.Auth(u))

	// route.Get("/", ctrl.GetAll)
	route.Post("/",m.RequirePermissions(m.P_ChickinsCreateOne), ctrl.CreateOne)
	route.Get("/:id",m.RequirePermissions(m.P_ChickinsGetOne), ctrl.GetOne)
	// route.Patch("/:id", ctrl.UpdateOne)
	route.Delete("/:id", ctrl.DeleteOne)
	route.Post("/approvals",m.RequirePermissions(m.P_ChickinsApproval), ctrl.Approval)
}
