package repository

import (
	"context"

	libkg "haixun-backend/internal/library/knowledge"
	"haixun-backend/internal/model/knowledge_graph/domain/entity"
)

type Repository interface {
	EnsureIndexes(ctx context.Context) error
	UpsertByBrand(ctx context.Context, graph *entity.Graph) (*entity.Graph, error)
	UpsertByTopic(ctx context.Context, graph *entity.Graph) (*entity.Graph, error)
	FindByBrand(ctx context.Context, tenantID, ownerUID, brandID string) (*entity.Graph, error)
	FindByTopic(ctx context.Context, tenantID, ownerUID, topicID string) (*entity.Graph, error)
	UpdateNodes(ctx context.Context, tenantID, ownerUID, brandID string, nodes []libkg.Node, painTagCount int) (*entity.Graph, error)
	UpdateNodesByTopic(ctx context.Context, tenantID, ownerUID, topicID string, nodes []libkg.Node, painTagCount int) (*entity.Graph, error)
	AttachTopicID(ctx context.Context, tenantID, ownerUID, brandID, topicID string) error
}
