import { FastifyInstanceType } from "../../utils/types";
import {
  getBusinessPlan,
  getMarketResearch,
  getNetworking,
  getProspecting,
  getSourcing,
  getAllForms,
  getFormStats,
  getAccompagnement,
  getHealthCheck,
  searchEntries,
  getAllData,
  getGFDiagnostic,
} from "./controller";

export async function adminWpRoutes(fastify: FastifyInstanceType) {
  //-------------------------------------------------------------------------------
  // HEALTH CHECK
  fastify.get("health/", getHealthCheck);

  //-------------------------------------------------------------------------------
  // FORMULAIRES INDIVIDUELS
  fastify.get("forms/business-plan/", getBusinessPlan);
  fastify.get("forms/accompagnement/", getAccompagnement);
  fastify.get("forms/market-research/", getMarketResearch);
  fastify.get("forms/networking/", getNetworking);
  fastify.get("forms/sourcing/", getSourcing);
  fastify.get("forms/prospecting/", getProspecting);

  //-------------------------------------------------------------------------------
  // DONNÉES GLOBALES
  fastify.get("forms/", getAllForms);
  fastify.get("forms/stats/", getFormStats);
  fastify.get("forms/all-data/", getAllData);

  //-------------------------------------------------------------------------------
  // DIAGNOSTIC
  fastify.get("forms/diagnostic/", getGFDiagnostic);

  //-------------------------------------------------------------------------------
  // RECHERCHE
  fastify.get("forms/search/", searchEntries);

  //-------------------------------------------------------------------------------
  fastify.log.info("✅ WP Gravity Forms routes registered");
}
