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 { AuthenticationGuard } from './shared/guards/authentication.guard';
import { ActivityGuard } from './shared/guards/activity.guard';

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

        ]
    },
    {
        path: '**',
        redirectTo: 'home/dashboard'
    }
];
