Skip to content

show PLZ in agent organisation details for legacy agents#663

Open
nadavosa wants to merge 1 commit into
developfrom
627-agent-address-plz-display
Open

show PLZ in agent organisation details for legacy agents#663
nadavosa wants to merge 1 commit into
developfrom
627-agent-address-plz-display

Conversation

@nadavosa

Copy link
Copy Markdown
Collaborator

Summary

  • Adds agentPostcode.postcode to the relations loaded in GET /agents/:id
  • When agent.address is null (legacy agents with no address entity), falls back to the first agentPostcode PLZ to produce e.g. "14055 Berlin" instead of "Berlin"
  • Agents with a proper address entity continue to show the full "Street, PLZ Berlin" string via serializeAddress — no change for those

Why

Legacy agents were created without an Address entity; their PLZ lives in agentPostcode. The org-details section was showing just "Berlin" for all such agents even when a postcode was available.

Resolves need4deed-org/fe#627

Test plan

  • Load an agent with address = null and agentPostcode entries → agentDetails.address should be "14055 Berlin" (or whichever PLZ)
  • Load an agent with a proper address.street + address.postcode → address unchanged, still "Heerstr. 110, 14055 Berlin"
  • Load an agent with neither address nor agentPostcode → still returns "Berlin"

🤖 Generated with Claude Code

Load agentPostcode.postcode relation in the agent GET endpoint.
When an agent has no address entity (legacy agents), fall back to
the first agentPostcode PLZ so the org details section shows e.g.
"14055 Berlin" instead of just "Berlin".

Resolves need4deed-org/fe#627

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

feat: show full address (street + PLZ) in agent organisation details section

1 participant