package constant

const (
	SpendLimitRangeTypeCluster = "cluster"
	SpendLimitRangeTypeProject = "project"
	SpendLimitRangeTypeTenant  = "tenant"

	SpendLimitEventStatusFit        = "fit"
	SpendLimitEventStatusExcessive  = "excessive"
	SpendLimitEventStatusDeprecated = "deprecated"

	// use to set tidb pool policy at cluster creation or by hand,
	// the Spending Limit value will not be checked before setting the policy,
	// see service/cluster_svc/sync_tidbpool.go
	SpendLimitEventStatusHandy            = "handy" // deprecated, use cluster_create or modify_spend_limit
	SpendLimitEventStatusCreateCluster    = "create_cluster"
	SpendLimitEventStatusModifySpendLimit = "modify_spend_limit"

	SpendLimitBizType_ServerlessCluster = "serverless_cluster"

	// these new states below are used to handle credit control events.
	// On receiving "closig" event, put cluster into throttle mode immediately.
	// On receiving "recovered" envent, put cluster into corresponding mode based on current billing state.
	CreditControlEventStatusClosing   = "closing"
	CreditControlEventStatusRecovered = "recovered"
)

var SpendLimitValidStatuses = []string{
	SpendLimitEventStatusHandy,
	SpendLimitEventStatusCreateCluster,
	SpendLimitEventStatusModifySpendLimit,
	SpendLimitEventStatusFit,
	SpendLimitEventStatusExcessive,
	SpendLimitEventStatusDeprecated,
	CreditControlEventStatusClosing,
	CreditControlEventStatusRecovered,
}
