import type { DefaultSession } from "next-auth"
import type { Permission, Role } from "@/shared/types/permissions"

declare module "next-auth" {
  interface Session {
    user: DefaultSession["user"] & {
      id: string
      role: string // kept for backward compatibility
      roles: Role[]
      permissions: Permission[]
    }
  }
}

declare module "next-auth/jwt" {
  interface JWT {
    id: string
    role: string // kept for backward compatibility
    roles: Role[]
    permissions: Permission[]
  }
}
