package router

import (
	"fonchain-fiee/pkg/middleware"
	"fonchain-fiee/pkg/service"
	"fonchain-fiee/pkg/service/bundle"

	"github.com/gin-gonic/gin"
)

func BundleOrderRouter(r *gin.RouterGroup) {

	r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook)
	r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调
	r.POST("/home-page/roll", bundle.HomePageRoll)
	bundleOrderRoute := r.Group("bundle-order")
	bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
	bundleOrderWebRoute := r.Group("bundle-order")
	bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))

	// 套餐
	{
		bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
		{
			bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
			bundleOrderClientWebRoute.POST("bundle-order-list-V2", bundle.OrderRecordsListV2)
			bundleOrderClientWebRoute.POST("reconciliation-list", bundle.GetReconciliationList)
		}
		bundleOrderClientAppRoute := bundleOrderRoute.Group("common/app")
		{
			bundleOrderClientAppRoute.POST("bundle-order-list", bundle.OrderRecordsList)
		}

		//bundleOrderWebRoute := bundleOrderRoute.Group("web")
		{
			bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
			bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfoOss)
		}

		bundleOrderAppRoute := bundleOrderRoute.Group("app")
		{
			bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
			bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
			bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
			bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail)

			// stripe
			//bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateStripeCheckoutSession)	// stripe支付
			bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateAntomPay) // Antom国际支付
		}

	}

}
