package router

import (
	"github.com/gin-gonic/gin"
	"go-admin/app/admin/apis/erpordermanage"
	"go-admin/app/admin/middleware"
	jwt "go-admin/pkg/jwtauth"
)

func registerErpOrderManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	r := v1.Group("/erp_order").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())

	r.POST("create", erpordermanage.ErpOrderCreate)                     // 创建订单
	r.POST("edit", erpordermanage.ErpOrderEdit)                         // 编辑订单
	r.POST("list", erpordermanage.ErpOrderList)                         // 查询订单列表
	r.POST("audit", erpordermanage.ErpOrderAudit)                       // 审核订单
	r.POST("delete", erpordermanage.ErpOrderDelete)                     // 删除订单
	r.POST("add_invoice", erpordermanage.ErpOrderAddInvoice)            // 开发票
	r.POST("pay", erpordermanage.ErpOrderPay)                           // 收款
	r.POST("query_pay_status", erpordermanage.ErpOrderQueryPayStatus)   // 查询收款状态
	r.POST("store_manage_data", erpordermanage.ErpOrderStoreManageData) // 查询门店经营数据
	r.POST("retail_margin", erpordermanage.ErpOrderRetailMargin)        // 查询商品零售毛利汇总
	r.POST("retail_detail", erpordermanage.ErpOrderRetailDetail)        // 查询零售明细
	r.POST("receipt_data", erpordermanage.ErpOrderReceiptData)          // 查询小票数据
	r.POST("show_all_data", erpordermanage.ErpOrderShowAllData)         // 展示所有订单
	r.POST("daily_report", erpordermanage.ErpOrderDailyReport)          // 经营日报表
	r.POST("sale_detail", erpordermanage.ErpOrderSaleDetail)            // 查询销售明细
	r.POST("import", erpordermanage.ErpOrderBatchImport)                // 批量导入零售数据

	r.POST("business/create", erpordermanage.CreateOrUpdateBusinessSummary) // 创建或更新每日经营数据
	r.POST("business/list", erpordermanage.ListBusinessSummary)             // 获取每日经营数据列表
	r.POST("business/summary_data", erpordermanage.ListStoreManageData)     // 查询门店经营汇总数据
}
