package admin

import (
	"github.com/gin-gonic/gin"
	v1 "server/api/v1"
	"server/middleware"
)

type ExpensesRouter struct{}

func (s *DepartmentRouter) InitExpensesRouter(Router *gin.RouterGroup) {
	expensesRouter := Router.Group("expenses").Use(middleware.OperationRecord())
	expensesRouterWithoutRecord := Router.Group("expenses")

	expensesApi := v1.ApiGroupApp.AdminApiGroup.ExpensesApi
	{
		expensesRouter.POST("createExpenses", expensesApi.CreateExpenses)
		expensesRouter.PUT("updateExpenses", expensesApi.UpdateExpenses)
		expensesRouter.DELETE("deleteExpenses", expensesApi.DeleteExpenses)
	}
	{
		expensesRouterWithoutRecord.POST("queryExpensesList", expensesApi.QueryExpensesList)
		expensesRouterWithoutRecord.POST("queryExpensesSumByPeople", expensesApi.QueryExpensesSumByPeople)
		expensesRouterWithoutRecord.GET("querySurplus", expensesApi.QuerySurplus)
	}
}
