Repository navigation
feat(pipelinq): build clients-registry-numbers-and-enrichment - #3942
Open
rubenvdlinde wants to merge 12 commits into
Open
rubenvdlinde wants to merge 12 commits into
rubenvdlinde wants to merge 12 commits into
Conversation
Task 1: client.identifiers, a list of scheme, value and the status, time and source of its last register check, with the per-scheme patterns JSON schema can hold; en and nl titles. Assisted-by: ClaudeCode:claude-opus-5-5
Tasks 2.1 to 2.3: ClientIdentifierService validates each scheme's format (the RSIN eleven test and the EU VAT country patterns included) on every client save through ClientIdentifierFormatGuard, checks a KvK number through OpenRegister's KvK leaf (valid, invalid, unavailable on a 5xx or no answer) and a VAT number through shillinq's VIES service when shillinq is there. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
requested review from
Rem-Dam,
SudoThijn,
WilcoLouwerse,
bbrands02,
remko48 and
rjzondervan
as code owners
November 17, 2026 14:36
Task 2.4: POST /api/clients/{id}/identifiers/check, #[NoAdminRequired],
refusing a client the caller may not open (a read with their rights) before
anything is looked up; the outcome is written with the same rights.
Documented in openapi.json. Hydra gates route-auth, no-admin-idor and
route-reachability pass on the diff.
Assisted-by: ClaudeCode:claude-opus-5-5
Split the VIES availability test over two conditions (line length). Assisted-by: ClaudeCode:claude-opus-5-5
Task 4.1: FillFromKvkAction (pipelinq:fill-from-kvk), a reversible OpenRegister bulk action that fills an organisation's empty place, legal form and industry from the KvK, skipping with the reasons no KvK number, KvK unavailable, not found and already filled, and recording the prior values for the undo. Registered on BulkActionRegistrationEvent. Stubs for BulkStep, BulkActionResult and the registration event for the unit suite. Assisted-by: ClaudeCode:claude-opus-5-5
Task 3.1: the Identifiers section on ClientDetail lists each official number with the status, date and source of its last check, adds a number by saving the list through OpenRegister (a refused number is shown as the server words it) and checks a KvK or VAT number through the new route. en and nl strings. Assisted-by: ClaudeCode:claude-opus-5-5
Sort the new registry import. Assisted-by: ClaudeCode:claude-opus-5-5
Task 4.2: Fill in from KvK on the Clients list, a previewed OpenRegister job of pipelinq:fill-from-kvk with the Change a field preview and confirm; the job appears on Bulk changes and can be undone there. en and nl. Assisted-by: ClaudeCode:claude-opus-5-5
The KvK-to-client mapping (place, legal form, SBI descriptions) moves into ClientIdentifierService::kvkFacts() behind the interface, the bulk action reads only the interface, and its registration listener sits beside it, so no service gains a caller outside lib/Service (component independence back above its floor). @SPEC on the section's watcher; stubs carry no anchors to openregister's own specs. Assisted-by: ClaudeCode:claude-opus-5-5
Task 5.1: docs/Features/client-identifiers.md, the schemes, what Check does, what Fill in from KvK fills and what it never overwrites; listed in the feature index. Docs build exits 0. Assisted-by: ClaudeCode:claude-opus-5-5
…ichment [skip ci] l10n: union of both sides' keys, .js rebuilt from the .json catalogues. Assisted-by: ClaudeCode:claude-opus-5-5
…skip ci] store() takes the client data and its save options and returns only a refusal; readClient() takes the register and schema as one location; indexOf() takes the wanted scheme and number as one pair. Same reads, writes and answers. Assisted-by: ClaudeCode:claude-opus-5-5
This branch has not been deployed
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.
Builds
openspec/changes/clients-registry-numbers-and-enrichment(REQ-CRN-001 to 003): official numbers on an organisation client, each checked against its register, and a bulk fill of empty company details from the KvK.Tasks done
register.d/19-client-identifiers.json:client.identifiers, a list of{scheme, value, checkStatus, checkedAt, checkSource, validUntil}.schemeis one of kvk, rsin, vat, duns and oin. The per-scheme patterns JSON schema can hold are declared withallOf/if/thenon the items.check:schema-l10nshows the same 13 uncovered strings as development and none of mine.ClientIdentifierService::validateFormat(): KvK 8 digits, RSIN 9 digits plus the eleven test, VAT an EU country prefix plus that country's VIES pattern, DUNS 9 digits, OIN 20 digits.ClientIdentifierFormatGuardruns it on every client create and update (ObjectCreatingEvent/ObjectUpdatingEvent) and refuses the write with the reason. So the form, the API, imports and bulk jobs are all held to it.checkKvk()asks OpenRegister's KvK leaf (/integrations/kvk/company?kvkNumber=). A found number isvalid. A 404, or a 200 that lacks the number, isinvalid. A 5xx or no answer isunavailable. To tell these apart,CompanyRegistryHttp::leafAnswer()returns the status code, whereleafRows()folds every non-200 answer into "unusable".checkVat()resolves shillinq'sViesServiceInterfacelazily. Without shillinq the result isuncheckedwith sourceshillinq not installed. A VIES outage isunavailable. A valid answer keeps itsvalidUntil.POST /api/clients/{id}/identifiers/checkwith#[NoAdminRequired]. The controller first reads the client with the caller's rights (canAccessClient()) and answers 403 when they may not open it. The outcome is then written with the same rights. The route is documented inopenapi.json. Hydra gates route-auth, no-admin-idor and route-reachability pass on the diff.ClientIdentifiersSectionon ClientDetail (body widgetclient-identifiers). It lists scheme, number, status and check date. Add saves the list through OpenRegister and shows a refused number in the server's own words. Check appears on KvK and VAT numbers.FillFromKvkAction(pipelinq:fill-from-kvk,StepBulkActionInterface+ReversibleBulkActionInterface). It fills an organisation's emptyplace,legalFormandindustry(the SBI descriptions, main activity first) and records the prior values for the undo. A member is skipped with one of these reasons: no KvK number, KvK unavailable, KvK number not found, already has these values, not an organisation. It is registered onBulkActionRegistrationEventthroughFillFromKvkRegistrationListener, which sits inListenerRegistrar(where pipelinq registers its listeners, rather thanApplication.php).BulkFillFromKvkModalfollows the Change a field preview and confirm with the action id swapped, so the job is listed on Bulk changes and can be undone there.docs/Features/client-identifiers.md, listed in the feature index. The docs build exits 0.Deviations, and why
addressis not filled. On a client,addressis the read-only mirror of the linked Nextcloud contact (15-unify-client-contact.json,readOnly: true), and OpenRegister refuses a change to a read-only property on update. The fill writesplace(the place of establishment, from20-organisation-registry-fields.json) instead, withlegalFormandindustry.kvkNumberfield, so organisations that already carry a KvK number do not need it re-entered.Tasks left
tests/e2e/client-identifiers.spec.ts, and the fill plus undo on Bulk changes), and the register import on a dev instance (1.1). All three need a running instance.Tests
ClientIdentifierServiceTest(16),ClientIdentifierFormatGuardTest(4),ClientIdentifierControllerTest(4),FillFromKvkActionTest(8). They use OpenRegister stubs forBulkStep,BulkActionResult,BulkActionRegistrationEventand the bulk action interfaces, undertests/Stubs.clientIdentifiersSection.spec.js(9) andbulkFillFromKvkModal.spec.js(4).reportSectionPeriod,myWorkPage,notificationLabels). There are no new failures.npm run lintis clean on the touched files.check:l10n,check:l10n-jsandcheck:manifestpass.OrganisationEnrichmentService::config(), on lines this PR did not change (only itsLEGAL_FORMSbecame public). The gates for the manifest schema, connections and ajv could not load their vendored files in this session and did not run.Generated by Claude Code