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.POST("createProjectFee", expensesApi.CreateProjectFee)
		expensesRouter.PUT("updateExpenses", expensesApi.UpdateExpenses)
		expensesRouter.PUT("updateProjectFee", expensesApi.UpdateProjectFee)
		expensesRouter.DELETE("deleteExpenses", expensesApi.DeleteExpenses)
		expensesRouter.DELETE("deleteProjectFee", expensesApi.DeleteProjectFee)
	}
	{
		expensesRouterWithoutRecord.POST("queryExpensesList", expensesApi.QueryExpensesList)
		expensesRouterWithoutRecord.POST("queryProjectFeeList", expensesApi.QueryProjectFeeList)
		expensesRouterWithoutRecord.POST("queryExpensesSumByPeople", expensesApi.QueryExpensesSumByPeople)
		expensesRouterWithoutRecord.GET("querySurplus", expensesApi.QuerySurplus)
		expensesRouterWithoutRecord.GET("queryProjectMonthFee", expensesApi.QueryProjectMonthFee)
		expensesRouterWithoutRecord.GET("queryMonthExpenses", expensesApi.QueryMonthExpenses)
	}
}
