package routes

import (
	"github.com/gofiber/fiber/v2"

	"github.com/break/junhong_cmp_fiber/internal/handler/admin"
	"github.com/break/junhong_cmp_fiber/internal/model/dto"
	"github.com/break/junhong_cmp_fiber/pkg/openapi"
)

func registerShopPackageBatchAllocationRoutes(router fiber.Router, handler *admin.ShopPackageBatchAllocationHandler, doc *openapi.Generator, basePath string) {
	batchAllocations := router.Group("/shop-package-batch-allocations")
	groupPath := basePath + "/shop-package-batch-allocations"

	Register(batchAllocations, doc, groupPath, "POST", "", handler.BatchAllocate, RouteSpec{
		Summary: "批量分配套餐",
		Tags:    []string{"批量套餐分配"},
		Input:   new(dto.BatchAllocatePackagesRequest),
		Output:  new(dto.BatchAllocatePackagesResponse),
		Auth:    true,
	})

	Register(router, doc, basePath, "PATCH", "/shop-package-allocations/:id/expiry-base", handler.UpdateExpiryBase, RouteSpec{
		Summary: "修改套餐分配生效条件覆盖",
		Tags:    []string{"批量套餐分配"}, Input: new(dto.UpdateAllocationExpiryBaseParams),
		Output: new(dto.ShopPackageAllocationTermsResponse), Auth: true,
	})
}
