import {RouterModule, Routes} from "@angular/router";
import {NgModule} from "@angular/core";
import {
  AuthenticationGuard,
  ConfirmExitGuard
} from "@webbpm/base-package";

const routes: Routes = [
  {
    path: 'user-management',
    canActivate: [AuthenticationGuard],
    children: [
      {
        path: 'users',
        loadChildren: 'generated-sources/page-user-management-users.module#PageusermanagementusersModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'users/new',
        loadChildren: 'generated-sources/page-user-management-user-create.module#PageusermanagementusercreateModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'users/:id',
        loadChildren: 'generated-sources/page-user-management-user-edit.module#PageusermanagementusereditModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'org-units',
        loadChildren: 'generated-sources/page-user-management-org-units.module#PageusermanagementorgunitsModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'org-units/new',
        loadChildren: 'generated-sources/page-user-management-org-unit.module#PageusermanagementorgunitModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'org-units/:id',
        loadChildren: 'generated-sources/page-user-management-org-unit.module#PageusermanagementorgunitModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'roles',
        loadChildren: 'generated-sources/page-user-management-roles.module#PageusermanagementrolesModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'roles/new',
        loadChildren: 'generated-sources/page-user-management-role.module#PageusermanagementroleModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'roles/:id',
        loadChildren: 'generated-sources/page-user-management-role.module#PageusermanagementroleModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'groups',
        loadChildren: 'generated-sources/page-user-management-groups.module#PageusermanagementgroupsModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'groups/new',
        loadChildren: 'generated-sources/page-user-management-group-create.module#PageusermanagementgroupcreateModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'groups/:id',
        loadChildren: 'generated-sources/page-user-management-group-edit.module#PageusermanagementgroupeditModule',
        canActivate: [ConfirmExitGuard]
      },
      {
        path: 'authorities',
        loadChildren: 'generated-sources/page-user-management-authorities.module#PageusermanagementauthoritiesModule',
        canActivate: [ConfirmExitGuard]
      }
    ]
  }
];

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

}
