Model/tests
Khalim Conn-Kowlessar a820274d4f ARA export: newest plan per (property, scenario) + uprn-matched Effective-EPC
Two fixes so a multi-scenario export over a PasHub-fetched portfolio is correct:

1. Plan selection: take the NEWEST plan per (property, scenario), not the
   is_default one. is_default is one-per-property (not per-scenario), so it
   cannot scope a multi-scenario export — a property's default sits under a
   single scenario, leaving every other scenario with zero rows. _ROWS_SQL and
   _MEASURES_SQL now DISTINCT ON (property_id) ORDER BY created_at DESC, id DESC.

2. Effective-EPC descriptive block: match the header facts + current performance
   by UPRN (the latest epc_property for the source), because the PasHub re-fetch
   lands records with property_id = NULL — a property_id join silently fell back
   to a stale gov-EPC cert (wrong 2013-2025 lodgement dates / int property_type)
   or nothing. Lodgement date coalesces registration -> completion -> inspection
   (PasHub surveys carry only inspection_date). Descriptive prose elements stay
   on the property_id gov-EPC fallback (a survey lodges structured fields, not
   gov-EPC prose).

Result on portfolio 838 / scenarios 1303+1304: both sheets populate 205 rows;
property_type text on 204/205; lodgement dates 2026 on 200/205. Repository tests
updated (uprn fixtures, newest-plan selection + a newest-wins case); 22 export
tests pass, pyright clean.
2026-07-16 01:26:32 +00:00
..
abri Surface both canceljob failure shapes as verbatim rejections 🟥 2026-07-07 15:33:16 +00:00
applications Add the scenario export route, worker handler and SQS trigger 🟩 2026-07-14 09:36:14 +00:00
backend Resolve export property ids with explicit ids overriding filters 🟥 2026-07-14 09:32:14 +00:00
datatypes Map SAP-Schema-15.0's "Main building" identifier to MAIN 2026-07-10 15:03:28 +00:00
domain Carry Property identity and Effective-EPC fields onto the export row 🟥 2026-07-13 23:15:18 +00:00
e2e Prove prediction resolves landlord overrides to a real cohort match end-to-end 🟩 2026-06-16 15:20:49 +00:00
fixtures Expired-pairs integration gate: frozen single-file corpus + ratcheting floors 🟩 2026-07-06 13:05:18 +00:00
harness The multi-measure trigger fixture is a cert the sized ASHP alone cannot clear 🟩 2026-07-03 12:25:03 +00:00
infrastructure Brand the export header band and freeze the header row 🟥 2026-07-14 09:22:09 +00:00
lambdas new application to trigger e2e for a single property and scenario 2026-06-22 12:54:53 +00:00
magic_plan Mapper reads new 'Total Trickle Vent Effective Area' label 🟥 2026-06-30 12:56:54 +00:00
orchestration Record a failure when the selection yields no export rows 🟥 2026-07-14 09:29:28 +00:00
repositories ARA export: newest plan per (property, scenario) + uprn-matched Effective-EPC 2026-07-16 01:26:32 +00:00
scripts The historic roof description conditions the cohort by form family 🟩 2026-07-06 12:05:56 +00:00
utilities abri_api not abri 2026-07-07 14:40:33 +00:00
utils SharePoint 404s raise ResourceNotFoundError without error-level logging 🟩 2026-07-03 12:26:33 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
conftest.py Audit generator populates XLSX, uploads to S3, and records UploadedFile row 🟪 2026-06-09 12:05:55 +00:00
test_lambda_packaging.py better smoke tests to check what is failign 2026-06-17 11:53:33 +00:00