22 lines
630 B
TypeScript
22 lines
630 B
TypeScript
import { PaymentsApiClient } from '../../api/payments/PaymentsApiClient';
|
|
import { WalletViewModel } from '../../view-models';
|
|
|
|
/**
|
|
* Wallet Service
|
|
*
|
|
* Orchestrates wallet operations by coordinating API calls and view model creation.
|
|
* All dependencies are injected via constructor.
|
|
*/
|
|
export class WalletService {
|
|
constructor(
|
|
private readonly apiClient: PaymentsApiClient
|
|
) {}
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
} |