import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustomerSearchComponent } from './pages/customer-search/customer-search.component';
import { CustomerSearchResultComponent } from './pages/customer-search-result/customer-search-result.component';
import { CustomerEditBillingAddressComponent } from './pages/customer-edit-billing-address/customer-edit-billing-address.component';
import { CustomerBillingAddressComponent } from './pages/customer-billing-address/customer-billing-address.component';
import { CustomerAddBillingAddressComponent } from './pages/customer-add-billing-address/customer-add-billing-address.component';
import { CustomerAddDeliveryAddressComponent } from './pages/customer-add-delivery-address/customer-add-delivery-address.component';
import { CustomerDeliveryAddressComponent } from './pages/customer-delivery-address/customer-delivery-address.component';
import { CustomerEditDeliveryAddressComponent } from './pages/customer-edit-delivery-address/customer-edit-delivery-address.component';
import { CustomerEditComponent } from './pages/customer-edit/customer-edit.component';
import { CustomerOrderDetailComponent } from './pages/customer-order-detail/customer-order-detail.component';

export const routes: Routes = [
  {
    path: 'search',
    component: CustomerSearchComponent,
  },
  {
    path: 'search/:create',
    component: CustomerSearchComponent,
  },
  {
    path: 'search/missing-data/:id',
    component: CustomerSearchComponent,
  },
  {
    path: 'results',
    component: CustomerSearchResultComponent,
  },
  {
    path: 'edit/:id',
    component: CustomerEditComponent,
  },
  {
    path: 'edit/:id/billing',
    component: CustomerBillingAddressComponent,
  },
  {
    path: 'edit/:id/billing/add',
    component: CustomerAddBillingAddressComponent,
  },
  {
    path: 'edit/:id/billing/edit/:addressId',
    component: CustomerEditBillingAddressComponent,
  },
  {
    path: 'edit/:id/delivery',
    component: CustomerDeliveryAddressComponent,
  },
  {
    path: 'edit/:id/delivery/edit/:addressId',
    component: CustomerEditDeliveryAddressComponent,
  },
  {
    path: 'edit/:id/delivery/add',
    component: CustomerAddDeliveryAddressComponent,
  },
  {
    path: ':id/order/:orderId',
    component: CustomerOrderDetailComponent,
  },
];

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