add localhandler for testing and update requirements

This commit is contained in:
Daniel Roth 2026-05-12 13:51:46 +00:00
parent a477561bbc
commit a672c0dea0
3 changed files with 43 additions and 0 deletions

View file

@ -5,3 +5,7 @@ sqlmodel
psycopg2-binary==2.9.10 psycopg2-binary==2.9.10
pydantic-settings==2.6.0 pydantic-settings==2.6.0
boto3==1.35.44 boto3==1.35.44
pytz==2024.2
pandas==2.2.2
numpy==2.1.2

View file

@ -0,0 +1,11 @@
version: "3.9"
services:
ecmk-fetcher-lambda:
build:
context: ../../../
dockerfile: backend/magic_plan/handler/Dockerfile
ports:
- "9000:8080"
env_file:
- ../../../.env

View file

@ -0,0 +1,28 @@
#!/usr/bin/env python3
import json
import requests
HOST = "localhost"
PORT = "9000"
LAMBDA_URL = f"http://{HOST}:{PORT}/2015-03-31/functions/function/invocations"
payload = {
"Records": [
{
"body": json.dumps(
# {
# "address": "2 Laburnum Way, Rombley, BR2 8BZ | Retrofit Assessment",
# "hubspot_deal_id": "500262906061",
# }
{"address": "33 Wallaby Way, Sydney", "hubspot_deal_id": "123456789"}
)
}
]
}
response = requests.post(LAMBDA_URL, json=payload)
print("Status code:", response.status_code)
print("Response:")
print(response.text)