GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: tenant-scoped admin dashboard statistics endpoint by Storypapst · Pull Request #390 · OpenResilienceInitiative/ORISO-UserService

Conversation

@Storypapst

@Storypapst Storypapst commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

The admin statistics dashboard (ORISO-Admin) shows mock data only — no backend endpoint exists that serves real counselling statistics. KDG compliance requires statistics to come from the application-layer database (never from monitoring) with re-identification protection.

What changed

  • GET /useradmin/statistics/dashboard (+ /service/... variant): caller-scoped statistics — platform admin → per-tenant rows, tenant admin → tenant total + per-agency rows, agency admin → own agencies only (via AdminAgency)
  • AdminStatisticsRepository: native aggregate queries with explicit tenant restriction (Hibernate tenant filters do not apply to native SQL)
  • Small-cell suppression: counselling metrics are omitted (suppressed: true) when a target covers fewer than 2 counsellor accounts
  • Metrics: monthly enquiries (current/previous), active cases, active conversations today, group chats, daily new-session series (5 weeks), monthly top topics with share (4 months), session/chat counts per period
  • SecurityConfig: endpoint restricted to USER_ADMIN, TENANT_ADMIN, SINGLE_TENANT_ADMIN, RESTRICTED_AGENCY_ADMIN

Verification

  • mvnw test -Dtest=AdminDashboardStatisticsServiceTest — 8/8 green (scope resolution, suppression, topic shares, daily series)
  • AdminStatisticsRepositoryIT (@DataJpaTest) — every native query executes against the H2 testing schema
  • UserServiceApplicationIT — context boot green
  • spotless:check green

Frontend counterpart: ORISO-Admin PR (linked below).

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Storypapst @claude
feat: add tenant-scoped admin dashboard statistics endpoint
3145724
Adds GET /useradmin/statistics/dashboard serving real counselling
statistics for the admin statistics dashboard, computed exclusively
from the application-layer database (KDG compliance - no monitoring
data, no message content, no per-client drill-down).

- AdminStatisticsRepository: native aggregate queries with explicit
  tenant restriction (Hibernate tenant filters do not apply to native
  queries), grouped by agency (tenant scope) or tenant (platform scope)
- AdminDashboardStatisticsService: caller-scoped target resolution
  (platform admin -> per-tenant rows, tenant admin -> tenant total +
  per-agency rows, agency admin -> own agencies only via AdminAgency)
- Small-cell suppression: counselling metrics of a target are omitted
  (suppressed=true) when the target covers fewer than 2 counsellor
  accounts, protecting against re-identification
- Metrics: monthly enquiries (current/previous), active cases, active
  conversations today, group chat counts, daily new-session series
  (5 weeks), monthly top topics with share (4 months), session/chat
  counts per period (today/yesterday/week/total/year/last year)
- SecurityConfig: endpoint restricted to USER_ADMIN, TENANT_ADMIN,
  SINGLE_TENANT_ADMIN, RESTRICTED_AGENCY_ADMIN

Tests: 8 Mockito unit tests (scope resolution, suppression, topic
share, daily series) plus a @DataJpaTest executing every native query
against the H2 testing schema.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 789a8a28-52d0-4fb6-afe3-8b6d02213e3a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/statistics-real-data

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Storypapst Storypapst mentioned this pull request Jul 11, 2026
feat: wire statistics dashboard to real data OpenResilienceInitiative/ORISO-Admin#293
Merged
@Storypapst

Storypapst commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

Frontend counterpart: OpenResilienceInitiative/ORISO-Admin#293 (wires the admin statistics dashboard to this endpoint). Both PRs should be merged together — the Admin dashboard shows an error notice until this endpoint is available.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Storypapst @claude
feat: dev-only switch to disable small-cell suppression (fail-closed)
4d4e2ac
Adds statistics.small-cell-suppression.enabled (default true, settable
via STATISTICS_SMALL_CELL_SUPPRESSION_ENABLED) so E2E verification with
small test datasets (single-counselor agencies) is possible outside
production.

Fail-closed guard: when the prod profile is active, the disable switch
is ignored, suppression stays enforced, and a warning is logged. The
response carries suppressionDisabled=true only when suppression was
actually skipped, so the frontend can show a test-environment banner.

Tests: suppression skipped when disabled outside prod; prod profile +
property false still enforces suppression (10/10 green).

Co-Authored-By: Claude Fable 5 <[email protected]>
@Storypapst

Storypapst commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

Amendment pushed: dev-only switch statistics.small-cell-suppression.enabled (default true, env var STATISTICS_SMALL_CELL_SUPPRESSION_ENABLED). Fail-closed: when the prod profile is active the disable switch is ignored, suppression stays enforced and a warning is logged — covered by a dedicated unit test. Response carries suppressionDisabled: true only when suppression was actually skipped; the Admin dashboard (OpenResilienceInitiative/ORISO-Admin#293) shows a test-environment warning banner in that case. For Pre-Dev, set STATISTICS_SMALL_CELL_SUPPRESSION_ENABLED=false in the userservice env configmap (ORISO-Helm templates/userservice/userservice-configmap-env.yaml, same pattern as STATISTICS_ENABLED).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Storypapst
Storypapst merged commit f2411fd into dev Jul 11, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Storypapst
Storypapst deleted the feat/statistics-real-data branch July 11, 2026 15:18
This was referenced Jul 11, 2026
feat: consultant-scoped profile statistics endpoint #391
Merged
feat: tenant-scoped admin dashboard statistics endpoint (pre-dev) #412
Merged
Storypapst added a commit that referenced this pull request Jul 12, 2026
@Storypapst @claude
feat: tenant-scoped admin dashboard statistics endpoint (#390) (#412)
9c68131
* feat: add tenant-scoped admin dashboard statistics endpoint

Adds GET /useradmin/statistics/dashboard serving real counselling
statistics for the admin statistics dashboard, computed exclusively
from the application-layer database (KDG compliance - no monitoring
data, no message content, no per-client drill-down).

- AdminStatisticsRepository: native aggregate queries with explicit
  tenant restriction (Hibernate tenant filters do not apply to native
  queries), grouped by agency (tenant scope) or tenant (platform scope)
- AdminDashboardStatisticsService: caller-scoped target resolution
  (platform admin -> per-tenant rows, tenant admin -> tenant total +
  per-agency rows, agency admin -> own agencies only via AdminAgency)
- Small-cell suppression: counselling metrics of a target are omitted
  (suppressed=true) when the target covers fewer than 2 counsellor
  accounts, protecting against re-identification
- Metrics: monthly enquiries (current/previous), active cases, active
  conversations today, group chat counts, daily new-session series
  (5 weeks), monthly top topics with share (4 months), session/chat
  counts per period (today/yesterday/week/total/year/last year)
- SecurityConfig: endpoint restricted to USER_ADMIN, TENANT_ADMIN,
  SINGLE_TENANT_ADMIN, RESTRICTED_AGENCY_ADMIN

Tests: 8 Mockito unit tests (scope resolution, suppression, topic
share, daily series) plus a @DataJpaTest executing every native query
against the H2 testing schema.



* feat: dev-only switch to disable small-cell suppression (fail-closed)

Adds statistics.small-cell-suppression.enabled (default true, settable
via STATISTICS_SMALL_CELL_SUPPRESSION_ENABLED) so E2E verification with
small test datasets (single-counselor agencies) is possible outside
production.

Fail-closed guard: when the prod profile is active, the disable switch
is ignored, suppression stays enforced, and a warning is logged. The
response carries suppressionDisabled=true only when suppression was
actually skipped, so the frontend can show a test-environment banner.

Tests: suppression skipped when disabled outside prod; prod profile +
property false still enforces suppression (10/10 green).



---------

Co-authored-by: Frank Gerhardt <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
@Storypapst Storypapst mentioned this pull request Jul 22, 2026
feat: tenant-scoped admin dashboard statistics endpoint #570
Closed
@Storypapst Storypapst mentioned this pull request Sep 29, 2026
Send permanent handover mail to the correct recipients #1317
Merged
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Storypapst
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.