Skip to content

Require naam when contactpersoonRol is supplied on rol creation (v1.5) - #216

Merged
ragaumon merged 1 commit into
mainfrom
bugfix/zrc-rol-contactpersoonrol-naam-required
Sep 3, 2026
Merged

Require naam when contactpersoonRol is supplied on rol creation (v1.5)#216
ragaumon merged 1 commit into
mainfrom
bugfix/zrc-rol-contactpersoonrol-naam-required

Conversation

@ragaumon

@ragaumon ragaumon commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

POST /rollen accepted a contactpersoonRol object without a naam and only failed later on the NOT NULL database column, surfacing as an unhandled 500 instead of a validation error.

Add a NotNull check with error code "required" to the naam child rule in the v1.5 base ZaakRolRequestDtoValidator, so the request is rejected with a ValidatieFout naming contactpersoonRol.naam. All five betrokkeneType validators include this base validator, so every type is covered. An empty string stays valid, matching the presence-only "required" semantics of the standard, and the v1 contract has no contactpersoonRol field so it is unaffected.

Adds validator unit tests for the base and vestiging validators.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Testing

  • Tests pass
  • Manual testing completed

Checklist

  • Self-review completed
  • Documentation updated (if needed)

POST /rollen accepted a contactpersoonRol object without a naam and only
failed later on the NOT NULL database column, surfacing as an unhandled 500
instead of a validation error.

Add a NotNull check with error code "required" to the naam child rule in the
v1.5 base ZaakRolRequestDtoValidator, so the request is rejected with a
ValidatieFout naming contactpersoonRol.naam. All five betrokkeneType
validators include this base validator, so every type is covered. An empty
string stays valid, matching the presence-only "required" semantics of the
standard, and the v1 contract has no contactpersoonRol field so it is
unaffected.

Adds validator unit tests for the base and vestiging validators.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 11:53
@ragaumon ragaumon added the Zaken API Related to Zaken (ZRC) component label Sep 3, 2026
@ragaumon ragaumon added the Bug Something isn't working label Sep 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The validation matches the stated presence semantics and is covered through both base and derived validators.

Pull request overview

Adds v1.5 validation to prevent database failures when contactpersoonRol.naam is null.

Changes:

  • Returns a required validation error for null or omitted names.
  • Preserves optional contactpersoonRol and allows empty names.
  • Adds base and derived-validator coverage.
File summaries
File Description
ZaakRolRequestDtoValidatorTests.cs Tests base validation behavior.
VestigingZaakRolRequestValidatorTests.cs Verifies inherited validation.
ZaakRolRequestDtoValidator.cs Adds the required-name rule.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ragaumon
ragaumon merged commit ed54905 into main Sep 3, 2026
9 checks passed
@ragaumon
ragaumon deleted the bugfix/zrc-rol-contactpersoonrol-naam-required branch September 3, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Zaken API Related to Zaken (ZRC) component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants