fix data flow issues
This commit is contained in:
59
apps/api/src/domain/league/dtos/GetLeagueWalletOutputDTO.ts
Normal file
59
apps/api/src/domain/league/dtos/GetLeagueWalletOutputDTO.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
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[];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class WithdrawFromLeagueWalletInputDTO {
|
||||
@ApiProperty()
|
||||
amount: number;
|
||||
|
||||
@ApiProperty()
|
||||
currency: string;
|
||||
|
||||
@ApiProperty()
|
||||
seasonId: string;
|
||||
|
||||
@ApiProperty()
|
||||
destinationAccount: string;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class WithdrawFromLeagueWalletOutputDTO {
|
||||
@ApiProperty()
|
||||
success: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
message?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user