export const PAGINATION_DEFAULT_PAGE_SIZE = 15;

export const ROUTES = {
  login: "/login",
  resetPassword: "/reset-password",
  dashboard: "/",
  companies: "/companies",
  users: "/users",
  vehicles: "/vehicles",
  subscriptions: "/subscriptions",
  sites: "/sites",
  activityLogs: "/activity-logs",
  tickets: "/tickets",
  support: "/support",
  helpCenter: "/help-center",
  helpCenterCreate: "/help-center/create",
  telematics: "/commandes-telematique",
  installations: "/installations",
  installers: "/installateurs",
  internalUsers: "/utilisateurs-internes",
  antai: "/antai",
  rfidCards: "/cartes-rfid",
  health: "/health",
  healthClients: "/health/clients",
  healthConfig: "/health/config",
  integrations: "/integrations",
  integrationConnections: "/integrations/connections",
  anomalyRules: "/anomaly-rules",
} as const;

/**
 * Routes (and their sidebar items) gated by a permission code.
 * Anything not listed here is always visible (overview, sites, help center).
 */
export const ROUTE_PERMISSION: Record<string, string> = {
  [ROUTES.companies]: "companies.manage",
  [ROUTES.users]: "users.manage",
  [ROUTES.vehicles]: "admin_vehicles.manage",
  [ROUTES.subscriptions]: "subscriptions.manage",
  [ROUTES.telematics]: "telematic.manage",
  [ROUTES.installations]: "telematic.manage",
  [ROUTES.installers]: "telematic.manage",
  [ROUTES.tickets]: "tickets.view",
  [ROUTES.support]: "tickets.view",
  [ROUTES.helpCenter]: "help.manage",
  [ROUTES.activityLogs]: "logs.view",
  [ROUTES.internalUsers]: "internal.manage",
  [ROUTES.antai]: "admin_vehicles.manage",
  [ROUTES.rfidCards]: "rfid.manage",
  [ROUTES.health]: "health.view",
  // The Dadycar defaults of the anomaly rules reach every client: same gate as the API.
  [ROUTES.anomalyRules]: "companies.manage",
};

/**
 * SCRUM-282: merged pages. The sidebar entry is visible when the user holds
 * ANY of these codes (the page then shows only the tabs they may use).
 */
export const ROUTE_PERMISSION_ANY: Record<string, string[]> = {
  [ROUTES.companies]: ["companies.manage", "users.manage"],
};
