import { ApiProperty } from '@nestjs/swagger';

export class AuthenticatedUserDTO {
  @ApiProperty()
  userId!: string;
  @ApiProperty()
  email!: string;
  @ApiProperty()
  displayName!: string;
}

export class AuthSessionDTO {
  @ApiProperty()
  token!: string;
  @ApiProperty()
  user!: AuthenticatedUserDTO;
}

export class SignupParams {
  @ApiProperty()
  email!: string;
  @ApiProperty()
  password!: string;
  @ApiProperty()
  displayName!: string;
  @ApiProperty({ required: false })
  iracingCustomerId?: string;
  @ApiProperty({ required: false })
  primaryDriverId?: string;
  @ApiProperty({ required: false })
  avatarUrl?: string;
}

export class LoginParams {
  @ApiProperty()
  email!: string;
  @ApiProperty()
  password!: string;
}

export class IracingAuthRedirectResult {
  @ApiProperty()
  redirectUrl!: string;
  @ApiProperty()
  state!: string;
}

export class LoginWithIracingCallbackParams {
  @ApiProperty()
  code!: string;
  @ApiProperty()
  state!: string;
  @ApiProperty({ required: false })
  returnTo?: string;
}
