"""Pytest configuration and fixtures."""

import pytest
from httpx import Response


@pytest.fixture
def mock_api_key() -> str:
    """Return a mock API key for testing."""
    return "sk_live_test_key_12345678901234567890123456789012"


@pytest.fixture
def mock_jwt_token() -> str:
    """Return a mock JWT token for testing."""
    return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test.signature"


@pytest.fixture
def mock_org_id() -> str:
    """Return a mock organization ID."""
    return "org_123e4567-e89b-12d3-a456-426614174000"


@pytest.fixture
def mock_project_id() -> str:
    """Return a mock project ID."""
    return "proj_123e4567-e89b-12d3-a456-426614174000"


@pytest.fixture
def mock_user_id() -> str:
    """Return a mock user ID."""
    return "user_123e4567-e89b-12d3-a456-426614174000"


@pytest.fixture
def mock_memory_response() -> dict:
    """Return a mock memory write response."""
    return {
        "id": "mem_abc123",
        "root_id": None,
        "version": 1,
        "is_current": True,
        "requires_review": False,
        "type": "note",
    }


@pytest.fixture
def mock_search_response() -> dict:
    """Return a mock memory search response."""
    return {
        "items": [
            {
                "id": "mem_abc123",
                "project_id": "proj_123",
                "type": "fact",
                "title": "Test Memory",
                "content": "User prefers dark mode",
                "tags": ["ui", "preferences"],
                "sources": [],
                "confidence": 0.9,
                "requires_review": False,
                "root_id": None,
                "version": 1,
                "is_current": True,
                "created_by": "user_123",
                "created_at": "2026-01-02T10:00:00Z",
                "updated_at": "2026-01-02T10:00:00Z",
                "similarity": 0.95,
            }
        ]
    }


@pytest.fixture
def mock_auth_response() -> dict:
    """Return a mock authentication response."""
    return {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test.signature",
        "user": {
            "id": "user_123",
            "email": "test@example.com",
            "name": "Test User",
            "org_id": "org_123",
        },
    }
