// COMMON-ANGULAR-MODULES

import { ModuleWithProviders } from '@angular/core';

// ROUTING

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

import { RoleGuard } from './../providers/role-guard.service';

//IMPORTED-PAGE-COMPONENTS

import { IndexComponent } from './index/index.component';
import { AddproviderComponent} from './addprovider/addprovider.component';
import { EditproviderComponent } from './editprovider/editprovider.component';
import { ManageproviderComponent } from './manageprovider/manageprovider.component';
import { ForexproviderComponent } from './forexprovider/forexprovider.component';
import { HomeComponent } from './home/home.component';
import { ChangepinComponent } from './changepin/changepin.component';
import { CurrencyAddComponent } from './currency-add/currency-add.component';
import { AuthGuard } from './../providers/auth.guard';
import { AddforexComponent } from './addforex/addforex.component';
import { EditforexComponent } from './editforex/editforex.component';
import { CurrencyEditComponent } from './currency-edit/currency-edit.component';
import { CurrencyListComponent } from './currency-list/currency-list.component';


const ModuleRoutes: Routes = [

	{ path: 'maker', component: IndexComponent, canActivate: [AuthGuard],
		children: [
			{ path: 'provider_delivery', component: AddproviderComponent },
			{ path: 'delivery_edit/:id', component: EditproviderComponent },
			{ path: 'delivery', component: ManageproviderComponent },
			{ path: 'forex', component: ForexproviderComponent },
			{ path: 'provider_forex', component: AddforexComponent },
			{ path: 'forex_edit/:id', component: EditforexComponent },
			{ path: 'home', component: HomeComponent },
			{ path: 'changepin', component: ChangepinComponent },
			{ path: 'currency_add', component: CurrencyAddComponent},
			{ path: 'currency_edit/:id', component: CurrencyEditComponent},
			{ path: 'currency_list', component: CurrencyListComponent}
		], data: {role: 1}
	}
];

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

