Commit Graph

91 Commits

Author SHA1 Message Date
a90b7ecc7e fix(frontend): replace alert() with ToastService, remove console.*, fix UI bugs
- 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
2026-07-22 09:25:50 +02:00
fea8332976 refactor(mako,common): configurable topology delay, ThreadPool executor, event listener tests
- SimulatedEdaTopologyService: topology delay configurable via eda.simulation.topology-delay-ms
- Add AsyncConfig with ThreadPoolTaskExecutor (4 core, 8 max threads)
- Remove @EnableAsync from EegPortalApplication (now in AsyncConfig)
- Add topology-delay-ms and consent-delay-ms to application-dev.yml
- Add MakoConsentListenerTest (4 tests)
- Add MeteringPointEventListenerTest (5 tests)
- Add NotificationListenerTest (8 tests)
2026-07-22 09:21:25 +02:00
7baa1c72af refactor(common,community,mako): fix typos and remove dead code
- Rename MakoConsens* -> MakoConsent* (3 event classes + listener)
- Rename EdaCommuncationEventListener -> EdaCommunicationEventListener
- Rename PointType.PROSUME -> PROSUMER
- Remove dead SecurityConfig admin path matchers (actual security via @PreAuthorize)
- Regenerate OpenAPI spec and frontend API client
2026-07-22 09:15:27 +02:00
6770be9bef fix(security): externalize CORS origins, secure JWT secret default, fix RouterLink import
- 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)
2026-07-22 09:09:36 +02:00
0bfa0d98d5 test(dashboard,frontend): add DashboardControllerTest, fix broken spec files and add login tests
- 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
2026-07-22 08:39:58 +02:00
c180d6fd32 fix(frontend): replace HttpClient with generated AuthenticationService in verify-email 2026-07-22 08:39:37 +02:00
ef4eefa4cd fix(dashboard): fix NullPointerException in getUserDashboard
- @CurrentUserId resolves to String (JWT userId claim), not User entity
- Change parameter type from User to String, parse to UUID
2026-07-22 08:06:45 +02:00
56f8636f90 docs(common): add conventional commits guideline and environment config to AGENTS.md
- Add dedicated Conventional Commits section with types and examples
- Document environment.ts as API URL configuration source
- Add to important files table
2026-07-22 07:56:52 +02:00
d87f6fe95b fix(frontend): activate landing page buttons and add forgot-password link
- Landing page: 'Jetzt Ersparnis berechnen' links to /register
- Landing page: 'Mehr erfahren' links to /dashboard
- Landing page: remove empty li element
- Login page: add 'Passwort vergessen?' link to /forgot-password
2026-07-22 07:50:49 +02:00
20787395ab refactor(frontend): replace hardcoded localhost URLs with environment config
- 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
2026-07-22 07:50:38 +02:00
93aa9fdff3 fix(security): externalize JWT secret via environment variable
- jwt.secret now reads from JWT_SECRET env var
- Falls back to dev default if not set
2026-07-22 07:50:27 +02:00
9c147adadd docs: update AGENTS.md with testing, API generation, and architecture details
- Add test commands and patterns (JUnit 5, Mockito, Vitest)
- Document OpenAPI generation workflow (OpenApiGeneratorTest)
- Add EDA simulation details (magic values, @Profile behavior)
- Correct admin endpoint paths
- Add important files table including OpenApiGeneratorTest
2026-07-22 07:42:56 +02:00
8546dcc508 test(iam,community): add unit tests for AuthService, AdminIamService, EnergyCommunityService
- AuthServiceTest: register, login, verifyEmail (7 tests)
- AdminIamServiceTest: approve, reject, getPendingUsers (7 tests)
- EnergyCommunityServiceTest: CRUD, member counts, delete guards (9 tests)
2026-07-22 07:42:47 +02:00
a9329b309f feat(frontend): wire notification component into dashboard header
- Import NotificationComponent in DashboardLayout
- Add bell icon with unread badge to dashboard header
2026-07-22 07:42:36 +02:00
cadd5a697e feat(community): add metering point update endpoint and UI
- 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
2026-07-22 07:42:22 +02:00
caf282cb1e fix(mako): fix findPendingWithDetails query and OpenApiGeneratorTest
- 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
2026-07-22 07:41:52 +02:00
b0145f3b30 fix(security): fix critical security and error handling issues
Security:
- Change permitAll() to denyAll() for unlisted routes
- Add @PreAuthorize to membership endpoints
- Add ownership check in requestMembership
- Use AccessDeniedException instead of SecurityException

Error Handling:
- Add proper exception mapping for IllegalArgumentException (400)
- Add proper exception mapping for IllegalStateException (409)
- Add proper exception mapping for AccessDeniedException (403)
- Remove internal error messages from generic exception handler

Tests:
- Update MembershipServiceTest for new method signature
- Update MeteringPointServiceTest for AccessDeniedException
- All 37 tests passing
2026-07-21 16:27:35 +02:00
96bcf57cee feat(community): add metering point deletion with business rules
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
2026-07-21 15:06:48 +02:00
04be9a62ea feat(iam): add complete notification system with email and in-app notifications
Backend:
- Generalize MailService with send() method
- Add Notification entity, repository, service, controller
- Add NotificationListener for 6 domain events
- Add password reset flow (forgot-password, reset-password)
- Add configurable frontend URL in application.yml

Frontend:
- Add notification service and bell-icon component
- Add forgot-password and reset-password pages
- Add routes for new pages

Tests:
- Add NotificationServiceTest with 5 unit tests
- All 27 tests passing
2026-07-21 13:38:15 +02:00
a2025a55e4 fix(dashboard): optimize stats queries and add error handling
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
2026-07-21 13:07:19 +02:00
c66c5fddfa feat(community): add complete membership flow with unit tests
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)
2026-07-21 12:42:07 +02:00
838fdb2826 feat(frontend): add responsive design, form validation, toast service and error handling
- 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
2026-07-21 12:08:39 +02:00
05ec18d550 fix(mako): use @EventListener instead of @TransactionalEventListener
The MakoConsensListener was not being triggered because the event was
published from a ScheduledExecutorService thread without transaction
context. Changed to @EventListener @Transactional to fix this.
2026-07-21 11:42:52 +02:00
9d3fba05d6 docs: add conventional commits guideline to AGENTS.md 2026-07-21 11:15:40 +02:00
52c6641b3a add user profile management
- Add UserController with GET/PUT /me, PUT /me/password, PUT /me/email
- Add UserService with profile update, password change, email change
- Add UserServiceTest with 7 unit tests
- Add IamDtos: UpdateProfileRequest, ChangePasswordRequest, ChangeEmailRequest
- Add Angular profile page with edit profile, change password, change email
- Add Angular UserService for profile API calls
- Add profile route and navigation item
2026-07-21 11:12:20 +02:00
8f74dbde35 complete MaKo consent flow and admin initialization
- Add MakoConsensListener for consent event handling (approved/rejected/failed)
- Add AdminDataInitializer with random password generation for dev profile
- Add findByAtNumber to MeteringPointRepository
- Fix User.isEnabled() Lombok/Spring Security conflict
- Update pom.xml with explicit Lombok 1.18.38 version
- Update .gitignore for frontend, H2, and test files
- Add AGENTS.md project documentation
2026-07-21 10:01:19 +02:00
70e05e524b added meteringpoint management 2026-07-05 15:08:01 +02:00
2e9790b3b2 simplified user registration process 2026-07-05 14:36:26 +02:00
59a0b6b9b7 generalized dashboard for member and admin 2026-07-05 10:49:46 +02:00
caf05d3103 implemented delete of energy community 2026-07-01 12:57:01 +02:00
7d485f4079 error handling for existing meteringpoints 2026-06-24 09:57:18 +02:00
8b57f97d88 fixed Dto mapping in EnergyCommunityAdminController and openapi definition 2026-06-24 08:33:15 +02:00
81ee804ae1 added basic eg managment 2026-06-23 14:34:06 +02:00
ad47f7399e added admin approval list
implemented approval (untested)
implemented eda consent simulation (untested)
2026-06-17 11:08:44 +02:00
5f845833cb refactoring, adaption, community membership handing start implementing 2026-06-15 10:10:33 +02:00
ab28328408 admin user approval implemented 2026-06-10 17:17:44 +02:00
a46566f8c6 extended user registration process, initial event based processing 2026-06-08 15:59:42 +02:00
9bb354a805 finished login 2026-06-03 15:09:29 +02:00
e25bae9700 added header, started implementing login 2026-06-03 13:40:51 +02:00
4ef6d32093 first working frontend/backend 2026-06-01 16:59:49 +02:00
70ed6efdc4 first commit 2026-05-22 08:59:13 +02:00