code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped

This commit is contained in:
2026-01-26 22:16:33 +01:00
parent f2bd80ccd3
commit 09632d004d
72 changed files with 1946 additions and 277 deletions

View File

@@ -1,14 +1,14 @@
import { Result } from '@/lib/contracts/Result';
import { DomainError, Service } from '@/lib/contracts/services/Service';
import { WalletsApiClient } from '@/lib/gateways/api/wallets/WalletsApiClient';
import { LeagueWalletApiDto } from '@/lib/types/tbd/LeagueWalletApiDto';
import type { GetLeagueWalletOutputDTO, WalletTransactionDTO } from '@/lib/types/generated';
import { injectable, unmanaged } from 'inversify';
@injectable()
export class LeagueWalletService implements Service {
constructor(@unmanaged() private readonly apiClient?: WalletsApiClient) {}
async getWalletForLeague(leagueId: string): Promise<LeagueWalletApiDto> {
async getWalletForLeague(leagueId: string): Promise<GetLeagueWalletOutputDTO> {
if (this.apiClient) {
const res = await this.apiClient.getLeagueWallet(leagueId);
return ((res as any).value || res) as any;
@@ -38,10 +38,9 @@ export class LeagueWalletService implements Service {
return { success: true };
}
async getWalletData(leagueId: string): Promise<Result<LeagueWalletApiDto, DomainError>> {
async getWalletData(leagueId: string): Promise<Result<GetLeagueWalletOutputDTO, DomainError>> {
// Mock data since backend not implemented
const mockData: LeagueWalletApiDto = {
leagueId,
const mockData: GetLeagueWalletOutputDTO = {
balance: 15750.00,
currency: 'USD',
totalRevenue: 7500.00,
@@ -55,7 +54,9 @@ export class LeagueWalletService implements Service {
type: 'sponsorship',
amount: 5000.00,
description: 'Main sponsorship from Acme Racing',
createdAt: '2024-10-01T10:00:00Z',
fee: 0,
netAmount: 5000.00,
date: '2024-10-01T10:00:00Z',
status: 'completed',
},
{
@@ -63,7 +64,9 @@ export class LeagueWalletService implements Service {
type: 'prize',
amount: 2500.00,
description: 'Prize money from championship',
createdAt: '2024-09-15T14:30:00Z',
fee: 0,
netAmount: 2500.00,
date: '2024-09-15T14:30:00Z',
status: 'completed',
},
{
@@ -71,7 +74,9 @@ export class LeagueWalletService implements Service {
type: 'withdrawal',
amount: -1200.00,
description: 'Equipment purchase',
createdAt: '2024-09-10T09:15:00Z',
fee: 0,
netAmount: -1200.00,
date: '2024-09-10T09:15:00Z',
status: 'completed',
},
{
@@ -79,7 +84,9 @@ export class LeagueWalletService implements Service {
type: 'deposit',
amount: 5000.00,
description: 'Entry fees from season registration',
createdAt: '2024-08-01T12:00:00Z',
fee: 0,
netAmount: 5000.00,
date: '2024-08-01T12:00:00Z',
status: 'completed',
},
],