import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { UserPreferencesComponent } from './preferences/userPreferences/userPreferences.component';
import { ClientPreferencesComponent } from './preferences/clientPreferences/clientPreferences.component';
import { PreferencesComponent } from './preferences/preferences/preferences.component';
import { RouteDefinitionsComponent } from './laboratory/routeDefinitions/routeDefinitions.component';

import { RouteTypesComponent } from './laboratory/routeTypes/routeTypes.component';
import { RouteScheduleDetailsComponent } from './laboratory/routeScheduleDetails/routeScheduleDetails.component';
import { RouteSchedulesComponent } from './laboratory/routeSchedules/routeSchedules.component';
import { RouteStopsComponent } from './laboratory/routeStops/routeStops.component';
import { ClinicsComponent } from './laboratory/clinics/clinics.component';
import { CreateEditClinicComponent } from './laboratory/clinics/create-or-edit-clinic.component';
import { ClinicScheduleComponent } from './laboratory/clinics/clinic-schedule.component';
import { DashboardComponent } from './dashboard/dashboard.component';

@NgModule({
    imports: [
        RouterModule.forChild([
            {
                path: '',
                children: [
                    { path: 'preferences/userPreferences', component: UserPreferencesComponent, data: { permission: 'Pages.UserPreferences' }  },
                    { path: 'preferences/clientPreferences', component: ClientPreferencesComponent, data: { permission: 'Pages.ClientPreferences' }  },
                    { path: 'preferences/preferences', component: PreferencesComponent, data: { permission: 'Pages.Preferences' }  },
                    { path: 'laboratory/routeDefinitions', component: RouteDefinitionsComponent, data: { permission: 'Pages.RouteDefinitions' }  },
                    { path: 'laboratory/routeTypes', component: RouteTypesComponent, data: { permission: 'Pages.RouteTypes' }  },
                    { path: 'laboratory/routeScheduleDetails', component: RouteScheduleDetailsComponent, data: { permission: 'Pages.RouteScheduleDetails' }  },
                    { path: 'laboratory/routeSchedules', component: RouteSchedulesComponent, data: { permission: 'Pages.RouteSchedules' }  },
                    { path: 'laboratory/routeStops', component: RouteStopsComponent, data: { permission: 'Pages.RouteStops' }  },
                    { path: 'laboratory/clinics', component: ClinicsComponent, data: { permission: 'Pages.Clinics' }  },
                    { path: 'clinic/:id', component: CreateEditClinicComponent, data: { permission: 'Pages.Clinics' } },
                    { path: 'clinic', component: CreateEditClinicComponent, data: { permission: 'Pages.Clinics' } },
                    { path: 'clinic-schedule/:id', component: ClinicScheduleComponent, data: { permission: 'Pages.Clinics' } },
                    { path: 'dashboard', component: DashboardComponent, data: { permission: 'Pages.Tenant.Dashboard' } }

                ]
            }
        ])
    ],
    exports: [
        RouterModule
    ]
})
export class MainRoutingModule { }
