import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthComponent } from './auth/auth.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { AuthGuard } from './service/auth-guard.service';
import { TransactionListComponent } from './transaction-list/transaction-list.component';
import { TransactionComponent } from './transaction/transaction.component';
import {ListAllLoansComponent} from './list-all-loans/list-all-loans.component';
import {LoanEditComponent} from './loan-edit/loan-edit.component';
import {LenderUploadsComponent} from './lender-uploads/lender-uploads.component';
import {BrokerLoanListComponent} from './broker-loan-list/broker-loan-list.component';
import {BrokerRewardComponent} from './broker-reward/broker-reward.component';
import {BrokerProfileComponent} from './profile/broker-profile/broker-profile.component';
import {ClientLoanListComponent} from './client-loan-list/client-loan-list.component';
import {ClientProfileComponent} from './client-profile/client-profile.component';
import {E403Component} from './e403/e403.component';
import {ListAllRewardsComponent} from './list-all-rewards/list-all-rewards.component';
import {AdminRewardByBrokerComponent} from './admin-reward-by-broker/admin-reward-by-broker.component';
import {RewardOverviewComponent} from './reward-overview/reward-overview.component';
import {RewardPaidComponent} from './reward-paid/reward-paid.component';
import {RewardUnpaidComponent} from './reward-unpaid/reward-unpaid.component';
import {PayInComponent} from './pay-in/pay-in.component';
import {PeopleAddComponent} from './people-add/people-add.component';
import {SettingsComponent} from './settings/settings.component';
import {ProfileComponent} from './profile/profile.component';
import {ListAllPeopleComponent} from './list-all-people/list-all-people.component';
import {ListIncomeComponent} from './list-income/list-income.component';
import {UploadDetailComponent} from './upload-detail/upload-detail.component';


const routes: Routes = [
  {path : '', component: DashboardComponent, canActivate: [AuthGuard]},
  {path : 'settings', component: SettingsComponent, canActivate: [AuthGuard]},
  {path : 'dashboard', component: DashboardComponent, canActivate: [AuthGuard] },
  {path : 'login', component: AuthComponent},
  {path : 'transaction', component: TransactionComponent, canActivate: [AuthGuard]},
  {path : 'transaction-list', component: TransactionListComponent, canActivate: [AuthGuard]},
  {path : 'list-all-loans', component: ListAllLoansComponent,  canActivate: [AuthGuard]},
  {path : 'edit-loan/:id', component: LoanEditComponent,  canActivate: [AuthGuard]},
  {path : 'edit-loan', component: LoanEditComponent,  canActivate: [AuthGuard]},
  {path : 'uploads', component: LenderUploadsComponent,  canActivate: [AuthGuard]},
  {path : 'uploads/:id', component: LenderUploadsComponent,  canActivate: [AuthGuard]},
  {path : 'broker-loan-list', component: BrokerLoanListComponent, canActivate: [AuthGuard] },
  {path : 'broker-reward', component: BrokerRewardComponent, canActivate: [AuthGuard] },
  {path : 'broker-profile', component: BrokerProfileComponent,  canActivate: [AuthGuard]},
  {path : 'client-loan-list', component: ClientLoanListComponent, canActivate: [AuthGuard] },
  {path : 'client-profile', component: ClientProfileComponent, canActivate: [AuthGuard] },
  {path : 'list-all-rewards', component: ListAllRewardsComponent, canActivate: [AuthGuard] },
  {path : 'list-reward-by-broker', component: AdminRewardByBrokerComponent , canActivate: [AuthGuard] },
  {path : 'reward-overview', component: RewardOverviewComponent, canActivate: [AuthGuard] },
  {path : 'reward-paid', component: RewardPaidComponent, canActivate: [AuthGuard] },
  {path : 'reward-unpaid', component: RewardUnpaidComponent, canActivate: [AuthGuard] },
  {path : 'pay-in', component: PayInComponent, canActivate: [AuthGuard] },
  {path : 'lender-uploads', component: LenderUploadsComponent, canActivate: [AuthGuard] },
  {path : 'list-all-people', component: ListAllPeopleComponent, canActivate: [AuthGuard] },
  {path : 'people-add', component: PeopleAddComponent, canActivate: [AuthGuard] },
  {path : 'profile', component: ProfileComponent, canActivate: [AuthGuard] },
  {path : 'profile/:id', component: ProfileComponent, canActivate: [AuthGuard] },
  {path : 'upload-details/:id', component: UploadDetailComponent, canActivate: [AuthGuard] },
  {path : 'list-income', component: ListIncomeComponent, canActivate: [AuthGuard] },
  {path : 'e403', component: E403Component },
];

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

}
