package repository

import (
	"backend/pkg/permission/domain/entity"
	"context"

	mongodriver "go.mongodb.org/mongo-driver/v2/mongo"
)

// PermissionRepository 權限 Repository 介面
type PermissionRepository interface {
	// FindOne 取得單一權限
	FindOne(ctx context.Context, id string) (*entity.Permission, error)
	// FindByName 根據名稱取得權限
	FindByName(ctx context.Context, name string) (*entity.Permission, error)
	// GetByNames 批量根據名稱取得權限
	GetByNames(ctx context.Context, names []string) ([]*entity.Permission, error)
	// FindByHTTP 根據 HTTP Path 和 Method 取得權限
	FindByHTTP(ctx context.Context, path, method string) (*entity.Permission, error)
	// List 列出所有權限
	List(ctx context.Context, filter PermissionFilter) ([]*entity.Permission, error)
	// ListActive 列出所有啟用的權限 (常用，可快取)
	ListActive(ctx context.Context) ([]*entity.Permission, error)
	// GetChildren 取得子權限
	GetChildren(ctx context.Context, parentID int64) ([]*entity.Permission, error)
	Index20251009001UP(ctx context.Context) (*mongodriver.Cursor, error)
}
