Skip to content

Commit f0405ef

Browse files
committed
Move notify utilities, refactor health & add CSV
Refactor project layout: move notify-related modules from app/api/resend to app/utils/notify (resend.py, send_email.py, and package init), and relocate the health endpoint from app/api/health.py to app/utils/health.py. Update app/api/root.py and app/api/routes.py to reflect the new import paths. Add LinkedInConnections.csv under app/api/prospects. Rename tests/test_llm.py to tests/test_prompt.py and apply related test updates (tests/test_routes.py). These changes separate API routes from utility implementations and add prospect data.
1 parent e15869b commit f0405ef

9 files changed

Lines changed: 1659 additions & 19 deletions

File tree

app/api/prospects/LinkedInConnections.csv

Lines changed: 1650 additions & 0 deletions
Large diffs are not rendered by default.

app/api/root.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ def root() -> dict:
2222
endpoints = [
2323
{"name": "health", "url": f"{base_url}/health"},
2424
{
25-
"name": "Orders",
25+
"name": "Orders°",
2626
"endpoints": [
2727
{"name": "list", "url": f"{base_url}/orders"},
2828
]
2929
},
3030
{
31-
"name": "prospects",
31+
"name": "Prospects°",
3232
"endpoints": [
3333
{"name": "list", "url": f"{base_url}/prospects"},
3434
]
3535
},
3636
{
37-
"name": "prompt",
37+
"name": "Prompt°",
3838
"endpoints": [
3939
{"name": "list", "url": f"{base_url}/prompt"},
4040
]
4141
},
42-
{"name": "docs", "url": f"{base_url}/docs"},
42+
{"name": "Docs", "url": f"{base_url}/docs"},
4343
]
4444
return {"meta": meta, "data": endpoints}

app/api/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
router = APIRouter()
77

88
from app.api.root import router as root_router
9-
from app.api.health import router as health_router
10-
from app.api.resend.resend import router as resend_router
9+
from app.utils.health import router as health_router
10+
from app.utils.notify.resend import router as resend_router
1111
from app.api.prompt.prompt import router as prompt_router
1212
from app.api.prospects.prospects import router as prospects_router
1313
from app.api.orders.orders import router as orders_router
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from app.utils.make_meta import make_meta
55
from fastapi import APIRouter, Query, Path, Body, HTTPException
66
from app.utils.db import get_db_connection
7-
from app.utils.send_email import send_email_resend
7+
from app.utils.notify.send_email import send_email_resend
88

99
router = APIRouter()
1010
base_url = os.getenv("BASE_URL", "http://localhost:8000")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_llm_real_api():
2929

3030
def test_llm_get_endpoint():
3131
api_key = os.getenv("PYTHON_KEY", "test")
32-
response = client.get("/llm", headers={"X-API-Key": api_key})
32+
response = client.get("/prompt", headers={"X-API-Key": api_key})
3333
assert response.status_code == 200
3434
data = response.json()
3535
assert "meta" in data
@@ -57,7 +57,7 @@ class MockGenAIClient:
5757

5858
api_key = os.getenv("PYTHON_KEY", "test")
5959
payload = {"prompt": "Test prompt"}
60-
response = client.post("/llm", json=payload, headers={"X-API-Key": api_key})
60+
response = client.post("/prompt", json=payload, headers={"X-API-Key": api_key})
6161
assert response.status_code == 200
6262
data = response.json()
6363
assert "meta" in data

tests/test_routes.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,5 @@ def test_health_returns_ok() -> None:
2121
assert response.status_code == 200
2222
assert response.json() == {"status": "ok"}
2323

24-
def test_unflag_all_prospects():
25-
"""POST /unflag-all should reset all flags to false and return success meta."""
26-
# First, flag some prospects (if needed) - skipping setup for brevity
27-
response = client.post("/unflag-all")
28-
assert response.status_code == 200
29-
json_data = response.json()
30-
# The meta dict uses 'severity' for status, not 'status'
31-
assert json_data["meta"].get("severity") == "success"
32-
# Accept any success message in the title
33-
assert json_data["meta"].get("title", "").endswith("unflagged.")
3424

3525

0 commit comments

Comments
 (0)