Skip to content

[DT-3939] DAC Dashboard API. - #3013

Merged
otchet-broad merged 3 commits into
developfrom
otchet-dt-3939-dac-dashboard-data-api
Aug 12, 2026
Merged

[DT-3939] DAC Dashboard API.#3013
otchet-broad merged 3 commits into
developfrom
otchet-dt-3939-dac-dashboard-data-api

Conversation

@otchet-broad

Copy link
Copy Markdown
Contributor

Addresses

https://broadworkbench.atlassian.net/browse/DT-3939

Summary

  • Adds API for DAC Dashboard
  • Refactors to extract concerns common to all dashboards
  • Allows Members and Chairs to have visibility on publicVisibility = false because of potential cases where DACs are voting on DARs where publicVisibility = false.

Have you read CONTRIBUTING.md lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@otchet-broad
otchet-broad marked this pull request as ready for review August 11, 2026 21:07
@otchet-broad
otchet-broad requested a review from a team as a code owner August 11, 2026 21:07
@otchet-broad
otchet-broad requested review from kevinmarete and rushtong and a lite review from Copilot and removed request for a team August 11, 2026 21:07
@otchet-broad
otchet-broad requested a review from fboulnois August 11, 2026 21:08

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.

Pull request overview

Adds a new DAC Dashboard Summary API endpoint and refactors existing dashboard services to share Elasticsearch aggregation/query logic in a single place.

Changes:

  • Introduces /api/dac/dashboard-summary (resource, service, DAO) plus OpenAPI path/schema and tests.
  • Extracts shared Elasticsearch aggregation/query logic into DashboardSearchService and shared async join handling into DashboardServiceSupport.
  • Updates Researcher and Signing Official dashboards to use the shared search service and shared response fragments (DashboardSummary records).

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/org/broadinstitute/consent/http/resources/DacDashboardResource.java Adds the DAC dashboard summary endpoint (authenticated, role-gated).
src/main/java/org/broadinstitute/consent/http/service/DacDashboardService.java Implements DAC summary aggregation across DB + Elasticsearch.
src/main/java/org/broadinstitute/consent/http/db/DacDashboardDAO.java Adds one-roundtrip SQL aggregation for DAC dashboard counts.
src/main/java/org/broadinstitute/consent/http/service/DashboardSearchService.java Centralizes shared Elasticsearch aggregation/query + parsing.
src/main/java/org/broadinstitute/consent/http/service/DashboardServiceSupport.java Centralizes async join/exception-unwrapping behavior.
src/main/java/org/broadinstitute/consent/http/service/ResearcherDashboardService.java Refactors to use DashboardSearchService.
src/main/java/org/broadinstitute/consent/http/service/SigningOfficialDashboardService.java Refactors to use DashboardSearchService.
src/main/java/org/broadinstitute/consent/http/models/DashboardSummary.java Adds shared response fragments (records) for dashboards.
src/main/java/org/broadinstitute/consent/http/models/DacDashboardSummary.java Adds DAC dashboard response model.
src/main/java/org/broadinstitute/consent/http/models/ResearcherDashboardSummary.java Switches to shared response fragments.
src/main/java/org/broadinstitute/consent/http/models/SigningOfficialDashboardSummary.java Switches to shared response fragments.
src/main/java/org/broadinstitute/consent/http/ConsentModule.java Wires up new services via Guice providers.
src/main/java/org/broadinstitute/consent/http/ConsentApplication.java Registers the new DAC dashboard resource.
src/main/resources/assets/api-docs.yaml Adds OpenAPI path reference for the new endpoint.
src/main/resources/assets/paths/dacDashboardSummary.yaml Defines the OpenAPI operation for DAC dashboard summary.
src/main/resources/assets/schemas/DacDashboardSummary.yaml Defines the OpenAPI schema for DAC dashboard summary.
src/test/java/org/broadinstitute/consent/http/service/DacDashboardServiceTest.java Adds service-level tests for DAC dashboard behavior.
src/test/java/org/broadinstitute/consent/http/db/DacDashboardDAOTest.java Adds DAO integration tests for DAC dashboard SQL counts.
src/test/java/org/broadinstitute/consent/http/resources/DacDashboardResourceTest.java Adds resource-level tests for DAC dashboard endpoint.
src/test/java/org/broadinstitute/consent/http/service/ResearcherDashboardServiceTest.java Updates wiring to the shared search service.
src/test/java/org/broadinstitute/consent/http/service/SigningOfficialDashboardServiceTest.java Updates wiring to the shared search service.
src/test/java/org/broadinstitute/consent/http/resources/ResearcherDashboardResourceTest.java Updates imports to shared response fragments.
src/test/java/org/broadinstitute/consent/http/resources/SigningOfficialDashboardResourceTest.java Updates imports to shared response fragments.

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

@rushtong rushtong 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.

Nice work 👍🏽

@kevinmarete kevinmarete 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.

Nice work, one blocking issue, matching the concern in the DUOS UI PR.

P1 — Dual-role users lose member-scoped DAR counts

A user with both Chairperson and Member roles is always evaluated as a Chairperson here. Since DacDashboardDAO.getCounts() filters user_role by that single role ID, DARs and pending votes from DACs where the user is only a member are omitted.

This also makes the response internally inconsistent: getDacIds(user) supplies associations from both roles to the Elasticsearch counts, while the relational DAR counts include only Chairperson associations.

Could we aggregate both role scopes for dual-role users, deduplicating collections that overlap, or otherwise let the caller select a role? This needs to preserve the different awaitingMyVote semantics for chairs and members.

@sonarqubecloud

Copy link
Copy Markdown

@kevinmarete kevinmarete 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.

👍🏾

@otchet-broad
otchet-broad merged commit 0744df7 into develop Aug 12, 2026
11 checks passed
@otchet-broad
otchet-broad deleted the otchet-dt-3939-dac-dashboard-data-api branch August 12, 2026 20:19
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.

4 participants