import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { AuthGuard } from "app/auth-guard.service";
import { Set001Component } from "./set001/set001.component";
import { Set001CreateSiteComponent } from "./set001/set001-create-site.component";
import { Set001SetSiteComponent } from "app/views/set/set001/set001-set-site.component";
import { Set001ViewSiteComponent } from "app/views/set/set001/set001-view-site.component";
import { Set001Resolver } from "app/views/set/set001/set001-resolver.service";
import { Set002Component } from "./set002/set002.component";
import { Set002CreateReasonComponent } from "./set002/set002-create-reason.component";
import { Set002SetReasonComponent } from "app/views/set/set002/set002-set-reason.component";
import { Set002ViewReasonComponent } from "app/views/set/set002/set002-view-reason.component";
import { Set002Resolver } from "./set002/set002-resolver.service";
import { Set003Component } from "./set003/set003.component";
import { Set003CreateVendorComponent } from "./set003/set003-create-vendor.component";
import { Set003SetVendorComponent } from "app/views/set/set003/set003-set-vendor.component";
import { Set003ViewVendorComponent } from "app/views/set/set003/set003-view-vendor.component";
import { Set003Resolver } from "app/views/set/set003/set003-resolver.service";


const routes: Routes = [
  {
    path: "",
    data: {
      title: "開單設定"
    },
    children: [
      {
        path: "set001",
        component: Set001Component,
        resolve: { selectedItem: Set001Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "行政區管理"
        }
      },
      {
        path: "set001-create-site",
        component: Set001CreateSiteComponent,
        canActivate: [AuthGuard],
        data: {
          title: "新增站點資料"
        }
      },
      {
        path: "set001-set-site",
        component: Set001SetSiteComponent,
        resolve: { selectedItem: Set001Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "修改站點資料"
        }
      },
      {
        path: "set001-view-site",
        component: Set001ViewSiteComponent,
        resolve: { selectedItem: Set001Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "詳細站點資料"
        }
      },
      {
        path: "set002",
        component: Set002Component,
        resolve: { selectedItem: Set002Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "原因設定"
        }
      },
      {
        path: "set002-create-reason",
        component: Set002CreateReasonComponent,
        canActivate: [AuthGuard],
        data: {
          title: "新增原因資料"
        }
      },
      {
        path: "set002-set-reason",
        component: Set002SetReasonComponent,
        resolve: { selectedItem: Set002Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "修改原因資料"
        }
      },
      {
        path: "set002-view-reason",
        component: Set002ViewReasonComponent,
        resolve: { selectedItem: Set002Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "詳細原因資料"
        }
      },
      {
        path: "set003",
        component: Set003Component,
        resolve: { selectedItem: Set003Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "廠商資料設定"
        }
      },
      {
        path: "set003-create-vendor",
        component: Set003CreateVendorComponent,
        canActivate: [AuthGuard],
        data: {
          title: "新增廠商資料"
        }
      },
      {
        path: "set003-set-vendor",
        component: Set003SetVendorComponent,
        resolve: { selectedItem: Set003Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "修改廠商資料"
        }
      },
      {
        path: "set003-view-vendor",
        component: Set003ViewVendorComponent,
        resolve: { selectedItem: Set003Resolver },
        canActivate: [AuthGuard],
        data: {
          title: "詳細廠商資料"
        }
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
  providers: [Set001Resolver, Set002Resolver, Set003Resolver]
})
export class SetRoutingModule {}
