// COMMON-ANGULAR-MODULES

import { ModuleWithProviders } from '@angular/core'

// ROUTING

import { Routes, RouterModule } from '@angular/router';

//IMPORTED-PAGE-COMPONENTS

import { IndexComponent } from './index/index.component';
import { ChangepinComponent } from './changepin/changepin.component';
import { EditproviderComponent } from './editprovider/editprovider.component';
import { TransactionComponent } from './transaction/transaction.component';
import { AuthGuard } from './../providers/auth.guard';
import { AddDriverComponent } from './add-driver/add-driver.component';
import { ListDriverComponent } from './list-driver/list-driver.component';
import { EditDriverComponent } from './edit-driver/edit-driver.component';


const ModuleRoutes: Routes = [

{ path: 'delivery', component: IndexComponent, canActivate: [AuthGuard],
		children: [
			{ path: 'changepin', component: ChangepinComponent },
			{ path: 'editprovider',	component: EditproviderComponent },
			{path: '', component: TransactionComponent},
			{ path: 'driveradd', component: AddDriverComponent },
			{ path: 'driverlist', component: ListDriverComponent },
			{ path: 'driveredit/:id', component: EditDriverComponent },
		], data: {role: 3}
	}
];

export const moduleRouting: ModuleWithProviders = RouterModule.forChild(ModuleRoutes)

