import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { RemissionListCreateComponent } from './pages/remission-list-create/remission-list-create.component';
import { RemissionListStartedComponent } from './pages/remission-list-started/remission-list-started.component';
import { RemissionFinishComponent } from './pages/remission-finish/remission-finish.component';
// tslint:disable-next-line: max-line-length
import { RemissionAddProductToRemissionListComponent } from './pages/remission-add-product-to-remission-list/remission-add-product-to-remission-list.component';
// tslint:disable-next-line: max-line-length
import { RemissionGenerateShippingDocumentComponent } from './components/remission-generate-shipping-document/remission-generate-shipping-document.component';
import { RemissionsOverviewComponent } from './pages/remissions-overview/remissions-overview.component';
import { RemissionDetailsComponent } from './pages/remission-details/remission-details.component';

import { CanDeactivatedGuard } from './guard';

const routes: Routes = [
  {
    path: 'create',
    component: RemissionListCreateComponent,
  },
  {
    path: 'started',
    component: RemissionListStartedComponent,
    canDeactivate: [CanDeactivatedGuard],
  },
  {
    path: 'started/:shippingDocumentId',
    component: RemissionListStartedComponent,
    canDeactivate: [CanDeactivatedGuard],
  },
  {
    path: 'finish',
    component: RemissionFinishComponent,
    canDeactivate: [CanDeactivatedGuard],
  },
  {
    path: 'search',
    component: RemissionAddProductToRemissionListComponent,
  },
  {
    path: 'generate-shipping-document',
    component: RemissionGenerateShippingDocumentComponent,
  },
  {
    path: 'overview',
    component: RemissionsOverviewComponent,
  },
  {
    path: 'overview/:shippingDocumentId',
    component: RemissionDetailsComponent,
  },
];

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