package repository

import (
	"context"

	"haixun-backend/internal/model/scan_post/domain/entity"
)

type ListFilter struct {
	BrandID       string
	Priority      string
	ProductFitMin int
	Recent7dOnly  bool
	Limit         int
}

type PersonaListFilter struct {
	PersonaID string
	Flow      string
	Limit     int
}

type Repository interface {
	EnsureIndexes(ctx context.Context) error
	ReplaceForScan(ctx context.Context, tenantID, ownerUID, brandID, scanJobID string, posts []entity.ScanPost) error
	ReplaceForViralScan(ctx context.Context, tenantID, ownerUID, personaID, scanJobID string, posts []entity.ScanPost) error
	Get(ctx context.Context, tenantID, ownerUID, brandID, postID string) (*entity.ScanPost, error)
	GetForPersona(ctx context.Context, tenantID, ownerUID, personaID, postID string) (*entity.ScanPost, error)
	UpdateOutreach(ctx context.Context, tenantID, ownerUID, brandID, postID string, patch entity.OutreachPatch) (*entity.ScanPost, error)
	List(ctx context.Context, tenantID, ownerUID string, filter ListFilter) ([]entity.ScanPost, error)
	ListForPersona(ctx context.Context, tenantID, ownerUID string, filter PersonaListFilter) ([]entity.ScanPost, error)
	CountByBrand(ctx context.Context, tenantID, ownerUID, brandID string) (int, error)
}
