package repository

import (
	"context"
	"haixun-backend/internal/model/crm_contact/domain/entity"
)

type ListFilter struct {
	BrandID string
	Status  string
	Tag     string
	Limit   int
	Offset  int
}

type Repository interface {
	EnsureIndexes(ctx context.Context) error
	Create(ctx context.Context, contact *entity.CRMContact) error
	Get(ctx context.Context, tenantID, ownerUID, contactID string) (*entity.CRMContact, error)
	GetByAuthor(ctx context.Context, tenantID, ownerUID, authorID string) (*entity.CRMContact, error)
	Update(ctx context.Context, tenantID, ownerUID, contactID string, patch map[string]interface{}) (*entity.CRMContact, error)
	Delete(ctx context.Context, tenantID, ownerUID, contactID string) error
	List(ctx context.Context, tenantID, ownerUID string, filter ListFilter) ([]entity.CRMContact, int, error)
	UpsertByAuthor(ctx context.Context, contact *entity.CRMContact) (*entity.CRMContact, error)
}
