Skip to content

Add generic postcode/address lookup with pluggable drivers - #1

Merged
royduin merged 6 commits into
masterfrom
feature/init
Sep 8, 2026
Merged

Add generic postcode/address lookup with pluggable drivers#1
royduin merged 6 commits into
masterfrom
feature/init

Conversation

@claudio-ferraro

@claudio-ferraro claudio-ferraro commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • rapidez/postcode is a generic postcode/address lookup package with a pluggable driver architecture, instead of building yet another single-purpose package
  • Ships with three drivers: postcodeeu (Postcode.eu), pro6pp (Pro6pp), postcodeservice (Postcodeservice); each calling its API directly from Rapidez, no Magento dependency required for the lookup
  • Uses the same postcode-change Vue event already wired into Rapidez's own address form, so it works out of the box with no Blade template changes
  • Adding a future driver only requires a new class + a config entry; no changes to the route, controller or JavaScript
  • Requires rapidez/core ^5.0 (relies on the event helper introduced in v5)

Test plan

  • PHPStan (level 1) passes
  • All three drivers verified directly (valid lookup, invalid/not-found lookup, validation, caching)
  • All three drivers verified end-to-end in a Rapidez v5 project: checkout address, and account address book
  • House number addition handling verified for both the dedicated addition field and the combined house-number-field case
  • Driver switching verified to be a pure .env/config change, no code changes needed

ref: RAP-2028

@Jade-GG Jade-GG left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that this only supports dutch postcodes right now, is that correct? If this is intended, the readme should probably reflect that.

Comment thread config/rapidez/postcode.php Outdated
@@ -0,0 +1,31 @@
<?php

namespace Rapidez\Postcode\DataTransferObjects;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, in other packages we put this under just ...\Data, but I'm not 100% confident on that so double check this before changing anything

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-checked this, couldn't find that convention anywhere (searched in our Rapidez packages' file trees plus a full code search). Keeping DataTransferObjects for now, happy to revisit if you know of one I missed.

Comment thread src/Drivers/PostcodeEuDriver.php
Comment thread src/Drivers/Pro6ppDriver.php
Comment thread README.md Outdated
@royduin
royduin merged commit c0a7839 into master Sep 8, 2026
18 checks 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.

3 participants