import { Routes } from "@angular/router";

import { DashboardComponent } from "../../components/dashboard/dashboard.component";
import { ProfileComponent } from "../../components/profile/profile.component";

import { AuthGuard } from "@app/services/auth.guard";
import { InvestmentsComponent } from "@app/components/investments/investments.component";
import { InvestmentProposalsComponent } from "@app/components/investment-proposals/investment-proposals.component";
import { InvestmentProposalGeneralInfoComponent } from "@app/components/investment-proposals/general-info/general-info.component";

import { ArbitrationsComponent } from "@app/components/arbitrations/arbitrations.component";
import { PerformancesComponent } from "@app/components/performances/performances.component";

import { InstrumentWorkComponent } from "@app/components/investment-proposals/instrument-work/instrument-work.component";
import { ComplementInfoComponent } from "@app/components/investment-proposals/complement-info/complement-info.component";
import { ResultComponent } from "@app/components/investment-proposals/result/result.component";
import { WorkflowGuard } from "@app/services/investment-proposal-workflow.guard";
import { InvestmentProposalReviewComponent } from "@app/components/investment-proposals/review/review.component";
import { ChangeHistoryComponent } from "@app/components/investment-proposals/change-history/change-history.component";
import { PaymentInfoComponent } from "@app/components/investment-proposals/payment-info/payment-info.component";

import { PaymentRequirementComponent } from "@app/components/investment-proposals/payment-requirement/payment-requirement.component";
import { InvestmentProposalDetailComponent } from "@app/components/investment-proposals/proposal-detail/proposal-detail.component";

import { NgModule } from "@angular/core";
import { from } from "rxjs";

export const AdminLayoutRoutes: Routes = [
  {
    path: "dashboard",
    component: DashboardComponent,
    data: { title: "Dashboard" }
  },
  {
    path: "profile",
    component: ProfileComponent,
    data: { title: "Perfil de usuario" }
  },

  {
    path: "investments",
    component: InvestmentsComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Inversiones",
      breadcrumb: "Inversiones",
      roles: [2, 3]
    }
  },
  {
    path: "arbitrations",
    component: ArbitrationsComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Arbitrajes",
      breadcrumb: "Arbitrajes",
      roles: [2, 3]
    }
  },
  {
    path: "performances",
    component: PerformancesComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Rendimientos",
      breadcrumb: "Rendimientos",
      roles: [2, 3]
    }
  },
  /*
  {
    path: "users",
    component: UsersComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Listado de usuarios",
      breadcrumb: "Usuarios",
      roles: [3]
    }
  },
  {
    path: "companies",
    component: CompaniesComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Empresas",
      breadcrumb: "Empresas",
      roles: [3]
    }
  },
  {
    path: "companies/new",
    component: NewCompanyComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Nueva empresa",
      breadcrumb: "Nueva empresa",
      roles: [3]
    }
  },*/
  {
    path: "investment-proposals",
    component: InvestmentProposalsComponent,
    //canActivate: [AuthGuard],
    data: {
      title: "Propuestas de inversión",
      breadcrumb: "Propuestas de inversión",
      roles: [2, 3]
    }
  },

  {
    path: "investment-proposal",
    children: [
      {
        path: "general-info",
        component: InvestmentProposalGeneralInfoComponent,
        //canActivate: [AuthGuard],
        data: {
          title: "Nueva propuestas de inversión",
          breadcrumb: "Nueva propuestas de inversión",
          roles: [2, 3]
        }
      },
      {
        path: ":id/general-info",
        component: InvestmentProposalGeneralInfoComponent,
        //canActivate: [AuthGuard],
        data: {
          title: "Propuestas de inversión",
          breadcrumb: "Propuestas de inversión",
          roles: [2, 3]
        }
      }
    ]
  },

  {
    path: "investment-proposal/instrument-work",
    component: InstrumentWorkComponent,
    canActivate: [WorkflowGuard]
  },
  {
    path: "investment-proposal/:id/instrument-work",
    component: InstrumentWorkComponent,
    canActivate: [WorkflowGuard]
  },
  {
    path: "investment-proposal/complement-info",
    component: ComplementInfoComponent,
    canActivate: [WorkflowGuard]
  },
  {
    path: "investment-proposal/:id/complement-info",
    component: ComplementInfoComponent,
    canActivate: [WorkflowGuard]
  },
  {
    path: "investment-proposal/result",
    component: ResultComponent,
    canActivate: [WorkflowGuard]
  },
  {
    path: "investment-proposal/:id/result",
    component: ResultComponent,
    canActivate: [WorkflowGuard]
  },
  {
    path: "investment-proposal/:id/review",
    component: InvestmentProposalReviewComponent
  },
  {
    path: "investment-proposal/:id/change-history",
    component: ChangeHistoryComponent
  },
  {
    path: "investment-proposal/:id/payment-info",
    component: PaymentInfoComponent
  },
  {
    path: "investment-proposal/:id/payment",
    component: PaymentRequirementComponent
  },
  {
    path: "investment-proposal/:id",
    component: InvestmentProposalDetailComponent
  }
];
