Skip to content

feat(analysis): return addressCount on /v4/product/analysis#9

Merged
yorickdewid merged 1 commit into
mainfrom
feat/analysis-address-count
May 29, 2026
Merged

feat(analysis): return addressCount on /v4/product/analysis#9
yorickdewid merged 1 commit into
mainfrom
feat/analysis-address-count

Conversation

@yorickdewid

Copy link
Copy Markdown
Contributor

What

Re-adds the addressCount attribute to the /v4/product/analysis/:id response.

{ "...": "...", "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_count column — the view the endpoint already queries — so no extra query or round-trip is added:

address_count AS "addressCount"

Verified against the dev DB that address_count is fully populated (11.2M rows, zero nulls) and matches a raw COUNT(*) over geocoder.address per building_id exactly.

Verification

  • bun run typecheck — clean
  • bun test — 32 pass, 0 fail
  • E2E through the app's sql client + resolveBuildingExternalId: NL.IMBAG.PAND.0301100000017178{"buildingId":"...017178","addressCount":3}

🤖 Generated with Claude Code

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>
@yorickdewid yorickdewid merged commit 2abe1b0 into main May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant