import type { InvoiceListFilters } from "@rubis/shared";

/**
 * Convention queryKeys — toutes les clés TanStack Query passent ici.
 * Permet d'invalider précisément après une mutation.
 */
export const queryKeys = {
  me: () => ["me"] as const,
  invoices: {
    all: () => ["invoices"] as const,
    list: (filters: InvoiceListFilters) => ["invoices", "list", filters] as const,
    detail: (id: string) => ["invoices", "detail", id] as const,
  },
  plans: {
    all: () => ["plans"] as const,
    detail: (slug: string) => ["plans", "detail", slug] as const,
  },
  clients: {
    all: () => ["clients"] as const,
    list: (filters: { q?: string }) => ["clients", "list", filters] as const,
    detail: (id: string) => ["clients", "detail", id] as const,
  },
  dashboard: {
    all: () => ["dashboard"] as const,
    kpis: () => ["dashboard", "kpis"] as const,
    activity: () => ["dashboard", "activity"] as const,
  },
  checkin: {
    all: () => ["checkin"] as const,
    pending: () => ["checkin", "pending"] as const,
  },
} as const;
