/**
 * Share Info Response DTO
 */

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

export class ShareInfoResponseDto {
  @ApiProperty({
    description: 'Share ID',
    example: 'share_1699887766123_abc123xyz',
  })
  id: string;

  @ApiProperty({
    description: 'Party ID',
    example: 'user123-server',
  })
  partyId: string;

  @ApiProperty({
    description: 'Session ID that created this share',
    example: '550e8400-e29b-41d4-a716-446655440000',
  })
  sessionId: string;

  @ApiProperty({
    description: 'Share type',
    enum: ['wallet', 'admin', 'recovery'],
    example: 'wallet',
  })
  shareType: string;

  @ApiProperty({
    description: 'Group public key (hex)',
    example: '03abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890ab',
  })
  publicKey: string;

  @ApiProperty({
    description: 'Threshold configuration',
    example: '2-of-3',
  })
  threshold: string;

  @ApiProperty({
    description: 'Share status',
    enum: ['active', 'rotated', 'revoked'],
    example: 'active',
  })
  status: string;

  @ApiProperty({
    description: 'Creation timestamp',
    example: '2024-01-15T10:30:00.000Z',
  })
  createdAt: string;

  @ApiProperty({
    description: 'Last update timestamp',
    example: '2024-01-15T10:30:00.000Z',
  })
  updatedAt: string;

  @ApiPropertyOptional({
    description: 'Last used timestamp',
    example: '2024-01-15T12:00:00.000Z',
  })
  lastUsedAt?: string;
}

export class ListSharesResponseDto {
  @ApiProperty({
    description: 'List of shares',
    type: [ShareInfoResponseDto],
  })
  items: ShareInfoResponseDto[];

  @ApiProperty({
    description: 'Total count',
    example: 100,
  })
  total: number;

  @ApiProperty({
    description: 'Current page',
    example: 1,
  })
  page: number;

  @ApiProperty({
    description: 'Items per page',
    example: 20,
  })
  limit: number;

  @ApiProperty({
    description: 'Total pages',
    example: 5,
  })
  totalPages: number;
}
