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

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

  @ApiProperty({
    type: Number,
    description:
      'Auto-incrementing row identifier. Used for internal ordering and as a numeric alternative to UUID.',
  })
  rowId: number;

  @ApiProperty({
    type: String,
    description:
      'Unique code identifier for the scope. Used in OAuth flows to request specific permissions. Convention: Uppercase, underscore-separated (e.g., READ_USERS, EDIT_POSTS).',
    example: 'EDIT',
  })
  code: string;

  @ApiProperty({
    type: String,
    description:
      'Human-readable name for the scope. Displayed in authorization prompts and admin interfaces.',
  })
  name: string;

  @ApiProperty({
    type: Array,
    description:
      'Array of role IDs that have access to this scope. Links scopes to the IAM role system for permission management. NULL means no role restrictions.',
  })
  roleIds?: string[];

  @ApiProperty({
    type: String,
    description: 'Timestamp when the scope was created. Automatically set on creation.',
  })
  createdAt?: string;

  @ApiProperty({
    type: String,
    description:
      'Timestamp when the scope was last updated. Automatically updated on modification.',
  })
  updatedAt?: string;

  @ApiProperty({
    type: String,
    description:
      'Soft delete timestamp. NULL means active scope. When set, scope is excluded from normal queries but preserved for audit trail.',
  })
  deletedAt?: string;
}
