website refactor
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { ProtestDetailViewData } from '@/lib/view-data/leagues/ProtestDetailViewData';
|
||||
|
||||
interface ProtestDetailApiDto {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
status: string;
|
||||
submittedAt: string;
|
||||
incident: {
|
||||
lap: number;
|
||||
description: string;
|
||||
};
|
||||
protestingDriver: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
accusedDriver: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
race: {
|
||||
id: string;
|
||||
name: string;
|
||||
scheduledAt: string;
|
||||
};
|
||||
penaltyTypes: Array<{
|
||||
type: string;
|
||||
label: string;
|
||||
description: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export class ProtestDetailViewDataBuilder {
|
||||
static build(apiDto: ProtestDetailApiDto): ProtestDetailViewData {
|
||||
return {
|
||||
protestId: apiDto.id,
|
||||
leagueId: apiDto.leagueId,
|
||||
status: apiDto.status,
|
||||
submittedAt: apiDto.submittedAt,
|
||||
incident: apiDto.incident,
|
||||
protestingDriver: apiDto.protestingDriver,
|
||||
accusedDriver: apiDto.accusedDriver,
|
||||
race: apiDto.race,
|
||||
penaltyTypes: apiDto.penaltyTypes,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user