Skip to content

[IT9PE1-30741] Add DutchKvkNumber constraint, validator and provider - #96

Merged
fguimier merged 1 commit into
mainfrom
florian_30741_dutch_kvk_number_validator
Sep 1, 2026
Merged

[IT9PE1-30741] Add DutchKvkNumber constraint, validator and provider#96
fguimier merged 1 commit into
mainfrom
florian_30741_dutch_kvk_number_validator

Conversation

@fguimier

@fguimier fguimier commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What

Add the DutchKvkNumber constraint — the 8-digit Dutch KVK number (Kamer van Koophandel nummer) — following the existing BelgianEnterpriseNumber pattern:

  • DutchKvkNumber constraint + DutchKvkNumberValidator: format-only (^\d{8}$), single WRONG_FORMAT_ERROR. KVK numbers carry no public check digit, so no checksum branch.
  • DutchKvkNumberProvider: maps the dutchKvkNumber DBAL type to the constraint (autoconfigured via FieldConstraintsSetProviderInterface).
  • composer.json: assoconnect/doctrine-types-bundle ^v2.16^2.18 (the provider imports DutchKvkNumberType::NAME, added in v2.18.0).
  • README: new validator entry.

Refs IT9PE1-30741

Test plan

  • DutchKvkNumberValidatorTest (shared ConstraintValidatorTestCase): valid null/''/34179503 (Adyen docs example) + leading-zero cases; 7 invalid format cases each asserting WRONG_FORMAT_ERROR.
  • DutchKvkNumberProviderTest (shared FieldConstraintsSetProviderTestCase): dutchKvkNumber type → [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 highest jobs fail on the ^2.18 constraint, 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.49 bump PR in the backend. Two reviews total.

Requires assoconnect/doctrine-types-bundle ^2.18 for DutchKvkNumberType.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fguimier

fguimier commented Sep 1, 2026

Copy link
Copy Markdown
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

⚠️ Self-review by the author is mandatory before merging, regardless of this verdict.

@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@fguimier
fguimier merged commit 74b2548 into main Sep 1, 2026
5 of 9 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.

1 participant