package importrepo

import (
	"context"

	"github.com/tidbcloud/dataflow-service/app/repo/entity"
	"github.com/tidbcloud/pkgv2/bizerr"
)

type (
	// ImportFilterOp is the operation function that can be used to alter the query filter for imports.
	ImportFilterOp func(qs entity.ImportQuerySet) entity.ImportQuerySet
)

// ImportRepo is the interface that wraps basic methods manipulating import metadata.
type ImportRepo interface {
	// Load returns the import with the given id.
	Load(ctx context.Context, id uint64) (*entity.Import, bizerr.BizError)
	// List returns all imports that match a specified filter.
	List(ctx context.Context, ops ...ImportFilterOp) ([]entity.Import, bizerr.BizError)
	// Count returns the number of imports that match a specified filter.
	Count(ctx context.Context, ops ...ImportFilterOp) (int64, bizerr.BizError)
}
