78 lines
2.0 KiB
TypeScript
78 lines
2.0 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 StewardingCommand {
|
|
leagueId?: string;
|
|
protestId?: string;
|
|
driverId?: string;
|
|
raceId?: string;
|
|
penaltyType?: string;
|
|
penaltyValue?: number;
|
|
reason?: string;
|
|
adminId?: string;
|
|
stewardId?: string;
|
|
stewardNotes?: string;
|
|
}
|
|
|
|
export class StewardingMutation implements Mutation<StewardingCommand, void, string> {
|
|
private readonly service: LeagueService;
|
|
|
|
constructor() {
|
|
this.service = new LeagueService();
|
|
}
|
|
|
|
async execute(_command: StewardingCommand): Promise<Result<void, string>> {
|
|
return Result.err('Use specific methods');
|
|
}
|
|
|
|
async applyPenalty(input: {
|
|
protestId: string;
|
|
penaltyType: string;
|
|
penaltyValue: number;
|
|
stewardNotes: string;
|
|
raceId: string;
|
|
accusedDriverId: string;
|
|
reason: string;
|
|
}): Promise<Result<void, string>> {
|
|
try {
|
|
// TODO: Implement service method when available
|
|
console.log('applyPenalty called with:', input);
|
|
return Result.ok(undefined);
|
|
} catch (error) {
|
|
return Result.ok(undefined);
|
|
}
|
|
}
|
|
|
|
async requestDefense(input: {
|
|
protestId: string;
|
|
stewardId: string;
|
|
}): Promise<Result<void, string>> {
|
|
try {
|
|
// TODO: Implement service method when available
|
|
console.log('requestDefense called with:', input);
|
|
return Result.ok(undefined);
|
|
} catch (error) {
|
|
return Result.ok(undefined);
|
|
}
|
|
}
|
|
|
|
async quickPenalty(input: {
|
|
leagueId: string;
|
|
driverId: string;
|
|
raceId: string;
|
|
penaltyType: string;
|
|
penaltyValue: number;
|
|
reason: string;
|
|
adminId: string;
|
|
}): Promise<Result<void, string>> {
|
|
try {
|
|
// TODO: Implement service method when available
|
|
console.log('quickPenalty called with:', input);
|
|
return Result.ok(undefined);
|
|
} catch (error) {
|
|
return Result.ok(undefined);
|
|
}
|
|
}
|
|
}
|