import { Routes } from '@angular/router';
import { PickupShelfInComponent } from './pickup-shelf-in.component';
import { PickupShelfFilterComponent } from '../shared/pickup-shelf-filter/pickup-shelf-filter.component';
import { PickupShelfInDetailsComponent } from './pickup-shelf-in-details/pickup-shelf-in-details.component';
import { viewResolver } from '../resolvers/view.resolver';
import { PickUpShelfHistoryComponent } from '../shared/pickup-shelf-history/pickup-shelf-history.component';
import { PickUpShelfInMainSideViewComponent } from './pickup-shelf-in-main-side-view/pickup-shelf-in-main-side-view.component';
import { PickUpShelfInMainComponent } from './pickup-shelf-in-main/pickup-shelf-in-main.component';
import { PickUpShelfInListComponent } from './pickup-shelf-in-list/pickup-shelf-in-list.component';
import { PickupShelfInEditComponent } from './pickup-shelf-in-edit/pickup-shelf-in-edit.component';
import { MatomoRouteData } from 'ngx-matomo-client';

export const routes: Routes = [
  {
    path: '',
    component: PickupShelfInComponent,
    resolve: {
      view: viewResolver,
    },
    runGuardsAndResolvers: 'always',
    children: [
      {
        path: 'main',
        component: PickUpShelfInMainComponent,
        data: {
          view: 'main',
          matomo: {
            title: 'Abholfach',
          } as MatomoRouteData,
        },
      },
      {
        path: 'list',
        component: PickUpShelfInListComponent,
        data: {
          view: 'list',
          matomo: {
            title: 'Abholfach - Trefferliste',
          } as MatomoRouteData,
        },
      },
      {
        path: 'list/filter',
        component: PickupShelfFilterComponent,
        data: {
          view: 'filter',
          matomo: {
            title: 'Abholfach - Filter',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/:orderItemSubsetId/edit',
        component: PickupShelfInEditComponent,
        data: {
          view: 'edit',
          matomo: {
            title: 'Abholfach - Bearbeiten',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:orderItemSubsetId/edit',
        component: PickupShelfInEditComponent,
        data: {
          view: 'edit',
          matomo: {
            title: 'Abholfach - Bearbeiten',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/:orderItemSubsetId/edit',
        component: PickupShelfInEditComponent,
        data: {
          view: 'edit',
          matomo: {
            title: 'Abholfach - Bearbeiten',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/:orderItemSubsetId/history',
        component: PickUpShelfHistoryComponent,
        data: {
          view: 'history',
          matomo: {
            title: 'Abholfach - Historie',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:orderItemSubsetId/history',
        component: PickUpShelfHistoryComponent,
        data: {
          view: 'history',
          matomo: {
            title: 'Abholfach - Historie',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/:orderItemSubsetId/history',
        component: PickUpShelfHistoryComponent,
        data: {
          view: 'history',
          matomo: {
            title: 'Abholfach - Historie',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/:orderItemSubsetId',
        component: PickupShelfInDetailsComponent,
        data: {
          view: 'details',
          matomo: {
            title: 'Abholfach - Details',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:orderItemSubsetId',
        component: PickupShelfInDetailsComponent,
        data: {
          view: 'details',
          matomo: {
            title: 'Abholfach - Details',
          } as MatomoRouteData,
        },
      },
      {
        path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/:orderItemSubsetId',
        component: PickupShelfInDetailsComponent,
        data: {
          view: 'details',
          matomo: {
            title: 'Abholfach - Details',
          } as MatomoRouteData,
        },
      },
      { path: 'search', component: PickUpShelfInMainSideViewComponent, outlet: 'side' },
      { path: 'list', component: PickUpShelfInListComponent, data: { view: 'list' }, outlet: 'side' },
    ],
  },
];
