fix data flow issues

This commit is contained in:
2025-12-19 21:58:03 +01:00
parent 94fc538f44
commit ec177a75ce
37 changed files with 1336 additions and 534 deletions

View File

@@ -29,6 +29,9 @@ import { GetLeagueOwnerSummaryQueryDTO } from './dtos/GetLeagueOwnerSummaryQuery
import { GetLeagueAdminConfigQueryDTO } from './dtos/GetLeagueAdminConfigQueryDTO';
import { GetLeagueProtestsQueryDTO } from './dtos/GetLeagueProtestsQueryDTO';
import { GetLeagueSeasonsQueryDTO } from './dtos/GetLeagueSeasonsQueryDTO';
import { GetLeagueWalletOutputDTO } from './dtos/GetLeagueWalletOutputDTO';
import { WithdrawFromLeagueWalletInputDTO } from './dtos/WithdrawFromLeagueWalletInputDTO';
import { WithdrawFromLeagueWalletOutputDTO } from './dtos/WithdrawFromLeagueWalletOutputDTO';
@ApiTags('leagues')
@Controller('leagues')
@@ -274,4 +277,22 @@ export class LeagueController {
async getRaces(@Param('leagueId') leagueId: string): Promise<GetLeagueRacesOutputDTO> {
return this.leagueService.getRaces(leagueId);
}
@Get(':leagueId/wallet')
@ApiOperation({ summary: 'Get league wallet information' })
@ApiResponse({ status: 200, description: 'League wallet data', type: GetLeagueWalletOutputDTO })
async getLeagueWallet(@Param('leagueId') leagueId: string): Promise<GetLeagueWalletOutputDTO> {
return this.leagueService.getLeagueWallet(leagueId);
}
@Post(':leagueId/wallet/withdraw')
@ApiOperation({ summary: 'Withdraw from league wallet' })
@ApiBody({ type: WithdrawFromLeagueWalletInputDTO })
@ApiResponse({ status: 200, description: 'Withdrawal processed', type: WithdrawFromLeagueWalletOutputDTO })
async withdrawFromLeagueWallet(
@Param('leagueId') leagueId: string,
@Body() input: WithdrawFromLeagueWalletInputDTO,
): Promise<WithdrawFromLeagueWalletOutputDTO> {
return this.leagueService.withdrawFromLeagueWallet(leagueId, input);
}
}