- 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
98 lines
3.6 KiB
TypeScript
98 lines
3.6 KiB
TypeScript
import {Routes} from '@angular/router';
|
|
import {LandingPage} from './pages/landing-page/landing-page';
|
|
import {Register} from './pages/register/register';
|
|
import {LoginComponent} from './pages/login/login';
|
|
import {AdminUserApprovalComponent} from './pages/admin-user-approval/admin-user-approval';
|
|
import {authGuard} from './guards/auth-guard';
|
|
import {roleGuard} from './guards/role-guard';
|
|
import {DashboardLayout} from './layout/dashboard-layout/dashboard-layout';
|
|
import {DashboardOverview} from './pages/dashboard-overview/dashboard-overview';
|
|
import {AdminEnergyCommunity} from './pages/admin-energy-community/admin-energy-community';
|
|
import {VerifyEmailComponent} from './pages/verify-email/verify-email';
|
|
import {MeteringPointsComponent} from './pages/metering-points/metering-points';
|
|
import {ProfileComponent} from './pages/profile/profile';
|
|
import {JoinCommunityComponent} from './pages/join-community/join-community';
|
|
import {MyMembershipsComponent} from './pages/my-memberships/my-memberships';
|
|
import {AdminMembershipsComponent} from './pages/admin-memberships/admin-memberships';
|
|
import {ForgotPasswordComponent} from './pages/forgot-password/forgot-password';
|
|
import {ResetPasswordComponent} from './pages/reset-password/reset-password';
|
|
import {AdminTariffComponent} from './pages/admin-tariff/admin-tariff';
|
|
import {UserTariffComponent} from './pages/user-tariff/user-tariff';
|
|
import {ConsumptionDashboardComponent} from './pages/consumption-dashboard/consumption-dashboard';
|
|
import {UploadMeteringDataComponent} from './pages/upload-metering-data/upload-metering-data';
|
|
|
|
export const routes: Routes = [
|
|
{ path: '', component: LandingPage },
|
|
{ path: 'register', component: Register },
|
|
{ path: 'login', component: LoginComponent },
|
|
{ path: 'verify-email', component: VerifyEmailComponent },
|
|
{ path: 'forgot-password', component: ForgotPasswordComponent },
|
|
{ path: 'reset-password', component: ResetPasswordComponent },
|
|
{
|
|
path: 'dashboard',
|
|
component: DashboardLayout,
|
|
canActivate: [authGuard],
|
|
children: [
|
|
{ path: '', component: DashboardOverview },
|
|
{
|
|
path: 'metering-points',
|
|
component: MeteringPointsComponent,
|
|
canActivate: [roleGuard(['ADMIN', 'MEMBER'])]
|
|
},
|
|
{
|
|
path: 'join-community',
|
|
component: JoinCommunityComponent,
|
|
canActivate: [roleGuard(['MEMBER'])]
|
|
},
|
|
{
|
|
path: 'my-memberships',
|
|
component: MyMembershipsComponent,
|
|
canActivate: [roleGuard(['MEMBER'])]
|
|
},
|
|
{
|
|
path: 'admin-memberships',
|
|
component: AdminMembershipsComponent,
|
|
canActivate: [roleGuard(['ADMIN'])]
|
|
},
|
|
{
|
|
path: 'approvals',
|
|
component: AdminUserApprovalComponent,
|
|
canActivate: [roleGuard(['ADMIN'])]
|
|
},
|
|
{
|
|
path: 'energy-communities',
|
|
component: AdminEnergyCommunity,
|
|
canActivate: [roleGuard(['ADMIN'])]
|
|
},
|
|
{
|
|
path: 'tariffs',
|
|
component: AdminTariffComponent,
|
|
canActivate: [roleGuard(['ADMIN'])]
|
|
},
|
|
{
|
|
path: 'upload-metering-data',
|
|
component: UploadMeteringDataComponent,
|
|
canActivate: [roleGuard(['ADMIN'])]
|
|
},
|
|
{
|
|
path: 'my-tariffs',
|
|
component: UserTariffComponent,
|
|
canActivate: [roleGuard(['MEMBER'])]
|
|
},
|
|
{
|
|
path: 'consumption',
|
|
component: ConsumptionDashboardComponent,
|
|
canActivate: [roleGuard(['MEMBER'])]
|
|
},
|
|
{
|
|
path: 'profile',
|
|
component: ProfileComponent,
|
|
canActivate: [roleGuard(['ADMIN', 'MEMBER'])]
|
|
}
|
|
]
|
|
},
|
|
|
|
// Wildcard-Fallback für unbekannte URLs
|
|
{ path: '**', redirectTo: '' }
|
|
];
|