website refactor

This commit is contained in:
2026-01-19 12:35:16 +01:00
parent a8731e6937
commit 15290400b3
122 changed files with 902 additions and 255 deletions

View File

@@ -17,25 +17,24 @@ export function useLeagueWalletPageData(leagueId: string) {
// Transform DTO to ViewModel at client boundary
const transactions = dto.transactions.map(t => new WalletTransactionViewModel({
id: t.id,
type: t.type,
type: t.type as any,
description: t.description,
amount: t.amount,
fee: t.fee,
netAmount: t.netAmount,
date: new globalThis.Date(t.date),
fee: 0,
netAmount: t.amount,
date: new globalThis.Date(t.createdAt),
status: t.status,
reference: t.reference,
}));
return new LeagueWalletViewModel({
balance: dto.balance,
currency: dto.currency,
totalRevenue: dto.totalRevenue,
totalFees: dto.totalFees,
totalWithdrawals: dto.totalWithdrawals,
pendingPayouts: dto.pendingPayouts,
totalRevenue: dto.balance, // Fallback
totalFees: 0,
totalWithdrawals: 0,
pendingPayouts: 0,
transactions,
canWithdraw: dto.canWithdraw,
withdrawalBlockReason: dto.withdrawalBlockReason,
canWithdraw: true,
withdrawalBlockReason: undefined,
});
},
enabled: !!leagueId,