package admin

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

type FinanceRouter struct{}

func (s *ProjectRouter) InitFinanceRouter(Router *gin.RouterGroup) {
	financeRouter := Router.Group("finance").Use(middleware.OperationRecord())
	financeRouterWithoutRecord := Router.Group("finance")
	financeApi := v1.ApiGroupApp.AdminApiGroup.FinanceApi
	{
		financeRouter.POST("createDailyExpenses", financeApi.CreateDailyExpenses)
		financeRouter.POST("createExpensesGenre", financeApi.CreateExpensesGenre)
		financeRouter.POST("createProjectFeeGenre", financeApi.CreateProjectFeeGenre)
		financeRouter.POST("createBorrowing", financeApi.CreateBorrowing)
		financeRouter.POST("createDailyFile", financeApi.CreateDailyFile)

		financeRouter.PUT("updateDailyExpenses", financeApi.UpdateDailyExpenses)
		financeRouter.PUT("updateExpensesGenre", financeApi.UpdateExpensesGenre)
		financeRouter.PUT("updateProjectFeeGenre", financeApi.UpdateProjectFeeGenre)
		financeRouter.PUT("updateBorrowing", financeApi.UpdateBorrowing)

		financeRouter.DELETE("deleteDailyExpenses", financeApi.DeleteDailyExpenses)
		financeRouter.DELETE("deleteExpensesGenre", financeApi.DeleteExpensesGenre)
		financeRouter.DELETE("deleteProjectFeeGenre", financeApi.DeleteProjectFeeGenre)
		financeRouter.DELETE("deleteBorrowing", financeApi.DeleteBorrowing)
		financeRouter.DELETE("deleteDailyFile", financeApi.DeleteDailyFile)
	}
	{
		financeRouterWithoutRecord.POST("queryDailyExpensesList", financeApi.QueryDailyExpensesList)
		financeRouterWithoutRecord.GET("queryDailyExpenses", financeApi.QueryDailyExpenses)
		financeRouterWithoutRecord.GET("queryExpensesGenre", financeApi.QueryExpensesGenre)
		financeRouterWithoutRecord.GET("queryProjectFeeGenre", financeApi.QueryProjectFeeGenre)
		financeRouterWithoutRecord.POST("queryBorrowingList", financeApi.QueryBorrowingList)
		financeRouterWithoutRecord.GET("queryBorrowing", financeApi.QueryBorrowing)
		financeRouterWithoutRecord.POST("queryDailyFileList", financeApi.QueryDailyFileList)
		financeRouterWithoutRecord.GET("queryProjectFinance", financeApi.QueryProjectFinance)
		financeRouterWithoutRecord.GET("queryReserveBalance", financeApi.QueryReserveBalance)
	}
}
