package adminbenefactorhandler

import (
	"git.gocasts.ir/ebhomengo/niki/delivery/http_server/middleware"
	"git.gocasts.ir/ebhomengo/niki/entity"
	"github.com/labstack/echo/v4"
)

func (h Handler) SetRoutes(e *echo.Echo) {
	r := e.Group("/admins/benefactors")

	r.Use(middleware.Auth(h.authSvc))

	r.GET("", h.GetAllBenefactor, middleware.AdminAuthorization(h.authorizeSvc, entity.AdminBenefactorGetAllPermission))
	r.GET("/:id", h.GetBenefactor, middleware.AdminAuthorization(h.authorizeSvc, entity.AdminBenefactorGetPermission))
	r.PUT("/:id", h.Update, middleware.AdminAuthorization(h.authorizeSvc, entity.AdminBenefactorUpdatePermission))
	r.PUT("/:id/status", h.UpdateStatus, middleware.AdminAuthorization(h.authorizeSvc, entity.AdminBenefactorUpdateStatusPermission))
}
