fix local invoker

This commit is contained in:
Daniel Roth 2026-05-12 14:13:12 +00:00
parent 3df726937e
commit 04df924146
2 changed files with 5 additions and 3 deletions

View file

@ -20,7 +20,9 @@ def handler(body: dict[str, Any], context: Any) -> str:
api_key=settings.MAGICPLAN_API_KEY,
)
# TODO: read s3_bucket from env var so staging/prod use the correct bucket
plan: Plan = MagicPlanService(client, s3_bucket="retrofit-energy-assessments-dev").run(payload)
plan: Plan = MagicPlanService(
client, s3_bucket="retrofit-energy-assessments-dev"
).run(payload)
logger.info("Saved MagicPlan plan uid=%s", plan.uid)
return plan.uid
@ -30,7 +32,6 @@ if __name__ == "__main__":
"Records": [
{
"body": '{"address": "2 Laburnum Way Bromley BR2 8BZ", "hubspot_deal_id": "local-test-deal"}',
"messageId": "local-test",
}
]
}

View file

@ -10,13 +10,14 @@ LAMBDA_URL = f"http://{HOST}:{PORT}/2015-03-31/functions/function/invocations"
payload = {
"Records": [
{
"messageId": "test-message-id",
"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"}
)
),
}
]
}