mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
persist EPC data
This commit is contained in:
parent
dc830fea63
commit
8ee53a3a95
2 changed files with 8 additions and 4 deletions
|
|
@ -46,6 +46,7 @@ from repositories.geospatial.geospatial_s3_repository import (
|
|||
GeospatialS3Repository,
|
||||
ParquetReader,
|
||||
)
|
||||
from repositories.epc.epc_postgres_repository import EpcPostgresRepository
|
||||
from repositories.plan.plan_postgres_repository import PlanPostgresRepository
|
||||
from repositories.product.product_postgres_repository import ProductPostgresRepository
|
||||
from repositories.property.landlord_override_overlays import overlays_from
|
||||
|
|
@ -194,6 +195,9 @@ def handler(body: dict[str, Any], context: Any) -> None:
|
|||
measure_types = ", ".join(m.measure_type for m in plan.measures) or "none"
|
||||
logger.info(f"[dry_run] measures=[{measure_types}] — skipping DB write")
|
||||
return
|
||||
EpcPostgresRepository(session).save(
|
||||
epc, property_id=property_id, portfolio_id=portfolio_id
|
||||
)
|
||||
PlanPostgresRepository(session).save(
|
||||
plan,
|
||||
property_id=property_id,
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ payload = {
|
|||
{
|
||||
"body": json.dumps(
|
||||
{
|
||||
"property_id": 709634,
|
||||
"portfolio_id": 785,
|
||||
"scenario_id": 1266,
|
||||
"property_id": 709774,
|
||||
"portfolio_id": 796,
|
||||
"scenario_id": 1268,
|
||||
"no_solar": False,
|
||||
"dry_run": True,
|
||||
"dry_run": False,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue