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)

	bundleOrderRoute := r.Group("bundle-order")
	bundleOrderRoute.Use(middleware.CheckLogin(service.AccountProvider))

	// 套餐
	{
		bundleOrderClientRoute := bundleOrderRoute.Group("common")
		{
			bundleOrderClientRoute.POST("bundle-order-list", bundle.OrderRecordsList)
		}

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

			// stripe
			bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateStripeCheckoutSession)
		}

	}

}
