mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +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,
|
GeospatialS3Repository,
|
||||||
ParquetReader,
|
ParquetReader,
|
||||||
)
|
)
|
||||||
|
from repositories.epc.epc_postgres_repository import EpcPostgresRepository
|
||||||
from repositories.plan.plan_postgres_repository import PlanPostgresRepository
|
from repositories.plan.plan_postgres_repository import PlanPostgresRepository
|
||||||
from repositories.product.product_postgres_repository import ProductPostgresRepository
|
from repositories.product.product_postgres_repository import ProductPostgresRepository
|
||||||
from repositories.property.landlord_override_overlays import overlays_from
|
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"
|
measure_types = ", ".join(m.measure_type for m in plan.measures) or "none"
|
||||||
logger.info(f"[dry_run] measures=[{measure_types}] — skipping DB write")
|
logger.info(f"[dry_run] measures=[{measure_types}] — skipping DB write")
|
||||||
return
|
return
|
||||||
|
EpcPostgresRepository(session).save(
|
||||||
|
epc, property_id=property_id, portfolio_id=portfolio_id
|
||||||
|
)
|
||||||
PlanPostgresRepository(session).save(
|
PlanPostgresRepository(session).save(
|
||||||
plan,
|
plan,
|
||||||
property_id=property_id,
|
property_id=property_id,
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ payload = {
|
||||||
{
|
{
|
||||||
"body": json.dumps(
|
"body": json.dumps(
|
||||||
{
|
{
|
||||||
"property_id": 709634,
|
"property_id": 709774,
|
||||||
"portfolio_id": 785,
|
"portfolio_id": 796,
|
||||||
"scenario_id": 1266,
|
"scenario_id": 1268,
|
||||||
"no_solar": False,
|
"no_solar": False,
|
||||||
"dry_run": True,
|
"dry_run": False,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue