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

export class WalletTransactionDTO {
  @ApiProperty()
  id!: string;

  @ApiProperty({ enum: ['sponsorship', 'membership', 'withdrawal', 'prize'] })
  type!: 'sponsorship' | 'membership' | 'withdrawal' | 'prize';

  @ApiProperty()
  description!: string;

  @ApiProperty()
  amount!: number;

  @ApiProperty()
  fee!: number;

  @ApiProperty()
  netAmount!: number;

  @ApiProperty()
  date!: string;

  @ApiProperty({ enum: ['completed', 'pending', 'failed'] })
  status!: 'completed' | 'pending' | 'failed';

  @ApiProperty({ required: false })
  reference?: string;
}

export class GetLeagueWalletOutputDTO {
  @ApiProperty()
  balance!: number;

  @ApiProperty()
  currency!: string;

  @ApiProperty()
  totalRevenue!: number;

  @ApiProperty()
  totalFees!: number;

  @ApiProperty()
  totalWithdrawals!: number;

  @ApiProperty()
  pendingPayouts!: number;

  @ApiProperty()
  canWithdraw!: boolean;

  @ApiProperty({ required: false })
  withdrawalBlockReason?: string;

  @ApiProperty({ type: [WalletTransactionDTO] })
  transactions!: WalletTransactionDTO[];
}