website refactor

This commit is contained in:
2026-01-16 16:46:57 +01:00
parent 37b1aa626c
commit 2f53727702
445 changed files with 1160 additions and 1150 deletions

View File

@@ -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(); }