Feature/dawa adressevaelger shift#77
Open
martinyde wants to merge 6 commits into
Open
Conversation
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.
Link to ticket
https://leantime.itkdev.dk/#/tickets/showTicket/7543
Description
Replace deprecated DAWA address service with Adressevaelger
The DAWA API (dawa.aws.dk) is deprecated. This replaces both the frontend autocomplete (dawa-autocomplete2 npm package) and backend geocoding (nicoeg/dawa PHP package) with the new https://github.com/Klimadatastyrelsen/adressevaelger widget.
The new API returns coordinates in EPSG:25832 (UTM Zone 32N) instead of WGS84, so proj4 is used client-side to convert them. Coordinates are passed to the backend via hidden form fields and merged into the existing serialized data blob in massageFormValues() — no schema changes required. Server-side geocoding is fully removed. An optional admin config field is added for a custom adressevaelger API token, with the default public token (adressevaelger123) used as fallback.
Terser plugin was presumably only used for handling dawa-autocomplete2 so that has been removed.
New data flow
User selects address → adressevaelger widget calls /adresser/{id}
→ JS extracts EPSG:25832 coords from response.adresse.husnummer.adgangspunkt.koordinater
→ proj4 converts to WGS84 [lat, lng]
→ populates hidden form fields (geo_lat, geo_lng)
→ form submit → massageFormValues() merges into data['coordinates'], unsets hidden fields
→ EventHelper (unchanged) reads data['coordinates'] → sends geo_lat/geo_lng to Pretix API