Skip to content

Comments

Add english language and post office support#98

Merged
mhieta merged 18 commits intomainfrom
RATYK-154/update-translations
Feb 20, 2026
Merged

Add english language and post office support#98
mhieta merged 18 commits intomainfrom
RATYK-154/update-translations

Conversation

@mhieta
Copy link
Contributor

@mhieta mhieta commented Feb 19, 2026

Description

  • Add english language support for models Municipality, Street and PostalCodeArea
  • Add new multilingual (fi/sv/en) post_office field to PostalCodeArea with API filtering
  • Imports:
    • Update Digiroad and Paavo import-scripts to use latest datasets
    • Use explicit source SRID:s for improved support of the latest Digiroad-dataset and better code readability
    • Add new import_post_offices Django management command and a wrapper shell-script for Posti ZIP/DAT format
    • Add new delete_address_data Django management command and a wrapper shell-script to delete all address data from the database (municipalities, streets, addresses and postal code areas).
    • Add a wrapper shell-script for municipality import
    • Add comprehensive data import/re-import guide
  • Replace distinct() with subqueries for improved performance
  • Update model verbose names and translations
  • Django Admin updates
    • Update list display, ordering and search fields for:
      • MunicipalityAdmin
      • StreetAdmin
      • PostalCodeAreaAdmin
      • AddressAdmin

BREAKING CHANGE: municipality-field is removed from PostalCodeArea because the underlying Tilastokeskus-dataset contains only one municipality per PostalCodeArea and there are special cases, where multiple municipalities are needed per one PostalCodeArea.

Refs: RATYK-160

Update list display, ordering and search fields for:
- MunicipalityAdmin
- StreetAdmin
- PostalCodeAreaAdmin
- AddressAdmin

Refs: RATYK-154
Update importers to use english language for:
- Street
- Municipality
- Postal code area

Fallback-logic explained:
- sv: use finnish language if swedish translation is empty
- fi: use swedish language if finnish translation is empty
- en: use finnish or swedish version as english

Refs: RATYK-154
Updates:
- Use explicit source srid constants to make code more readable.
- Rely on address data update only by default.
- Rename "postal code import" to "postal code area import".

Refs: RATYK-163
@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

@mhieta mhieta force-pushed the RATYK-154/update-translations branch from 0993fb5 to 79fb45a Compare February 20, 2026 07:20
@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

Add a new Django management command to delete all address
data from the database (municipalities, streets, addresses
and postal code areas).

Refs: RATYK-163
- Add shell script wrapper for delete_address_data management
  command
- Include safety confirmation prompt before deletion
- Follow existing script conventions and shellcheck compliance
- Make script executable with proper permissions

Refs: RATYK-163
Digiroad-import:
- Update URL
- Allow curl to follow redirects
- Fix multiple shapefile argument support

Paavo-import:
- Use WFS 2.0
- Use typeName 'pno_meri_2026'
- Update management command name

Update documentation from the underlying
management commands.

Refs: RATYK-163
BREAKING CHANGE: municipality-field is no longer
accessible in PostalCodeArea after this change.

Details:
- Update PostalCodeArea-model
- Add migration
- Update API
- Update imports
- Update tests
- Update Django Admin

Refs: RATYK-159
Replace distinct() with subqueries for performance.

Also update OpenApiParameters.

Refs: RATYK-160
@mhieta mhieta force-pushed the RATYK-154/update-translations branch from 79fb45a to 6bf0715 Compare February 20, 2026 09:34
@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

Details:
- Add post_office field with fi/sv/en translations to
  PostalCodeArea model
- Implement import command for Posti ZIP/DAT format with
  fallback logic
- Add postoffice query parameter to Address and PostalCodeArea
  APIs
- Update finnish translations
- Add comprehensive test coverage

Refs: RATYK-157
- Create convenience script for municipality data import
- Add file existence validation and clear error messages
- Include usage instructions with NLS download link
- Require shapefile path as command-line argument
- Set executable permissions and verify with shellcheck

Refs: RATYK-160
Exclude migrations and pipelines from the Sonar analysis.

Refs: RATYK-160
@mhieta mhieta force-pushed the RATYK-154/update-translations branch from 6bf0715 to c013bd9 Compare February 20, 2026 10:08
@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

Province is only needed in the shell-script,
therefore remove it from the management command.

Refs: RATYK-163
@mhieta mhieta marked this pull request as ready for review February 20, 2026 10:36
@mhieta mhieta requested a review from a team as a code owner February 20, 2026 10:36
@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

Use dictionary comparisons instead of
individual field assertion for
cleaner and more maintainable code.

Refs: RATYK-163
Validate that municipality code exists
in the province's municipality list.

Refs: RATYK-163
@mhieta mhieta force-pushed the RATYK-154/update-translations branch from 4a0f478 to 06c16d9 Compare February 20, 2026 11:42
@sonarqubecloud
Copy link

@azure-pipelines
Copy link

PAIKKATIETOHAKU-API branch is deployed to platta: https://paikkatietohaku-api-pr98.api.dev.hel.ninja 🚀🚀🚀

@mhieta mhieta merged commit 80fe659 into main Feb 20, 2026
27 checks passed
@mhieta mhieta deleted the RATYK-154/update-translations branch February 20, 2026 12:03
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.

2 participants