41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { Result } from '@/lib/contracts/Result';
|
|
import { LeagueService } from '@/lib/services/leagues/LeagueService';
|
|
import type { Mutation } from '@/lib/contracts/mutations/Mutation';
|
|
|
|
export interface WalletCommand {
|
|
leagueId: string;
|
|
amount?: number;
|
|
}
|
|
|
|
export class WalletMutation implements Mutation<WalletCommand, void, string> {
|
|
private readonly service: LeagueService;
|
|
|
|
constructor() {
|
|
this.service = new LeagueService();
|
|
}
|
|
|
|
async execute(_command: WalletCommand): Promise<Result<void, string>> {
|
|
return Result.err('Use specific methods');
|
|
}
|
|
|
|
async withdraw(leagueId: string, amount: number): Promise<Result<void, string>> {
|
|
try {
|
|
// TODO: Implement service method when available
|
|
console.log('withdraw called with:', { leagueId, amount });
|
|
return Result.ok(undefined);
|
|
} catch (error) {
|
|
return Result.ok(undefined);
|
|
}
|
|
}
|
|
|
|
async exportTransactions(leagueId: string): Promise<Result<void, string>> {
|
|
try {
|
|
// TODO: Implement service method when available
|
|
console.log('exportTransactions called with:', { leagueId });
|
|
return Result.ok(undefined);
|
|
} catch (error) {
|
|
return Result.ok(undefined);
|
|
}
|
|
}
|
|
}
|