Skip to content

fix(ratings): resolve beoordeeling register+schema — reviews were 100% dead (#375) - #407

Merged
rubenvdlinde merged 2 commits into
developmentfrom
fix/review-register-resolution
Jul 25, 2026
Merged

fix(ratings): resolve beoordeeling register+schema — reviews were 100% dead (#375)#407
rubenvdlinde merged 2 commits into
developmentfrom
fix/review-register-resolution

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Found by the final live e2e pass on 8080 (#386). The catalog-ratings feature (#399) was completely non-functional on a live instance: every review submit, aggregate and moderation call returned register/schema not configured.

Root cause (SettingsService, two halves)

  • getSchemaIdForObjectType()'s voorzieningenKeyMap only listed module/compliancy/moduleVersie/sbomComponent, so it returned null for beoordeeling (and dienst/gebruik/contract/koppeling/suite/kwetsbaarheid/sector) even though <type>_schema was in the config.
  • getRegisterIdForObjectType() mapped the voorzieningen register only for organisatie/contactpersoon, so every other catalog type resolved to null.

ReviewService, ReviewAggregateService and ModerationService all resolve the beoordeeling target through these two methods — so all three read the feature as unconfigured.

Fix

Complete the schema key map with every catalog type, and resolve the voorzieningen register for any type that has a <type>_schema in the config. One fix point in the platform helper; no per-service workarounds.

Verified live end-to-end (after the fix)

  • submit202 pending; client-supplied auteur:"FORGED" and status:"approved" both ignored — author server-stamped to the session user (admin), status forced pending.
  • Pending review excluded from the approved-only public aggregate (fail-closed).
  • Moderation queue resolves → approve → aggregate now shows average 5, count 1.
  • Test review deleted afterwards.

3 new regression unit tests (beoordeeling resolves register+schema; every catalog type resolves; unknown type stays null).

Note: this fixes what #399 shipped — the feature's unit tests mocked the resolver and never exercised the real key maps, which is exactly why a live pass was needed.

🤖 Generated with Claude Code

)

The catalog-ratings feature was 100% dead on a live instance: every review
submit, aggregate and moderation call returned 'register/schema not
configured'.

Root cause in SettingsService, two halves:
- getSchemaIdForObjectType()'s voorzieningenKeyMap only listed
  module/compliancy/moduleVersie/sbomComponent, so it returned null for
  'beoordeeling' (and dienst/gebruik/contract/koppeling/suite/kwetsbaarheid/
  sector) even though '<type>_schema' was present in the config.
- getRegisterIdForObjectType() only mapped the voorzieningen register for
  organisatie/contactpersoon, so any other catalog type resolved to null.

ReviewService, ReviewAggregateService and ModerationService all resolve the
beoordeeling target through these two methods, so all three read the feature
as unconfigured.

Fix: complete the schema key map with every catalog type, and resolve the
voorzieningen register for any type that has a '<type>_schema' in the config.
Single fix point; no per-service workarounds.

Found by live e2e on 8080. Verified end-to-end after the fix: submit -> 202
pending (client-supplied auteur='FORGED'/status='approved' both ignored,
author server-stamped to the session user, status forced pending) -> excluded
from the approved-only public aggregate -> moderation approve -> now visible
(average 5, count 1).
…lution (#375)

3 tests: beoordeeling resolves register 11 + schema 43; every catalog type
resolves; an unknown type stays null — exercising the real key maps the
feature's original tests mocked past.
@rubenvdlinde
rubenvdlinde merged commit 8b22ffe into development Jul 25, 2026
@rubenvdlinde
rubenvdlinde deleted the fix/review-register-resolution branch July 25, 2026 10:39
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