Repository navigation
Location breakdowns and id references in aggregated V2 endpoints - #1122
Merged
Merged
Conversation
- Form submission, incident report and citizen report V2 aggregates now list the Level1..Level5 locations of the submissions at the root, and every question aggregate holds its breakdown per location id. - Single select, multi select and rating aggregates count the distinct submissions and polling stations per option / value. - Texts, notes and attachments are listed once at the root with ids, and the question aggregates reference them by id. - V2 responses use dedicated read models, so V1 output is unchanged. - :aggregated-submissionsV2 (incident and citizen reports) accepts the V1 query params and applies them alongside the filter; :aggregated-submissions is marked obsolete.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Summary
Reworks the aggregated V2 endpoints for form submissions (
:aggregatedV2), incident reports and citizen reports (:aggregated-submissionsV2). This changes the V2 response shape. The web app still uses V1, which is unchanged.Response shape
parentIdlinks each location to the one a level up. Submissions without a value at a level are left out of that level.submissionsHistogram(distinct submissions) andpollingStationsHistogram(distinct polling stations) per option or value. Citizen reports have no polling stations, so they get the submissions histogram only.Query params on
:aggregated-submissionsV2filter.ILIKE.:aggregated-submissionsendpoints are marked[Obsolete].Implementation
AddLocationAggregates:AggregateAnswerswith the new histograms;TextsandLocationscolumns.Downrestores the previous functions exactly.FormSubmissionsAggregateV2andCitizenReportFormSubmissionsAggregateV2. The new fields on the shared answer aggregate types are omitted from the JSON when not set.Testing
FilterRulesand for the V2 requests' query param handling. All affected test projects pass.