"""pytest configuration and fixtures for ingress-recipient tests."""

from datetime import UTC, datetime
from uuid import uuid4

import pytest


@pytest.fixture
def valid_metadata():
    """Return valid RecipientMetadata data."""
    return {
        "ingress_timestamp": datetime.now(UTC),
    }


@pytest.fixture
def valid_metadata_with_optionals():
    """Return valid RecipientMetadata data with all optional fields."""
    return {
        "source_ip": "192.168.1.100",
        "ingress_timestamp": datetime.now(UTC),
        "transformations_applied": ["normalize", "enrich"],
    }


@pytest.fixture
def valid_recipient_data():
    """Return valid RecipientData."""
    return {
        "channel_id": "ch_maritime_telemetry",
        "tenant_id": uuid4(),
        "timestamp": datetime.now(UTC),
        "data": {
            "vessel_id": "v_12345",
            "latitude": 59.9139,
            "longitude": 10.7522,
            "speed": 15.3,
        },
        "metadata": {
            "ingress_timestamp": datetime.now(UTC),
            "transformations_applied": ["normalize"],
        },
    }


@pytest.fixture
def valid_recipient_data_dict():
    """Return valid RecipientData as dict with ISO strings."""
    tenant_id = uuid4()
    now = datetime.now(UTC)

    return {
        "channel_id": "ch_maritime_telemetry",
        "tenant_id": str(tenant_id),
        "timestamp": now.isoformat(),
        "data": {
            "vessel_id": "v_12345",
            "latitude": 59.9139,
            "longitude": 10.7522,
            "speed": 15.3,
        },
        "metadata": {
            "ingress_timestamp": now.isoformat(),
            "transformations_applied": ["normalize"],
        },
    }
