package bss

import (
	"github.com/tidbcloud/qa-PlatformAPIAuto/webScene/br/aws"
	"github.com/tidbcloud/qa-PlatformAPIAuto/webScene/cbp/iam"
	"github.com/tidbcloud/qa-gourd/ProductService"
	"github.com/tidbcloud/qa-gourd/util"
)

func RunPoCScene(w *ProductService.WebRequestInfo, UrlInfoMap map[string]ProductService.UrlInfo, reporter *util.AllureReporter) {
	bt := &BillingTest{}
	bt.Init(w, UrlInfoMap, reporter)
	bt.CheckPoCScene()
}

// This case can not run in parallel since we have to switch token a lot.
func (bt *BillingTest) CheckPoCScene() {
	// SignUp tenant
	bt.Reporter.StepReport("A-SignUpTenant", func() {
		iam.RunSignUpTest(bt.w, bt.URLInfoMap, bt.Reporter)
		bt.SetbtTestUserEnv(bt.w.User.TenantEmail, bt.w.User.OrgId, bt.w.User.ProjectId)
	})

	// poc tenant check
	bt.Reporter.StepReport("B-PoCRestrictAndLifeCycle", func() {
		bt.Reporter.StepReport("B - 1 - EnablePoC - CheckPoCRestrict", func() {
			bt.CheckCreditsScene()
		})
		bt.Reporter.StepReport("B - 2 - PoCClosing - PoCLifeCycleCheck(see final backup cases)", func() {
			aws.ExecuteFinalBackupCase(bt.Reporter.T, bt.w)
		})
	})

	// // delete org
	// bt.Reporter.StepReport("G-DeleteTenant", func() {
	// })
}
