Commit Graph

104 Commits

Author SHA1 Message Date
9304a5b6de fix(frontend): testcommit 2026-07-27 16:05:29 +02:00
988a317e55 fix(frontend): testcommit 2026-07-27 15:57:11 +02:00
118ed62970 fix(frontend): testcommit 2026-07-27 14:41:09 +02:00
52dee79136 fix(frontend): testcommit 2026-07-27 14:38:22 +02:00
8d9a568ca7 fix(frontend): testcommit 2026-07-27 14:31:30 +02:00
83b6d503cc fix(frontend): Dockerfile for build 2026-07-27 13:19:26 +02:00
61968f7f82 fix(frontend): Dockerfile for build 2026-07-27 12:57:38 +02:00
3e33bb797a fix(frontend): Dockerfile for build 2026-07-27 12:53:46 +02:00
6dce65b39c fix(frontend): Dockerfile for build 2026-07-27 12:10:19 +02:00
dac44dcb7d fix(frontend): align @angular/platform-browser-dynamic version to ^21.2.0
Fixed peer dependency conflict by updating @angular/platform-browser-dynamic
from ^20.0.7 to ^21.2.0 to match the rest of the Angular 21 packages.
2026-07-25 17:52:59 +02:00
675c10b949 feat(mako): add admin-selectable EDA communication method (email vs messenger)
- Add EdaCommunicationMethod enum (EMAIL, MESSENGER)
- Add EdaSettings entity with DB-persisted communication method
- Add AdminEdaSettingsController (GET/PUT /api/admin/eda-settings)
- Add EdaCommunicationRouter that resolves the correct EdaConsentService
- Add MessengerEdaConsentService as placeholder (throws UnsupportedOperationException)
- Add AdminEdaSettingsComponent in frontend with radio button selection
- Route /dashboard/admin-eda-settings (ADMIN only)
- Update EdaCommunicationEventListener to use router
- Remove @Profile from EmailEdaConsentService/SimulatedEdaConsentService
- Use @Lazy for EdaMailSender dependency to support non-prod contexts
- Fix pre-existing deleteUserTariff API call mismatch
2026-07-25 15:29:58 +02:00
459f976b67 feat(mako): add email-based EDA communication
- Add EmailEdaConsentService for prod consent requests via SMTP
- Add EdaMailSender, EdaMailParser, EdaMailPoller for IMAP polling
- Polling interval: 15 min (configurable via eda.email.poll-interval-ms)
- Consumption data ingestion from XLSX email attachments
- Add @Profile('!prod') to SimulatedEda*Services as fallback
- Add EMAIL_AUTO to DataSource enum for automated email imports
- Add EDA email configuration to application-prod.yml and application-dev.yml
- Add unit tests for all new services
- Add docs/PLAN-EDA-KOMMUNIKATION.md with full implementation plan

All 232 tests passing.
2026-07-25 15:29:43 +02:00
6cb4ff7a4a fix(frontend): add missing provideEcharts() to app config causing empty dashboard chart
Root cause: ngx-echarts v18+ requires provideEcharts() in the app
config. Without it, NgxEchartsDirective silently fails to render
charts, causing the dashboard overview chart to appear empty.

Added provideEcharts() to app.config.ts and added
DashboardServiceIntegrationTest for the metering data overview endpoint.
2026-07-24 15:57:35 +02:00
0ef4f94933 fix(frontend): add error handling for dashboard overview metering data API
The empty error callback in loadMeteringData() silently swallowed API
failures, causing the chart to show 'Keine Daten' instead of the actual
error. Added proper error logging and user-facing error message.

Also added DashboardServiceTest for getMeteringDataOverview with
scenarios for data, no metering points, empty time range, and
multiple metering points.
2026-07-24 15:27:36 +02:00
cfe989c426 fix(frontend): append UTC offset to Instant date parameters in consumption dashboard
The consumption dashboard sent dates like '2026-06-24T00:00:00' without
timezone offset, which Spring could not parse into java.time.Instant.
Append 'Z' suffix to produce valid ISO-8601 UTC timestamps.
2026-07-24 15:03:22 +02:00
b1f38e752b feat(frontend): group dashboard sidebar navigation into sections
Add section-based grouping to the sidebar navigation with headers and
dividers. Menu items are now organized into 4 sections:
- Allgemein (Übersicht, Zählpunkte, Mein Profil)
- Community (Community beitreten, Meine Mitgliedschaften, Verbrauch)
- Tarife & Einladungen (Meine Tarife, Einladungen)
- Verwaltung (Admin-only: Mitgliedschaften, Benutzerverwaltung, etc.)

Only sections with visible items for the current role are rendered.
All 107 frontend tests passing.
2026-07-24 14:12:26 +02:00
fb53b169a2 fix(community): migrate metering data timestamps from LocalDateTime to Instant to fix DST constraint violation
Switch interval_start/interval_end from LocalDateTime to Instant across the
entire metering data stack (entity, DTOs, parser, repository, services, controllers).
This eliminates DST-related unique constraint violations that occurred when two
different wall-clock times mapped to the same epoch millis during CET/CEST transitions.

Key changes:
- MeteringData entity: intervalStart/intervalEnd now Instant
- XlsxMeteringDataParser: produces Instant via JVM timezone conversion
- MeteringDataRepository: all queries use Instant parameters
- MeteringDataService: simplified deduplicate() (Instant has no DST ambiguity)
- Added hibernate.jdbc.time_zone=UTC and test profile for in-memory H2
- Added MeteringDataUploadIntegrationTest with real H2 database
- Added DST-specific parser and service tests
- All 216 tests passing
2026-07-24 13:23:35 +02:00
cfc32b3a7d chore: cleanup test data and add missing test files
- Add TariffInviteServiceTest, GlobalExceptionHandlerTest, setup-test.ts
- Add compose plans/specs docs
- Extend .gitignore with *.xlsx, *.ps1, *.http, *.py, *.docx
- Remove stale test data files and scripts from working tree
2026-07-24 11:48:56 +02:00
2bb0f7114b refactor(community,tariff): fix code review findings - redundant DB queries, inconsistent imports, overly broad cascade
- TariffService: extract ValidatedUserTariffPoints record from validateUserTariffRequest to eliminate redundant MeteringPoint loads in createUserTariff/updateUserTariff (saves 2 SELECT queries per create call)
- TariffService: move source != target check into validateUserTariffRequest for single-responsibility
- MeteringPoint: restrict CascadeType from ALL to PERSIST/MERGE and remove orphanRemoval to prevent accidental cascade deletes of independent Memberships
- MeteringPointService, MembershipService, MeteringDataService, TariffInviteService, TariffService: replace FQ org.springframework.security.access.AccessDeniedException with imported short form for consistency
2026-07-24 10:24:38 +02:00
1b66b25ada docs: add final compose report for code-review critical fixes 2026-07-24 10:13:37 +02:00
c6dfa31839 fix(frontend): pass userId to deleteUserTariff API to fix compilation error
The generated API service requires userId as a second parameter for
deleteUserTariff(). Inject AuthService and use getCurrentUserId() to
provide the required argument, unblocking the entire frontend test suite.
2026-07-24 09:43:37 +02:00
c36588dae7 Merge branch 'mimocode/tidy-tiger' into master 2026-07-24 09:35:45 +02:00
54f45d6bf7 test(frontend): fix vitest test infrastructure and admin-user-approval tests
- Add vitest.config.ts for Angular 21 @angular/build:unit-test runner
- Install @angular/platform-browser-dynamic for TestBed initialization
- Regenerate API client from OpenAPI spec (npm run generate-api)
- Fix spec: use includes() for URL matching (generated API prepends basePath)
- Fix spec: 'should not reload' test assertion (0 not 1) for no-reload behavior
- All 107 frontend tests now pass (17 test files)
2026-07-24 09:33:19 +02:00
38e5fb3505 fix(frontend): regenerate API client from OpenAPI spec and fix deleteUserTariff type error 2026-07-24 09:15:54 +02:00
43f3bb6d8a test(frontend): enhance AdminMembershipsComponent tests and fix deleteUserTariff compilation error
- Expand admin-memberships spec from 19 to 42 tests covering:
  approve/reject API calls, isProcessing guards, error handling,
  loading states, tab switching, card/table views, empty states
- Fix deleteUserTariff missing userId argument in user-tariff.ts
  (required after backend API change)
2026-07-24 08:25:00 +02:00
71ecf47948 test(frontend): enhance AdminUserApprovalComponent tests with full coverage
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
2026-07-24 08:12:32 +02:00
e46b21c8ca test(backend): add OpenAPI spec assertions + regenerate frontend API client
- Add acceptance criteria assertions to OpenApiGeneratorTest:
  - Verify /api/community/admin/memberships path exists
  - Verify /api/admin/users path exists
  - Verify getAllUsers operation exists
- Regenerate frontend API client from OpenAPI spec
- Fix frontend type error: remove unnecessary userId parameter
  from deleteUserTariff call (backend uses @CurrentUserId from JWT)
2026-07-24 07:30:26 +02:00
3e336ca3c9 feat(iam): add @PrePersist callback to auto-populate User.createdAt
Add onCreate() method with @PrePersist annotation that sets createdAt
to LocalDateTime.now() on first persist, consistent with other entities
(UserTariff, CommunityTariff, etc.). Guard prevents overwriting existing
values. Two new tests verify auto-population and idempotency.
2026-07-24 07:11:52 +02:00
f1cf152091 chore: update OpenAPI spec, Angular config, and dev application settings 2026-07-23 15:03:17 +02:00
ffa501e89f feat(frontend): add producer and consumer invite pages with navigation 2026-07-23 15:03:05 +02:00
4fdc2d5f7a feat(frontend): add metering data chart to dashboard overview with ECharts 2026-07-23 15:02:51 +02:00
a8686718db chore(iam): enhance dev data initialization with test metering points and communities 2026-07-23 15:02:35 +02:00
765cbb0ec7 feat(dashboard): add metering data overview endpoint for user dashboard 2026-07-23 15:02:23 +02:00
5ff22e53bd feat(community): improve metering data upload with batch processing and deduplication 2026-07-23 15:02:02 +02:00
85d8bc0011 docs: add final compose report for admin overview extensions 2026-07-23 14:59:49 +02:00
ef933ed0ea feat(frontend): add tab navigation and table view to AdminMembershipsComponent
- 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
2026-07-23 14:46:27 +02:00
dbd39643aa Merge branch 'mimocode/curious-nebula' 2026-07-23 14:33:24 +02:00
2bf1d49af1 feat(frontend): add tab navigation and all-users table to AdminUserApprovalComponent
- 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
2026-07-23 14:32:02 +02:00
344587486a feat(community): add getAllMemberships() to frontend MembershipService
Add method to fetch all admin memberships via GET /api/community/admin/memberships
with corresponding unit tests using Angular HttpClientTestingModule.
2026-07-23 14:22:35 +02:00
cab55c4abb Merge branch 'mimocode/cosmic-comet' of C:\Users\postm\.local\share\mimocode\worktree\f2606916-b9e4-4ea6-bb06-b44029fd350f\cosmic-comet 2026-07-23 14:17:46 +02:00
2261ffbbd3 feat-common-regenerate-openapi-spec 2026-07-23 14:16:35 +02:00
fe4ca2ccbd test(iam,community): add tests for getAllMemberships and getAllUsers
- Add getAllMemberships_returnsAllStatuses: verifies PENDING, ACTIVE, INACTIVE
- Add getAllMemberships_collectsDistinctUserIds: verifies distinct user ID collection
- Add getAllUsers_returnsSortedByCreatedAtDesc: verifies sorting order
- Add getAllUsers_returnsEmptyList: edge case for empty user list
- Add getAllUsers_includesAllRegistrationStatuses: verifies all statuses present
- All 172 backend tests pass
2026-07-23 14:13:14 +02:00
cf59de80bc feat(iam): add GET /api/admin/users endpoint for all-users overview 2026-07-23 14:07:13 +02:00
41e489a2dd Merge branch 'mimocode/clever-garden' 2026-07-23 14:03:14 +02:00
b7d7e22570 feat(iam): add AdminIamService.getAllUsers() 2026-07-23 14:02:23 +02:00
3fbf717bd5 feat(community): add GET /admin/memberships endpoint with tests 2026-07-23 13:59:53 +02:00
0092301ef4 Merge branch 'mimocode/misty-squid' 2026-07-23 13:55:55 +02:00
727105a92d Merge branch 'mimocode/proud-moon' 2026-07-23 13:55:47 +02:00
b80b22ea46 feat(iam): add UserRepository.findAllByOrderByCreatedAtDesc()
Add method to retrieve all users ordered by creation date descending.
This supports the admin user management overview feature.

Tests:
- UserRepositoryTest: verify method exists and returns List<User>
2026-07-23 13:54:51 +02:00
a426a91cfa feat(community): add getAllMemberships() to MembershipService
Add @Transactional(readOnly = true) method that uses findAllWithDetails()
and batch-fetches users with the same lookup pattern as getPendingMemberships().
Returns List<PendingMembershipResponse> with all memberships (pending, active,
inactive) for the admin overview tab.

Tests: 3 new tests covering normal case, empty list, and missing user.
2026-07-23 13:53:04 +02:00