Files
gridpilot.gg/apps/website/lib/mutations/leagues/WalletMutation.ts
Marc Mintel 1b0a1f4aee
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 7m11s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-24 23:29:55 +01:00

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