Add comprehensive tests covering:
- Tab navigation (pending/all) with signal verification
- loadAllUsers() calls correct endpoint via generated AdminIAMService
- Error handling for loadPendingUsers and loadAllUsers failures
- Approve/reject user actions including undefined userId guards
- Template rendering: pending tab with Freigeben/Ablehnen buttons
- Template rendering: all users tab without action buttons
- Status badge rendering in both tabs
- Role column display (Unternehmen/Privatperson)
- Empty state messages for both tabs
- Duplicate Status column header bug fix verification
- No reload of allUsers if already loaded
- Add three tabs: Ausstehende Anträge / Aktive Mitgliedschaften / Alle
- Card view for pending tab (existing approve/reject behavior preserved)
- Table view for active and all tabs (Name, Email, Community, Zählpunkt, Priorität, Status)
- getStatusLabel() for German status display (Ausstehend/Aktiv/Inaktiv)
- getStatusBadgeClass() for color-coded status badges
- Client-side filtering for instant tab switching
- Add comprehensive tests (19 test cases)
- Add getAllUsers() to AdminIAMService (fixes compilation for admin-user-approval)
- Fix deleteUserTariff missing userId argument in user-tariff component
- Add activeTab signal ('pending' | 'all') with tab navigation UI
- Add allUsers signal with loadAllUsers() using generated AdminIAMService.getAllUsers()
- Add getStatusLabel() helper for German status labels (Ausstehend/Aktiv/Freigeschaltet/Inaktiv/Abgelehnt)
- Add getStatusBadgeClass() for color-coded status badges (yellow/green/red)
- Fix duplicate 'Status' column header bug in pending users table
- All-users tab shows Name, Email, Status badge, Rolle columns (no action buttons)
- Add 22 passing tests covering signals, helpers, tab switching, approve/reject, and template
Add method to fetch all admin memberships via GET /api/community/admin/memberships
with corresponding unit tests using Angular HttpClientTestingModule.
- Add frontend upload page with file selection, drag-and-drop, and preview
- Add preview endpoint (POST /api/community/metering-data/preview/xlsx)
- Validate FEED_IN only for PRODUCER, CONSUMPTION only for CONSUMER metering points
- Optimize deduplication with bulk query (fix N+1 problem)
- Eliminate duplicate DB query in validateRecords
- Add 4 new tests for data type validation
- Add navigation entry for admin users
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
- Add pendingMemberships field to AdminStats DTO
- Add 4th card 'Offene Mitgliedsanträge' to admin dashboard
- Rename 'Offene Freigaben' to 'Ausstehende Freischaltungen'
- Update DashboardService to count pending memberships
- Update tests to match new AdminStats structure
- Fix UserTariffController: use @CurrentUserId instead of broken extractUserId()
- Fix UserTariffController: use @PathVariable instead of @RequestParam for userId in delete
- Add @PreAuthorize annotations to all tariff endpoints (ADMIN for community, MEMBER for user)
- Add duplicate tariff prevention for (source, target) pairs
- Optimize membership check: replace N+1 query with efficient isActiveMemberOfCommunity()
- Update tests to match new membership check API
Backend:
- Add CommunityTariff entity (admin-managed max price + surcharge per community)
- Add UserTariff entity (user-agreed tariffs between metering points)
- Add TariffController (admin endpoints) and UserTariffController (user endpoints)
- Add TariffService with full validation (price <= max, ACTIVE state, membership)
- Add CommunityTariffChangedEvent and UserTariffChangedEvent
- Update NotificationListener to notify members on tariff changes
- Add 27 comprehensive tests for TariffService
Frontend:
- Add AdminTariffComponent (/dashboard/tariffs) for managing community tariffs
- Add UserTariffComponent (/dashboard/my-tariffs) for managing user tariffs
- Add routing and navigation entries
- Regenerate OpenAPI spec and frontend API client
Note: Old Tariff.java entity replaced by CommunityTariff + UserTariff
- Replace alert() with ToastService in admin-user-approval and admin-energy-community
- Remove all console.error/console.warn statements from components and guards
- Fix admin-energy-community modal title (now shows 'Bearbeiten' in edit mode)
- Fix admin-user-approval table header ('Zählpunkt' -> 'Status')
- Remove broken header nav links (#so-gehts, #faq) that pointed to non-existent sections
- Externalize CORS origins via app.cors-origins property (configurable per environment)
- Remove hardcoded JWT secret fallback; use env-var-only with safe test default
- Disable show-sql by default (enable only in dev profile)
- Create application-dev.yml with safe development defaults
- Add missing RouterLink import in MyMembershipsComponent (fixes runtime error)
- Add DashboardControllerTest with 4 tests for admin and user dashboard endpoints
- Fix incorrect class name imports in header, admin-user-approval, metering-points, verify-email specs
- Add missing ActivatedRoute/Router/AuthService providers in all spec files
- Replace stub login spec with 10 comprehensive tests (form validation, role redirect, error handling)
- Remove stale 'should render title' test from app.spec.ts
- Create environment.ts with apiUrl constant
- Update all 6 services to use environment.apiUrl
- Update forgot-password and reset-password pages
- Update app.config.ts BASE_PATH provider
- Add UpdateMeteringPointRequest DTO (type-only update)
- Add PUT /{id} endpoint with owner and state validation
- Only NEW/REJECTED/ERROR states allow editing
- Frontend: inline edit form with type dropdown
- Frontend: updateMeteringPoint() service method
- Add 7 unit tests for update workflow
- Remove invalid JOIN FETCH mp.user from MembershipRepository query
(MeteringPoint has no @ManyToOne User field, only UUID userId)
- Fix OpenApiGeneratorTest: disable security filters for MockMvc,
use UTF-8 for getContentAsString and Files.writeString
Backend:
- Add deleteByIdAndUserId to MeteringPointRepository
- Add deleteOwnMeteringPoint with validation (owner, state checks)
- Add DELETE /{id} endpoint to MeteringPointController
Frontend:
- Add deleteMeteringPoint to MeteringPointService
- Add delete button with confirmation dialog
- Only show delete for inactive points (NEW, REJECTED, ERROR)
Business Rules:
- Only owner can delete own metering points
- Only inactive points (NEW, REJECTED, ERROR) can be deleted
- ACTIVE and WAITING_FOR_CONSENT points cannot be deleted
Tests:
- Add MeteringPointServiceTest with 10 unit tests
- All 37 tests passing
Backend:
- Add countByStatus() to MembershipRepository
- Add countByUserIdAndStatus() to MembershipRepository
- Add countByStatusAndEmailVerified() to UserRepository
- Add countByUserId() to MeteringPointRepository
- Optimize DashboardService to use count queries instead of findAll
Frontend:
- Add error signal and error message display
- Add loading spinner animation
Tests:
- Add DashboardServiceTest with 2 unit tests
- All 22 tests passing
Backend:
- Add MembershipResponse and PendingMembershipResponse DTOs
- Add GET /memberships/me and GET /admin/memberships/pending endpoints
- Add findByUserIdWithDetails and findPendingWithDetails queries
- Add getOwnMemberships and getPendingMemberships service methods
Frontend:
- Add membership service for API calls
- Add join-community page for users to browse and join communities
- Add my-memberships page for users to view their memberships
- Add admin-memberships page for admins to approve/reject requests
- Add routes and navigation items
Tests:
- Add MembershipServiceTest with 13 unit tests
- All 20 tests passing (UserServiceTest + MembershipServiceTest)
- Responsive navigation with mobile hamburger menu
- Reactive forms with real-time validation on profile page
- Toast service for success/error/warning messages
- HTTP error interceptor for 401/403/500 handling
- Loading states with spinner animations