website cleanup

This commit is contained in:
2025-12-25 00:19:36 +01:00
parent d78854a4c6
commit 9486455b9e
82 changed files with 1223 additions and 363 deletions

View File

@@ -16,8 +16,22 @@ export class WalletService {
/**
* Get wallet by driver ID with view model transformation
*/
async getWallet(driverId: string): Promise<WalletViewModel> {
const { wallet, transactions } = await this.apiClient.getWallet(driverId);
return new WalletViewModel({ ...wallet, transactions: transactions as FullTransactionDto[] });
async getWallet(leagueId?: string): Promise<WalletViewModel> {
const { wallet, transactions } = await this.apiClient.getWallet({ leagueId });
// Convert TransactionDTO to FullTransactionDto format
const convertedTransactions: FullTransactionDto[] = transactions.map(t => ({
id: t.id,
type: t.type as 'sponsorship' | 'membership' | 'withdrawal' | 'prize',
description: t.description,
amount: t.amount,
fee: t.amount * 0.05, // Calculate fee (5%)
netAmount: t.amount * 0.95, // Calculate net amount
date: new Date(t.createdAt),
status: 'completed',
referenceId: t.referenceId
}));
return new WalletViewModel({ ...wallet, transactions: convertedTransactions });
}
}