package repository

import (
	"context"

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

type ListFilter struct {
	TenantID   string
	OwnerUID   string
	AccountID  string
	SourceType string
	Tag        string
	Page       int
	PageSize   int
}

type ListResult struct {
	Items []entity.ContentFormula
	Total int64
}

type Repository interface {
	EnsureIndexes(ctx context.Context) error
	Create(ctx context.Context, formula *entity.ContentFormula) error
	Get(ctx context.Context, tenantID, ownerUID, accountID, formulaID string) (*entity.ContentFormula, error)
	Update(ctx context.Context, tenantID, ownerUID, accountID, formulaID string, patch map[string]interface{}) (*entity.ContentFormula, error)
	Delete(ctx context.Context, tenantID, ownerUID, accountID, formulaID string) error
	List(ctx context.Context, filter ListFilter) (*ListResult, error)
}
