feat(analysis): return addressCount on /v4/product/analysis#9
Merged
Conversation
Re-adds the addressCount attribute to the analysis response (issue #988). Consumers (Rabobank and other finance/valuation integrations) use it to split restoration costs across the addresses/objects within a single BAG pand. Sourced from the precomputed data.model_risk_static.address_count column (fully populated, == count of geocoder.address rows per building_id), so no extra query is needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Re-adds the
addressCountattribute to the/v4/product/analysis/:idresponse.{ "...": "...", "addressCount": 4 }Why
Requested in Laixer/FunderMaps#988. External consumers (Rabobank and other finance/valuation integrations) use this value to split restoration costs across the addresses/objects (nummeraanduidingen) within a single BAG pand. It was available in the old C# batch surface but missing from the v4 analysis response, forcing consumers to re-derive it from BAG data.
How
Sourced from the existing precomputed
data.model_risk_static.address_countcolumn — the view the endpoint already queries — so no extra query or round-trip is added:Verified against the dev DB that
address_countis fully populated (11.2M rows, zero nulls) and matches a rawCOUNT(*)overgeocoder.addressperbuilding_idexactly.Verification
bun run typecheck— cleanbun test— 32 pass, 0 failsqlclient +resolveBuildingExternalId:NL.IMBAG.PAND.0301100000017178→{"buildingId":"...017178","addressCount":3}🤖 Generated with Claude Code