import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from './guard/auth.guard';
import { AuthoriginGuard } from './guard/authorigin.guard';
const routes: Routes = [
  {
    path: '',
    redirectTo: 'landing',
    pathMatch: 'full'
  },
  { path: 'landing', loadChildren: './pages/landing/landing.module#LandingPageModule' },
  { path: 'login', loadChildren: './pages/auth/login/login.module#LoginPageModule' },
  { path: 'register', loadChildren: './pages/auth/register/register.module#RegisterPageModule' },
  { path: 'forgot', loadChildren: './pages/auth/forgot/forgot.module#ForgotPageModule' },

  { path: 'dashboard', loadChildren: './pages/dashboard/dashboard.module#DashboardPageModule', canActivate: [AuthGuard] },
  { path: 'home', loadChildren: './home/home.module#HomePageModule', canActivate: [AuthGuard] },
  { path: 'verify', loadChildren: './verify/verify.module#verifyPageModule', canActivate: [AuthoriginGuard]},
  { path: 'category/:category', loadChildren: './pages/category/category.module#CategoryPageModule', canActivate: [AuthGuard] },
  { path: 'addcard', loadChildren: './pages/card/addcard/addcard.module#AddcardPageModule', canActivate: [AuthGuard] },
  { path: 'cards', loadChildren: './pages/card/cards/cards.module#CardsPageModule', canActivate: [AuthGuard] },
  { path: 'postulations', loadChildren: './pages/postulations/postulations.module#PostulationsPageModule', canActivate: [AuthGuard] },
  { path: 'contracts', loadChildren: './pages/contracts/contracts.module#ContractsPageModule', canActivate: [AuthGuard] },
  { path: 'viewsuppliers/:postulation_id', loadChildren: './pages/contracts/viewsuppliers/viewsuppliers.module#ViewsuppliersPageModule', canActivate: [AuthGuard] },
  { path: 'hire', loadChildren: './pages/contracts/hire/hire.module#HirePageModule', canActivate: [AuthGuard] },
  { path: 'start', loadChildren: './pages/contracts/start/start.module#StartPageModule', canActivate: [AuthGuard]},
  { path: 'review/:contract_id', loadChildren: './pages/contracts/review/review.module#ReviewPageModule', canActivate: [AuthGuard] },
  { path: 'report/:contract_id', loadChildren: './pages/contracts/report/report.module#ReportPageModule', canActivate: [AuthGuard] },
  { path: 'reports', loadChildren: './pages/reports/reports.module#ReportsPageModule', canActivate: [AuthGuard]},
  { path: 'nohome/:contract_id', loadChildren: './pages/contracts/nohome/nohome.module#NohomePageModule', canActivate: [AuthGuard] },
  { path: 'extra', loadChildren: './pages/contracts/extra/extra.module#ExtraPageModule', canActivate: [AuthGuard] },
  { path: 'ended', loadChildren: './pages/postulations/ended/ended.module#EndedPageModule', canActivate: [AuthGuard]  },
  { path: 'hero', loadChildren: './pages/hero/hero.module#HeroPageModule', canActivate: [AuthGuard] },
  { path: 'comments', loadChildren: './pages/contracts/viewsuppliers/comments/comments.module#CommentsPageModule', canActivate: [AuthGuard]  },
  { path: 'faq', loadChildren: './pages/faq/faq.module#FaqPageModule',  canActivate: [AuthGuard]  },
];
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {}
