package convert

import (
	"strings"

	coresvcmodel "github.com/tidbcloud/core-svc/model"
)

// isSpecialSpu： due to historical reasons, pd is associated with two tier 8C16G and c5.2xlarge in the same tierunit in prod env. Only one tier can be reserved
func isSpecialSpu(spu *coresvcmodel.Tier) bool {
	return spu.ID.Uint64() == uint64(30001) && spu.TierKey == "c5.2xlarge:DEPLOY_TYPE_DEDICATED:COMPONENT_TYPE_PD"
}

// isSpecialSku： due to historical reasons, pd is associated with two tier 8C16G and c5.2xlarge in the same tierunit in prod env. Only one tier can be reserved
func isSpecialSku(skuKey string) bool {
	return skuKey == "aws:pd:c5.2xlarge:gp3:3000:125"
}

func isLocalStorage(skuKey string) bool {
	if (strings.Contains(skuKey, "tikv") || strings.Contains(skuKey, "tiflash")) &&
		strings.Contains(skuKey, "local-storage:0:0") {
		return true
	}

	return false
}
