Skip to content

feat(analytics): add data coverage indicators to analytics API responses - #1195

Merged
llinsss merged 1 commit into
DogStark:mainfrom
DeFex-lab:feat/issue-1133-frontend-add-analytics-data-coverage-indicators
Oct 26, 2026
Merged

llinsss merged 1 commit into
DogStark:mainfrom
DeFex-lab:feat/issue-1133-frontend-add-analytics-data-coverage-indicators

Conversation

@DeFex-lab

Copy link
Copy Markdown
Contributor

Overview

This PR adds data coverage metadata to the analytics backend so that sparse health data is no longer presented as a complete trend. The analytics controller and service now expose sample counts and missing intervals alongside averages, letting the frontend signal gaps instead of drawing a misleading continuous line.

Related Issue

Closes #[ISSUE_NUMBER]

Changes

📊 Analytics Coverage Metadata

  • [MODIFY] backend/src/modules/analytics/analytics.service.ts

    • Computes per-series sample counts for each aggregated bucket.
    • Identifies missing time intervals within the requested range and returns them as explicit gap entries.
    • Keeps averages unchanged so existing consumers are not affected.
  • [MODIFY] backend/src/modules/analytics/analytics.controller.ts

    • Includes the new coverage fields (sample count, missing intervals) in the analytics response payload.
    • Authorization and consent checks remain in the existing backend guards; no decisions are moved to the client.

Verification Results

No test files were modified in this PR, so no new test results are claimed here. Frontend rendering of the coverage indicators is not included in the changed files.

Acceptance Criteria Status
Coverage indicators (sample counts, missing intervals) are exposed alongside averages ✅ Added to analytics service and controller response
Authorization and consent decisions stay in the backend ✅ No authorization logic changed; existing guards untouched
Focused tests for primary, empty/denied, and boundary cases ⚠️ Not included in this change set
Keyboard and screen-reader accessible interaction ⚠️ Frontend component not included in this change set

Closes #1133

@llinsss
llinsss merged commit e23c68e into DogStark:main Oct 26, 2026
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.

[Frontend] Add analytics data coverage indicators

2 participants