35 lines
798 B
TypeScript
35 lines
798 B
TypeScript
import { ViewModel } from "../contracts/view-models/ViewModel";
|
|
import type { ImportRaceResultsSummaryViewData } from "../view-data/ImportRaceResultsSummaryViewData";
|
|
|
|
export class ImportRaceResultsSummaryViewModel extends ViewModel {
|
|
private readonly data: ImportRaceResultsSummaryViewData;
|
|
|
|
constructor(data: ImportRaceResultsSummaryViewData) {
|
|
super();
|
|
this.data = data;
|
|
}
|
|
|
|
get success(): boolean {
|
|
return this.data.success;
|
|
}
|
|
|
|
get raceId(): string {
|
|
return this.data.raceId;
|
|
}
|
|
|
|
get driversProcessed(): number {
|
|
return this.data.driversProcessed;
|
|
}
|
|
|
|
get resultsRecorded(): number {
|
|
return this.data.resultsRecorded;
|
|
}
|
|
|
|
get errors(): string[] {
|
|
return this.data.errors;
|
|
}
|
|
|
|
get hasErrors(): boolean {
|
|
return this.errors.length > 0;
|
|
}
|
|
} |