import { Hono } from "hono";
import { authRoutes } from "./auth.routes";
import { categoryRoutes } from "./categories.routes";
import { childrenRoutes } from "./children.routes";
import { debtRoutes } from "./debts.routes";
import { fixedCostsRoutes } from "./fixed-costs.routes";
import { householdRoutes } from "./households.routes";
import { householdSettingsRoutes } from "./household-settings.routes";
import { inviteRoutes } from "./invite.routes";
import { monthsRoutes } from "./months.routes";
import { shoppingListRoutes } from "./shopping-list.routes";
import { shoppingRoutes } from "./shopping.routes";
import { subscriptionRoutes } from "./subscriptions.routes";
import { transactionRoutes } from "./transactions.routes";
import { tripsRoutes } from "./trips.routes";
import { scannerRoutes } from "./scanner.routes";

export function registerRoutes(app: Hono) {
  app.route("/api/auth", authRoutes);
  app.route("/api/households/invite", inviteRoutes);
  app.route("/api/households", householdRoutes);
  app.route("/api/household-settings", householdSettingsRoutes);
  app.route("/api/months", monthsRoutes);
  app.route("/api/transactions", transactionRoutes);
  app.route("/api/categories", categoryRoutes);
  app.route("/api/children", childrenRoutes);
  app.route("/api/debts", debtRoutes);
  app.route("/api/fixed-costs", fixedCostsRoutes);
  app.route("/api/shopping-lists", shoppingListRoutes);
  app.route("/api/shopping", shoppingRoutes);
  app.route("/api/subscriptions", subscriptionRoutes);
  app.route("/api/trips", tripsRoutes);
  app.route("/api/scanner", scannerRoutes);

  app.get("/health", (c) => {
    return c.json({ status: "ok", timestamp: new Date().toISOString() });
  });
}
