import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { CrudGridComponent, TemplateResolver, CrudDetailComponent, DirtyGuard, RecordResolver } from '@xdf/gallery';
import { AuthGuard, ResourceAuthGuard } from '@xdf/security';
import { AeropuertoListTemplateResolver } from './components/resolvers/aeropuerto-list.template.resolver';
import { VueloFormComponent } from './components/vuelo-form/vuelo-form.component';
import { TaxRateDialogService } from './components/vuelo-escala-dialog/services/vuelo-escala-dialog.service';


const routes: Routes = [
  {
    path: "flight", component: CrudGridComponent, canActivate: [AuthGuard, ResourceAuthGuard],
    resolve: { Template: TemplateResolver },
    data: {
      innerTemplate: 'none',
      program: "flight",
      breadcrumb: "breadcrumb.flight"
    },
  }
  ,
  {
    path: 'flight/detail/:mode', component: VueloFormComponent, canActivate: [AuthGuard, ResourceAuthGuard], canDeactivate: [DirtyGuard],
    resolve: { record: RecordResolver},
    data: {
      program: 'flight',
      breadcrumb: 'breadcrumb.flight.detail'
    }
  }
];

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