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

/**
 * 用户待办操作响应 DTO
 */
export class PendingActionResponseDto {
  @ApiProperty({ example: '1', description: '操作ID' })
  id: string;

  @ApiProperty({ example: '12345', description: '用户ID' })
  userId: string;

  @ApiPropertyOptional({ example: 'D25122700022', description: '用户账号序列号' })
  accountSequence?: string;

  @ApiProperty({ example: 'ADOPTION_WIZARD', description: '操作代码' })
  actionCode: string;

  @ApiPropertyOptional({
    example: { treeType: 'durian', location: '马来西亚' },
    description: '操作参数',
  })
  actionParams: Record<string, any> | null;

  @ApiProperty({ example: 'PENDING', description: '状态' })
  status: string;

  @ApiProperty({ example: 10, description: '优先级' })
  priority: number;

  @ApiPropertyOptional({ description: '过期时间' })
  expiresAt: Date | null;

  @ApiProperty({ description: '创建时间' })
  createdAt: Date;

  @ApiPropertyOptional({ description: '完成时间' })
  completedAt: Date | null;

  @ApiPropertyOptional({ description: '创建人' })
  createdBy: string | null;
}

/**
 * 用户待办操作列表响应 DTO (带分页)
 */
export class PendingActionListResponseDto {
  @ApiProperty({ type: [PendingActionResponseDto], description: '操作列表' })
  items: PendingActionResponseDto[];

  @ApiProperty({ example: 100, description: '总数' })
  total: number;

  @ApiProperty({ example: 1, description: '当前页' })
  page: number;

  @ApiProperty({ example: 20, description: '每页数量' })
  limit: number;
}

/**
 * 批量创建结果响应 DTO
 */
export class BatchCreateResultDto {
  @ApiProperty({ example: 10, description: '成功创建数量' })
  successCount: number;

  @ApiProperty({ example: 2, description: '失败数量' })
  failedCount: number;

  @ApiPropertyOptional({
    type: [String],
    description: '失败的用户ID列表',
  })
  failedUserIds?: string[];
}
