website refactor

This commit is contained in:
2026-01-17 15:46:55 +01:00
parent 4d5ce9bfd6
commit 72a626ce71
346 changed files with 19308 additions and 8605 deletions

View File

@@ -1,9 +1,16 @@
import { Result } from '@/lib/contracts/Result';
import { Service, DomainError } from '@/lib/contracts/services/Service';
import { LeagueWalletApiDto } from '@/lib/types/tbd/LeagueWalletApiDto';
import { WalletsApiClient } from '@/lib/api/wallets/WalletsApiClient';
export class LeagueWalletService implements Service {
constructor(private readonly apiClient?: WalletsApiClient) {}
async getWalletForLeague(leagueId: string): Promise<LeagueWalletApiDto> {
if (this.apiClient) {
const res = await this.apiClient.getLeagueWallet(leagueId);
return ((res as any).value || res) as any;
}
const result = await this.getWalletData(leagueId);
if (result.isErr()) throw new Error(result.getError().message);
return result.unwrap();
@@ -14,8 +21,17 @@ export class LeagueWalletService implements Service {
amount: number,
currency: string,
seasonId: string,
destinationId: string
destinationAccount: string
): Promise<{ success: boolean; message?: string }> {
if (this.apiClient) {
const res = await this.apiClient.withdrawFromLeagueWallet(leagueId, {
amount,
currency,
seasonId,
destinationAccount,
});
return (res as any).value || res;
}
// Mock implementation
return { success: true };
}