/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/authorization-code.aurora.yaml
 */
import { ApiProperty } from '@nestjs/swagger';

export class OAuthUpdateAuthorizationCodeByIdDto {
  @ApiProperty({
    type: String,
    description:
      'Unique identifier for the authorization code record. UUID v4 format, generated automatically on creation.',
  })
  id: string;

  @ApiProperty({
    type: String,
    description:
      'Opaque authorization code string. Cryptographically random, URL-safe. Presented to the client application for exchange via the token endpoint. Must be unique and single-use.',
  })
  code?: string;

  @ApiProperty({
    type: String,
    description:
      'ID of the OAuth client that requested this authorization code. Links the code to the application initiating the authorization flow.',
    example: '589cf4d0-af83-5c3a-8683-3c162633d000',
  })
  clientId?: string;

  @ApiProperty({
    type: String,
    description:
      'ID of the authenticated account (user) who authorized this code. Used to associate the resulting tokens with the correct user identity.',
  })
  accountId?: string;

  @ApiProperty({
    type: String,
    description:
      'The redirect URI provided by the client in the authorization request. Must match exactly during code exchange to prevent authorization code interception attacks (RFC 6749 Section 4.1.3).',
  })
  redirectUri?: string;

  @ApiProperty({
    type: Object,
    description:
      'JSON array of scope strings requested by the client during authorization. Defines the permissions granted for the resulting access token. NULL means default scopes.',
  })
  scopes?: any;

  @ApiProperty({
    type: String,
    description:
      'PKCE code challenge value. Reserved for future PKCE implementation. Will contain the S256 hash of the code verifier sent by public clients (RFC 7636).',
  })
  codeChallenge?: string;

  @ApiProperty({
    type: String,
    description:
      "PKCE code challenge method. Reserved for future PKCE implementation. Expected values: 'S256' or 'plain' (RFC 7636). S256 is strongly recommended.",
  })
  codeChallengeMethod?: string;

  @ApiProperty({
    type: String,
    description:
      'Expiration timestamp for the authorization code. Codes are very short-lived (typically 60 seconds) to minimize the window for interception. After expiration, the code cannot be exchanged.',
  })
  expiresAt?: string;

  @ApiProperty({
    type: Boolean,
    description:
      'Indicates whether the authorization code has already been exchanged for tokens. Codes are single-use; if a used code is presented again, all tokens issued from it must be revoked (RFC 6749 Section 4.1.2).',
  })
  isUsed?: boolean;
}
