import { createTRPCRouter, controllerProcedure } from "../trpc.js";
import {
  dashboardChargeabilityOverviewInputSchema,
  dashboardDemandInputSchema,
  dashboardDetailInputSchema,
  dashboardPeakTimesInputSchema,
  dashboardTopValueResourcesInputSchema,
  getDashboardBudgetForecastDetail,
  getDashboardBudgetForecastRead,
  getDashboardChargeabilityOverviewRead,
  getDashboardDemandRead,
  getDashboardDetail,
  getDashboardOverviewRead,
  getDashboardPeakTimesRead,
  getDashboardProjectHealthDetail,
  getDashboardProjectHealthRead,
  getDashboardSkillGapSummaryRead,
  getDashboardSkillGapsRead,
  getDashboardStatisticsDetail,
  getDashboardTopValueResourcesRead,
} from "./dashboard-procedure-support.js";

export const dashboardRouter = createTRPCRouter({
  getOverview: controllerProcedure.query(({ ctx }) => getDashboardOverviewRead(ctx)),

  getStatisticsDetail: controllerProcedure.query(({ ctx }) => getDashboardStatisticsDetail(ctx)),

  getPeakTimes: controllerProcedure
    .input(dashboardPeakTimesInputSchema)
    .query(({ ctx, input }) => getDashboardPeakTimesRead(ctx, input)),

  getTopValueResources: controllerProcedure
    .input(dashboardTopValueResourcesInputSchema)
    .query(({ ctx, input }) => getDashboardTopValueResourcesRead(ctx, input)),

  getDemand: controllerProcedure
    .input(dashboardDemandInputSchema)
    .query(({ ctx, input }) => getDashboardDemandRead(ctx, input)),

  getDetail: controllerProcedure
    .input(dashboardDetailInputSchema)
    .query(({ ctx, input }) => getDashboardDetail(ctx, input)),

  getChargeabilityOverview: controllerProcedure
    .input(dashboardChargeabilityOverviewInputSchema)
    .query(({ ctx, input }) => getDashboardChargeabilityOverviewRead(ctx, input)),

  getBudgetForecast: controllerProcedure.query(({ ctx }) => getDashboardBudgetForecastRead(ctx)),

  getBudgetForecastDetail: controllerProcedure.query(({ ctx }) => getDashboardBudgetForecastDetail(ctx)),

  getSkillGaps: controllerProcedure.query(({ ctx }) => getDashboardSkillGapsRead(ctx)),

  getSkillGapSummary: controllerProcedure.query(({ ctx }) => getDashboardSkillGapSummaryRead(ctx)),

  getProjectHealth: controllerProcedure.query(({ ctx }) => getDashboardProjectHealthRead(ctx)),

  getProjectHealthDetail: controllerProcedure.query(({ ctx }) => getDashboardProjectHealthDetail(ctx)),
});
