website refactor
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Penalties can be applied as a result of an upheld protest or directly by stewards.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
import { AppliedAt } from '../AppliedAt';
|
||||
import { DriverId } from '../DriverId';
|
||||
@@ -60,8 +60,9 @@ export function penaltyTypeRequiresValue(type: PenaltyTypeValue): boolean {
|
||||
return PENALTY_TYPES_REQUIRING_VALUE.includes(type);
|
||||
}
|
||||
|
||||
export class Penalty implements Entity<string> {
|
||||
private constructor(private readonly props: PenaltyProps) {}
|
||||
export class Penalty extends Entity<PenaltyId> {
|
||||
private constructor(private readonly props: PenaltyProps) {
|
||||
super(props.id);}
|
||||
|
||||
static create(props: {
|
||||
id: string;
|
||||
@@ -154,7 +155,6 @@ export class Penalty implements Entity<string> {
|
||||
});
|
||||
}
|
||||
|
||||
get id(): string { return this.props.id.toString(); }
|
||||
get leagueId(): string { return this.props.leagueId.toString(); }
|
||||
get raceId(): string { return this.props.raceId.toString(); }
|
||||
get driverId(): string { return this.props.driverId.toString(); }
|
||||
|
||||
Reference in New Issue
Block a user