fix(ratings): resolve beoordeeling register+schema — reviews were 100% dead (#375) - #407
Merged
Merged
Conversation
) 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.
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.
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()'svoorzieningenKeyMaponly listedmodule/compliancy/moduleVersie/sbomComponent, so it returned null forbeoordeeling(anddienst/gebruik/contract/koppeling/suite/kwetsbaarheid/sector) even though<type>_schemawas in the config.getRegisterIdForObjectType()mapped the voorzieningen register only fororganisatie/contactpersoon, so every other catalog type resolved to null.ReviewService,ReviewAggregateServiceandModerationServiceall 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>_schemain the config. One fix point in the platform helper; no per-service workarounds.Verified live end-to-end (after the fix)
submit→ 202 pending; client-suppliedauteur:"FORGED"andstatus:"approved"both ignored — author server-stamped to the session user (admin), status forcedpending.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