import type { User } from "@supabase/supabase-js";

export type AuthContext = {
  accessToken: string | null;
  refreshToken: string | null;
  user: User | null;
  profile: Record<string, unknown> | null;
  organizationId: string | null;
};

export type CampaignBlock = {
  id: string;
  type: "hero" | "text" | "image" | "button" | "divider" | "spacer" | "social" | "footer"
    | "header_logo" | "columns" | "quote" | "video" | "countdown" | "list";
  order: number;
  config: Record<string, unknown>;
};

export type SessionPayload = {
  accessToken: string | null;
  refreshToken: string | null;
  activeOrganizationId: string | null;
  defaultOrganizationId: string | null;
  profileRole: string;
  userId: string;
  email: string;
};

declare module "fastify" {
  interface FastifyRequest {
    authContext: AuthContext;
  }
}
