The lift-and-shift moved the handler to applications/condition/handler.py and
split the module across domain/infrastructure/repositories/applications, but the
Dockerfile still COPYed backend/condition/ and ran the old CMD path. Update the
COPYs to the handler's real import closure (the DDD dirs + the legacy backend
Base/db_session/settings bridges) and the CMD to applications/condition/handler.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Calico Asset References don't match our landlord_property_id, so the runner now
resolves UPRNs from the address-matched CSV (UprnLookupS3) uploaded to S3, not
the property-table PropertyUprnLookup. run_calico_load accepts any UprnLookup
(null_uprn count applies only to the property-table lookup). Adds a dry_run
option to reconcile without writing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Confirmed against the DB: Calico Asset References have zero overlap with
portfolio 824's landlord_property_id (addresses match; all 824 UPRNs non-null),
so the property-table lookup cannot resolve Calico. Documents the open
resolution (Calico-supplied ref->UPRN table or address matching) in ADR-0064,
the runner, and the README, and pins the confirmed S3 source location.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Records the agreed reconciliation semantics: null_uprn reports portfolio
properties missing a UPRN (expected zero) and may overlap unmatched_to_portfolio,
rather than strictly partitioning the Calico rows.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
run_calico_s3_load reads the Calico export from S3 and runs it through
run_calico_load against portfolio 824, resolving references to UPRNs via the
property table and persisting with ConditionPostgres. S3 + Postgres wiring
around the unit-tested load; run where a database and S3 are available.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
run_calico_load ties parse -> map -> persist together: it resolves references to
UPRNs, drops blank/unmatched rows, persists the roof-covering surveys with
export-year-anchored renewal years, and returns the four-count LoadReport.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Registers ConditionFileType.Calico in the parser/mapper factory; the Calico
parser requires a UPRN lookup (like Peabody) since references resolve to UPRNs
via the property table.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LoadReport.from_calico_load reports loaded observations alongside the three drop
reasons (unmatched-to-portfolio, null-uprn, blank-placeholder) so every Calico
row is accounted for.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Behaviour-preserving lift-and-shift of the condition module out of legacy
backend/condition/ into domain/condition, infrastructure/condition,
infrastructure/postgres/condition_tables.py, repositories/condition,
applications/condition, and tests/condition. Imports rewritten to the DDD
paths; ConditionPostgres and the ORM models keep the legacy backend.app.db
Base/db_session bridges so the existing suite proves behaviour is unchanged
(SQLModel + session-DI conversion tracked as a follow-up in ADR-0064).
16 condition tests pass at the new location.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>