package recordings

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

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

func RecordingRoutes(v1 fiber.Router, u user.UserService, s recording.RecordingService) {
	ctrl := controller.NewRecordingController(s)

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

	route.Get("/",m.RequirePermissions(m.P_RecordingGetAll), ctrl.GetAll)
	route.Get("/next-day",m.RequirePermissions(m.P_RecordingNextDay), ctrl.GetNextDay)
	route.Get("/:id",m.RequirePermissions(m.P_RecordingGetOne), ctrl.GetOne)
	route.Post("/",m.RequirePermissions(m.P_RecordingCreateOne), ctrl.CreateOne)
	route.Patch("/:id",m.RequirePermissions(m.P_RecordingUpdateOne), ctrl.UpdateOne)
	route.Delete("/:id",m.RequirePermissions(m.P_RecordingDeleteOne), ctrl.DeleteOne)
	route.Post("/approvals",m.RequirePermissions(m.P_RecordingApproval), ctrl.Approve)
}
