/**
 * Participate Keygen Request DTO
 */

import { IsString, IsNotEmpty, IsEnum, IsOptional, IsUUID } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { PartyShareType } from '../../../domain/enums';

export class ParticipateKeygenDto {
  @ApiProperty({
    description: 'MPC session ID',
    example: '550e8400-e29b-41d4-a716-446655440000',
  })
  @IsUUID()
  @IsNotEmpty()
  sessionId: string;

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

  @ApiProperty({
    description: 'Join token from session coordinator',
    example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
  })
  @IsString()
  @IsNotEmpty()
  joinToken: string;

  @ApiProperty({
    description: 'Type of share to generate',
    enum: PartyShareType,
    example: PartyShareType.WALLET,
  })
  @IsEnum(PartyShareType)
  shareType: PartyShareType;

  @ApiPropertyOptional({
    description: 'Associated user ID (for wallet shares)',
    example: '12345',
  })
  @IsOptional()
  @IsString()
  userId?: string;
}
