import { Router } from "express";

import { authenticateToken } from "../middleware/auth.js";
import accountsRoutes from "./accounts.routes.js";
import auditLogRoutes from "./auditLog.routes.js";
import assetCategoriesRoutes from "./assetCategories.routes.js";
import assetsRoutes from "./assets.routes.js";
import authRoutes from "./auth.routes.js";
import backupRoutes from "./backup.routes.js";
import bankAccountsRoutes from "./bankAccounts.routes.js";
import cashRegistersRoutes from "./cashRegisters.routes.js";
import closureRoutes from "./closure.routes.js";
import clientsRoutes from "./clients.routes.js";
import companiesRoutes from "./companies.routes.js";
import companySettingsRoutes from "./companySettings.routes.js";
import dashboardRoutes from "./dashboard.routes.js";
import entriesRoutes from "./entries.routes.js";
import entryTemplatesRoutes from "./entryTemplates.routes.js";
import fiscalRoutes from "./fiscal.routes.js";
import fiscalYearsRoutes from "./fiscalYears.routes.js";
import financialStatementsRoutes from "./financialStatements.routes.js";
import journalsRoutes from "./journals.routes.js";
import loginHistoryRoutes from "./loginHistory.routes.js";
import matchingRoutes from "./matching.routes.js";
import mgxRoutes from "./mgx.routes.js";
import trackingRoutes from "./tracking.js";
import depreciationRunRoutes from "./depreciationRun.routes.js";
import notificationsRoutes from "./notifications.routes.js";
import periodsRoutes from "./periods.routes.js";
import reconciliationsRoutes from "./reconciliations.routes.js";
import reportsRoutes from "./reports.routes.js";
import rolesRoutes from "./roles.routes.js";
import searchRoutes from "./search.routes.js";
import suppliersRoutes from "./suppliers.routes.js";
import systemSettingsRoutes from "./systemSettings.routes.js";
import usersRoutes from "./users.routes.js";

const router = Router();

router.use("/auth", authRoutes);
router.use("/tracking", trackingRoutes);
router.use(authenticateToken);
router.use("/dashboard", dashboardRoutes);
router.use("/companies", companiesRoutes);
router.use("/company-settings", companySettingsRoutes);
router.use("/users", usersRoutes);
router.use("/roles", rolesRoutes);
router.use("/audit-log", auditLogRoutes);
router.use("/login-history", loginHistoryRoutes);
router.use("/system-settings", systemSettingsRoutes);
router.use("/notifications", notificationsRoutes);
router.use("/search", searchRoutes);
router.use("/backup", backupRoutes);
router.use("/accounts", accountsRoutes);
router.use("/fiscal", fiscalRoutes);
router.use("/asset-categories", assetCategoriesRoutes);
router.use("/clients", clientsRoutes);
router.use("/journals", journalsRoutes);
router.use("/fiscal-years", fiscalYearsRoutes);
router.use("/periods", periodsRoutes);
router.use("/entries", entriesRoutes);
router.use("/entry-templates", entryTemplatesRoutes);
router.use("/reports", reportsRoutes);
router.use("/suppliers", suppliersRoutes);
router.use("/depreciation-run", depreciationRunRoutes);
router.use("/cash-registers", cashRegistersRoutes);
router.use("/bank-accounts", bankAccountsRoutes);
router.use("/reconciliations", reconciliationsRoutes);
router.use("/matching", matchingRoutes);
router.use("/mgx", mgxRoutes);
router.use("/assets", assetsRoutes);
router.use("/closure", closureRoutes);
router.use("/financial-statements", financialStatementsRoutes);

export default router;
