Files
gridpilot.gg/apps/website/lib/services/payments/WalletService.ts
2025-12-18 01:20:23 +01:00

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);
}
}