export type AuthProvider = 'IRACING_DEMO';

export interface StartAuthCommand {
  provider: AuthProvider;
  returnTo?: string;
}

export interface AuthCallbackCommand {
  provider: AuthProvider;
  code: string;
  state: string;
  returnTo?: string;
}

export interface AuthenticatedUser {
  id: string;
  displayName: string;
  email?: string;
  iracingCustomerId?: string;
  primaryDriverId?: string;
  avatarUrl?: string;
  role?: string;
}

export interface IdentityProviderPort {
  startAuth(command: StartAuthCommand): Promise<{ redirectUrl: string; state: string }>;
  completeAuth(command: AuthCallbackCommand): Promise<AuthenticatedUser>;
}