34 lines
938 B
TypeScript
34 lines
938 B
TypeScript
import { GetLeagueOwnerSummaryOutputPort } from '@core/racing/application/ports/output/GetLeagueOwnerSummaryOutputPort';
|
|
import { LeagueOwnerSummaryDTO } from '../dtos/LeagueOwnerSummaryDTO';
|
|
|
|
export class GetLeagueOwnerSummaryPresenter {
|
|
private result: LeagueOwnerSummaryDTO | null = null;
|
|
|
|
reset() {
|
|
this.result = null;
|
|
}
|
|
|
|
present(output: GetLeagueOwnerSummaryOutputPort) {
|
|
if (!output.summary) {
|
|
this.result = null;
|
|
return;
|
|
}
|
|
|
|
this.result = {
|
|
driver: {
|
|
id: output.summary.driver.id,
|
|
iracingId: output.summary.driver.iracingId,
|
|
name: output.summary.driver.name,
|
|
country: output.summary.driver.country,
|
|
bio: output.summary.driver.bio,
|
|
joinedAt: output.summary.driver.joinedAt,
|
|
},
|
|
rating: output.summary.rating,
|
|
rank: output.summary.rank,
|
|
};
|
|
}
|
|
|
|
getViewModel(): LeagueOwnerSummaryDTO | null {
|
|
return this.result;
|
|
}
|
|
} |