import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { GoodsOutDetailsComponent, GoodsOutDetailsModule } from './goods-out-details';
import { GoodsOutEditComponent } from './goods-out-edit';
import { GoodsOutSearchComponent, GoodsOutSearchModule } from './goods-out-search';
import { GoodsInSearchMainModule, GoodsOutSearchMainComponent } from './goods-out-search/search-main';
import { GoodsOutSearchResultsComponent, GoodsOutSearchResultsModule } from './goods-out-search/search-results';
import { GoodsOutComponent } from './goods-out.component';

const routes: Routes = [
  {
    path: '',
    component: GoodsOutComponent,
    children: [
      {
        path: '',
        component: GoodsOutSearchComponent,
        children: [
          { path: '', component: GoodsOutSearchMainComponent },
          { path: 'results', component: GoodsOutSearchResultsComponent },
        ],
      },
      {
        path: 'details/compartment/:compartmentCode/:processingStatus',
        component: GoodsOutDetailsComponent,
      },
      {
        path: 'details/order/:orderNumber/:processingStatus',
        component: GoodsOutDetailsComponent,
      },
      {
        path: 'details/compartment/:compartmentCode/:processingStatus/edit',
        component: GoodsOutEditComponent,
      },
      {
        path: 'details/order/:orderNumber/:processingStatus/edit',
        component: GoodsOutEditComponent,
      },
    ],
  },
];
@NgModule({
  imports: [
    RouterModule.forChild(routes),
    GoodsOutSearchModule,
    GoodsInSearchMainModule,
    GoodsOutSearchResultsModule,
    GoodsOutDetailsModule,
  ],
  exports: [RouterModule],
})
export class GoodsInRoutingModule {}
