Skip to content

feat(admin): add addresses + geocoding to organizations #1969

@cdcore09

Description

@cdcore09

Summary

Organizations need addresses so they can be placed on the community map alongside members. Addresses must be geocoded to lat/long so the map can render them without per-request lookups, mirroring the existing pattern on profiles (latitude/longitude + showOnMap).

Requirements

  • Add address columns to organizations (street/city/region/country/postalCode + latitude numeric(9,6) + longitude numeric(9,6) + showOnMap boolean)
  • Migration: backfill latitude/longitude as nullable; existing rows stay null until geocoded
  • Geocoding pipeline (Nominatim or Mapbox — pick one and document) triggered on address change in admin PATCH
  • Admin UI: address fields on the org detail page Identity tab + a read-only "Geocoded to: ${lat}, ${lng}" preview with a re-geocode button
  • Public map (apps/web map surface used by the directory) picks up org pins gated on showOnMap
  • showOnMap toggle defaults to false for legacy imports; orgs explicitly approved via admin can flip on

Context

The profiles table already has latitude, longitude, showOnMap, and publicLocation — the org-side schema should mirror those names so map rendering can stay type-uniform across actor kinds.

Implementation Notes

Geocoding is async and the admin shouldn't block on it: store address fields synchronously on PATCH, then enqueue a geocode job. For the v1 a single inline fetch to Nominatim on save is probably acceptable given org volume; we can move to a queued worker later if rate limits bite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions