import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard, ResourceAuthGuard } from '@xdf/security';
import { CrudDetailComponent, CrudGridComponent, DirtyGuard, TemplateResolver } from '@xdf/gallery';
import { PassengerDetailComponent } from './view/passenger-detail/passenger-detail.component';
import { ReservationsComponent } from './view/reservations/reservations.component';

const routes: Routes = [
    {
        path: 'passengers',
        canActivate: [AuthGuard, ResourceAuthGuard],
        component: CrudGridComponent,
        resolve: { template:  TemplateResolver},
        data: {
            program: 'passenger_list',
            breadcrumb: 'Pasajeros'
        }
    },
    {
        path: 'passengers/detail/:mode',
        canActivate: [AuthGuard, ResourceAuthGuard],
        resolve: { record: TemplateResolver},
        component: PassengerDetailComponent,
        data: {
            innerTemplate: 'none',
            program: 'passenger_detail',
            breadcrumb: 'Pasajeros'
        }
    },
    {
        path: 'reservations',
        canActivate: [AuthGuard, ResourceAuthGuard],
        component: CrudGridComponent,
        resolve: { template:  TemplateResolver},
        data: {
            innerTemplate: 'none',
            program: 'reservations_agent_list',
            breadcrumb: 'Reservaciones'
        }
    },
    {
        path: 'reservations/detail/:mode',
        canActivate: [AuthGuard, ResourceAuthGuard],
        resolve: { record: TemplateResolver},
        component: ReservationsComponent,
        data: {
            innerTemplate: 'none',
            program: 'reservations_agent_detail',
            breadcrumb: 'Reservaciones'
        }
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule],
})
export class AgentRoutingModule { }
