from fastapi.testclient import TestClient

from src.main import app


def test_get_ai_agent_telegram_receipt_approval_package_api():
    client = TestClient(app)
    response = client.get("/api/v1/agents/agent-telegram-receipt-approval-package")

    assert response.status_code == 200
    data = response.json()
    assert data["schema_version"] == "ai_agent_telegram_receipt_approval_package_v1"
    assert data["program_status"]["current_task_id"] == "P2-403E"
    assert data["program_status"]["next_task_id"] == "P2-403F"
    assert data["telegram_truth"]["telegram_send_allowed"] is False
    assert data["telegram_truth"]["gateway_queue_write_allowed"] is False
    assert data["rollups"]["live_receipt_count_total"] == 0
