package repports

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

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

func RepportRoutes(v1 fiber.Router, u user.UserService, s repport.RepportService) {
	ctrl := controller.NewRepportController(s)

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

	route.Get("/expense", m.RequirePermissions(m.P_ReportExpenseGetAll), ctrl.GetExpense)
	route.Get("/expense/depreciation", ctrl.GetExpenseDepreciation)
	route.Get("/expense/depreciation/manual-inputs", ctrl.GetExpenseDepreciationManualInputs)
	route.Put("/expense/depreciation/manual-inputs", ctrl.UpsertExpenseDepreciationManualInput)
	route.Get("/marketing", m.RequirePermissions(m.P_ReportDeliveryGetAll), ctrl.GetMarketing)
	route.Get("/purchase-supplier", m.RequirePermissions(m.P_ReportPurchaseSupplierGetAll), ctrl.GetPurchaseSupplier)
	route.Get("/debt-supplier", m.RequirePermissions(m.P_ReportDebtSupplierGetAll), ctrl.GetDebtSupplier)
	route.Get("/hpp-per-kandang", m.RequirePermissions(m.P_ReportHppPerKandangGetAll), ctrl.GetHppPerKandang)
	route.Get("/hpp-v2-breakdown", m.RequirePermissions(m.P_ReportHppPerKandangGetAll), ctrl.GetHppV2Breakdown)
	route.Get("/production-result/:idProjectFlockKandang", m.RequirePermissions(m.P_ReportProductionResultGetAll), ctrl.GetProductionResult)
	route.Get("/customer-payment", m.RequirePermissions(m.P_ReportCustomerPaymentGetAll), ctrl.GetCustomerPayment)
}
