package cluster

import (
	"context"

	"github.com/tidbcloud/tidb-management-service/nextgen-global-service/domain/entity"
	"github.com/tidbcloud/tidb-management-service/utilities/bizerr"
)

type Filter struct {
	CloudProviderNames []entity.CloudProviderName
	RegionNames        []entity.RegionName
	LogicalRegionNames []string
	States             []entity.State
	ExcludeStates      []entity.State
	OrganizationIds    []uint64
	ClusterIds         []uint64
	SharedPoolIds      []uint64
	ShowDeleted        bool
	ServicePlans       []entity.ServicePlan
}

//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -package=mock_$GOPACKAGE -destination=./mock_$GOPACKAGE/mock_$GOFILE
type Repo interface {
	Create(ctx context.Context, cluster *entity.Cluster) bizerr.BizError
	Save(ctx context.Context, cluster *entity.Cluster) bizerr.BizError
	Delete(ctx context.Context, cluster *entity.Cluster) bizerr.BizError
	Get(ctx context.Context, clusterId uint64, showDeleted bool) (*entity.Cluster, bizerr.BizError)
	Query(ctx context.Context, filter *Filter) ([]*entity.Cluster, bizerr.BizError)
	CountLiveBySharedPoolIDs(ctx context.Context, sharedPoolIDs []uint64) (map[uint64]int64, bizerr.BizError)
	CountBySharedPoolID(ctx context.Context, sharedPoolId uint64) (int64, bizerr.BizError)
	SetEncryptedRootPassword(ctx context.Context, clusterId uint64, rootPassword string) bizerr.BizError
	GetEncryptedRootPassword(ctx context.Context, clusterId uint64) (string, bizerr.BizError)
	UpdateProjectId(ctx context.Context, clusterId, projectId uint64) bizerr.BizError
}
