import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { DashboardComponent } from './pages/layout/dashboard/dashboard.component';
import { AuthGuard } from '../auth.guard';
import {LoginComponent} from './pages/security/login.component';
import {ListUsersComponent} from './pages/list-users/list-users.component';
import {EditParametersComponent} from './pages/parameters/edit-parameters.component';
import {EditSupplierComponent} from './pages/supplier/edit-supplier.component';
import {ListSupplierComponent} from './pages/supplier/list-supplier.component';
import {ListSocServicesComponent} from './pages/soc-service/list-soc-services.component';
import {EditSocServiceComponent} from './pages/soc-service/edit-soc-service.component';
import {JournalComponent} from './pages/journal/journal.component';

const routes: Routes = [
  {
    path: '',
    canActivateChild: [AuthGuard],
    children: [
      {path: '', redirectTo: '/dashboard', pathMatch: 'full'},
      {path: 'dashboard', component: DashboardComponent},
      {path: 'login', component: LoginComponent},
      {path: 'journal', component: JournalComponent},
      {path: 'list-users', component: ListUsersComponent},
      {path: 'edit-parameters', component: EditParametersComponent},
      {path: 'list-supplier', component: ListSupplierComponent},
      {path: 'edit-supplier/:id', component: EditSupplierComponent},
      {path: 'list-soc-service', component: ListSocServicesComponent},
      {path: 'edit-soc-service/:id', component: EditSocServiceComponent},
    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes),
  ],
  exports: [
    RouterModule,
  ],
})
export class AppRoutingModule {
}
