code quality
This commit is contained in:
@@ -23,6 +23,14 @@ export class WalletService implements Service {
|
||||
|
||||
async getWallet(leagueId: string): Promise<WalletViewModel> {
|
||||
const data = await this.apiClient.getWallet({ leagueId });
|
||||
return new WalletViewModel({ ...data.wallet, transactions: data.transactions });
|
||||
const transactions = data.transactions.map(t => ({
|
||||
...t,
|
||||
type: t.type as any,
|
||||
fee: 0, // DTO missing fee
|
||||
netAmount: t.amount, // DTO missing netAmount
|
||||
date: t.createdAt, // Map createdAt to date
|
||||
status: 'completed' as const // DTO missing status
|
||||
}));
|
||||
return new WalletViewModel({ ...data.wallet, transactions });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user