code quality
This commit is contained in:
@@ -41,7 +41,17 @@ export class ProtestReviewMutation implements Mutation<ApplyPenaltyCommand | Req
|
||||
|
||||
async applyPenalty(input: ApplyPenaltyCommand): Promise<Result<void, DomainError>> {
|
||||
try {
|
||||
const result = await this.service.applyPenalty(input);
|
||||
const dto = {
|
||||
raceId: input.raceId,
|
||||
driverId: input.accusedDriverId,
|
||||
stewardId: 'system', // Missing in command
|
||||
type: input.penaltyType,
|
||||
value: input.penaltyValue,
|
||||
reason: input.reason,
|
||||
protestId: input.protestId,
|
||||
notes: input.stewardNotes
|
||||
};
|
||||
const result = await this.service.applyPenalty(dto);
|
||||
if (result.isErr()) {
|
||||
return Result.err(result.getError());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user