import { Routes } from '@angular/router';
import { PickupShelfOutComponent } from './pickup-shelf-out.component';
import { PickupShelfOutMainComponent } from './pickup-shelf-out-main/pickup-shelf-out-main.component';

import { PickupShelfOutListComponent } from './pickup-shelf-out-list/pickup-shelf-out-list.component';
import { PickupShelfFilterComponent } from '../shared/pickup-shelf-filter/pickup-shelf-filter.component';
import { PickupShelfOutDetailsComponent } from './pickup-shelf-out-details/pickup-shelf-out-details.component';
import { PickupShelfOutMainSideViewComponent } from './pickup-shelf-out-main-side-view/pickup-shelf-out-main-side-view.component';
import { viewResolver } from '../resolvers/view.resolver';
import { PickUpShelfHistoryComponent } from '../shared/pickup-shelf-history/pickup-shelf-history.component';
import { PickupShelfOutEditComponent } from './pickup-shelf-out-edit/pickup-shelf-out-edit.component';

export const routes: Routes = [
  {
    path: '',
    component: PickupShelfOutComponent,
    resolve: {
      view: viewResolver,
    },
    runGuardsAndResolvers: 'always',
    title: 'Warenausgabe',
    children: [
      {
        path: 'main',
        component: PickupShelfOutMainComponent,
        data: { view: 'main' },
      },
      {
        path: 'list',
        component: PickupShelfOutListComponent,
        data: { view: 'list' },
      },
      {
        path: 'list/filter',
        component: PickupShelfFilterComponent,
        data: { view: 'filter' },
      },
      {
        path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/edit',
        component: PickupShelfOutEditComponent,
        title: 'Warenausgabe - Details',
        data: { view: 'edit' },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/status/:orderItemProcessingStatus/edit',
        component: PickupShelfOutEditComponent,
        title: 'Warenausgabe - Details',
        data: { view: 'edit' },
      },

      {
        path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/status/:orderItemProcessingStatus/edit',
        component: PickupShelfOutEditComponent,
        title: 'Warenausgabe - Details',
        data: { view: 'edit' },
      },
      {
        path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/history',
        component: PickUpShelfHistoryComponent,
        title: 'Warenausgabe - Verlauf',
        data: { view: 'history' },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/status/:orderItemProcessingStatus/history',
        component: PickUpShelfHistoryComponent,
        title: 'Warenausgabe - Verlauf',
        data: { view: 'history' },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/status/:orderItemProcessingStatus/history',
        component: PickUpShelfHistoryComponent,
        title: 'Warenausgabe - Verlauf',
        data: { view: 'history' },
      },
      {
        path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus',
        component: PickupShelfOutDetailsComponent,
        title: 'Warenausgabe - Details',
        data: { view: 'details' },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/status/:orderItemProcessingStatus',
        component: PickupShelfOutDetailsComponent,
        title: 'Warenausgabe - Details',
        data: { view: 'details' },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/status/:orderItemProcessingStatus',
        component: PickupShelfOutDetailsComponent,
        title: 'Warenausgabe - Details',
        data: { view: 'details' },
      },
      {
        path: 'search',
        component: PickupShelfOutMainSideViewComponent,
        outlet: 'side',
        data: { view: 'search' },
      },
      {
        path: 'list',
        component: PickupShelfOutListComponent,
        data: { view: 'list' },
        outlet: 'side',
      },
    ],
  },
];
