[IT9PE1-30741] Add DutchKvkNumber constraint, validator and provider - #96
Merged
Merged
Conversation
Requires assoconnect/doctrine-types-bundle ^2.18 for DutchKvkNumberType. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
🤖 Review gate — 0 error / 0 warning / 2 info Human review needed: no — faithful pattern copy of BelgianEnterpriseNumber with full tests and a verified dependency floor bump; no migrations/money/security/hotspot involvement; can be merged without a peer review. 📋 Card audit: 7 done |
|
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.



What
Add the
DutchKvkNumberconstraint — the 8-digit Dutch KVK number (Kamer van Koophandel nummer) — following the existingBelgianEnterpriseNumberpattern:DutchKvkNumberconstraint +DutchKvkNumberValidator: format-only (^\d{8}$), singleWRONG_FORMAT_ERROR. KVK numbers carry no public check digit, so no checksum branch.DutchKvkNumberProvider: maps thedutchKvkNumberDBAL type to the constraint (autoconfigured viaFieldConstraintsSetProviderInterface).composer.json:assoconnect/doctrine-types-bundle^v2.16→^2.18(the provider importsDutchKvkNumberType::NAME, added in v2.18.0).Refs IT9PE1-30741
Test plan
DutchKvkNumberValidatorTest(sharedConstraintValidatorTestCase): validnull/''/34179503(Adyen docs example) + leading-zero cases; 7 invalid format cases each assertingWRONG_FORMAT_ERROR.DutchKvkNumberProviderTest(sharedFieldConstraintsSetProviderTestCase):dutchKvkNumbertype →[new DutchKvkNumber()].vendor/bin/phpcs,vendor/bin/phpstan,vendor/bin/phpunit(318 tests) green in the open-source container.Note: CI resolves doctrine-types-bundle from Packagist — v2.18.0 was tagged today; if the
highestjobs fail on the^2.18constraint, Packagist has not indexed the release yet (trigger an update on the package page and re-run).Shipping
Merging this PR ships nothing: it needs a semver tag / GitHub release (v2.49.0, after the ItalianFiscalCode PR lands too), then a
composer require assoconnect/validator-bundle:^2.49bump PR in the backend. Two reviews total.