eeg_portal/eeg_frontend/src/app/layout/dashboard-layout/dashboard-nav-items.ts
Bernhard Müller 4b7b26231f feat(community): add member consumption dashboard with coverage preview
Backend:
- ConsumptionDashboardService: aggregates consumption and community
  feed-in data with daily/hourly granularity based on date range
- Coverage calculation: min(consumption, communityFeedIn) per interval
- Ownership check on dashboard endpoint
- 6 new aggregate queries in MeteringDataRepository
- findActiveMeteringPointIdsByCommunityId in MembershipRepository
- 6 unit tests for ConsumptionDashboardService

Frontend:
- Apache ECharts via ngx-echarts for chart visualization
- ConsumptionDashboardComponent with metering point selector,
  date range picker, quick-range buttons (7/30/90 days)
- Chart: blue bars (consumption), green bars (covered), orange
  line (community feed-in), tooltip with coverage percentage
- Summary cards: total consumption, coverage %, feed-in, covered kWh
- Warning when user has no community membership
- Route /dashboard/consumption (MEMBER only)

Tests: 143/143 passing
2026-07-22 13:23:58 +02:00

20 lines
1.0 KiB
TypeScript

export interface NavItem {
label: string;
path: string;
roles: string[];
}
export const NAV_ITEMS: NavItem[] = [
{label: 'Übersicht', path: '/dashboard', roles: ['ADMIN', 'MEMBER']},
{label: 'Zählpunkte', path: '/dashboard/metering-points', roles: ['ADMIN', 'MEMBER']},
{label: 'Community beitreten', path: '/dashboard/join-community', roles: ['MEMBER']},
{label: 'Meine Mitgliedschaften', path: '/dashboard/my-memberships', roles: ['MEMBER']},
{label: 'Verbrauch', path: '/dashboard/consumption', roles: ['MEMBER']},
{label: 'Mitgliedschaften', path: '/dashboard/admin-memberships', roles: ['ADMIN']},
{label: 'Mein Profil', path: '/dashboard/profile', roles: ['ADMIN', 'MEMBER']},
{label: 'Benutzerverwaltung', path: '/dashboard/approvals', roles: ['ADMIN']},
{label: 'Energiegemeinschaften', path: '/dashboard/energy-communities', roles: ['ADMIN']},
{label: 'Tarife verwalten', path: '/dashboard/tariffs', roles: ['ADMIN']},
{label: 'Meine Tarife', path: '/dashboard/my-tariffs', roles: ['MEMBER']}
];