view models
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { WalletViewModel } from '@/lib/view-models/WalletViewModel';
|
||||
import { PaymentsApiClient } from '../../api/payments/PaymentsApiClient';
|
||||
import { WalletViewModel } from '../../view-models';
|
||||
import { FullTransactionDto } from '../../view-models/WalletTransactionViewModel';
|
||||
|
||||
/**
|
||||
* Wallet Service
|
||||
@@ -16,7 +17,7 @@ export class WalletService {
|
||||
* Get wallet by driver ID with view model transformation
|
||||
*/
|
||||
async getWallet(driverId: string): Promise<WalletViewModel> {
|
||||
const dto = await this.apiClient.getWallet(driverId);
|
||||
return new WalletViewModel(dto);
|
||||
const { wallet, transactions } = await this.apiClient.getWallet(driverId);
|
||||
return new WalletViewModel({ ...wallet, transactions: transactions as FullTransactionDto[] });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user