import { Routes } from '@angular/router';
import { LoginComponent } from './authenticate/login/login.component';
import { ChangePasswordComponent } from './user-management/change-password/change-password.component';
import { FullLayoutComponent } from './full-layout/full-layout.component';
import { GAuth } from './shared/guards/gauth.guard';

export const routes: Routes = [
    {
        path: 'login',
        component: LoginComponent
    },
    {
        path: 'changepassword',
        component: ChangePasswordComponent
    },
    {
        path: '',
        redirectTo: 'login',
        pathMatch: 'full'
    },
    {
        path: 'home',
        component: FullLayoutComponent,
        canActivate: [GAuth],
        children: [
            {
                path: '',
                redirectTo: 'dashboard',
                pathMatch: 'full'
            },
            {
                path: 'dashboard',
                loadComponent: () =>
                    import('./dashboard/dashboard.component').then(
                        m => m.DashboardComponent
                    )
            },
            {
                path: 'permissions',
                loadComponent: () =>
                    import('./user-permissions/user-permissions.component').then(
                        m => m.UserPermissionsComponent
                    )
            },
            {
                path: 'smsLogger',
                loadComponent: () =>
                    import('./sms-banking/sms-banking.component').then(
                        m => m.SmsBankingComponent
                    )
            },
            {
                path: 'smsGateway',
                loadComponent: () =>
                    import('./sms-gateway/sms-gateway.component').then(
                        m => m.SmsGatewayComponent
                    )
            },
            {
                path: 'loggerManager',
                loadComponent: () =>
                    import('./logging/logging.component').then(
                        m => m.LoggingComponent
                    )
            },
            {
                path: 'analysis',
                loadComponent: () =>
                    import('./data-analysis/data-analysis.component').then(
                        m => m.DataAnalysisComponent
                    )
            },
            {
                path: 'ibUnblockUser',
                loadComponent: () =>
                    import('./ib-support/ib-unblock-user/ib-unblock-user.component').then(
                        m => m.IbUnblockUserComponent
                    )
            },
            {
                path: 'feedbackSetup',
                loadComponent: () =>
                    import('./ib-support/feedback-setup/feedback-setup.component').then(
                        m => m.FeedbackSetupComponent
                    )
            },
            {
                path: 'purposeSetup',
                loadComponent: () =>
                    import('./ib-support/tran-purpose-setup/tran-purpose-setup.component').then(
                        m => m.TranPurposeSetupComponent
                    )
            },
            {
                path: 'thirdPartyRegistration',
                loadComponent: () =>
                    import('./user-management/third-party-registration/third-party-registration.component').then(
                        m => m.ThirdPartyRegistrationComponent
                    )
            },
            {
                path: 'setupUser',
                loadComponent: () =>
                    import('./user-management/setup-user/setup-user.component').then(
                        m => m.SetupUserComponent
                    )
            },
            {
                path: 'resetPassword',
                loadComponent: () =>
                    import('./user-management/reset-password/reset-password.component').then(
                        m => m.ResetPasswordComponent
                    )
            },
            {
                path: 'changePassword',
                loadComponent: () =>
                    import('./user-management/change-password/change-password.component').then(
                        m => m.ChangePasswordComponent
                    )
            }
        ]
    },
    {
        path: '**',
        redirectTo: 'home/dashboard'
    }
];
