wip
This commit is contained in:
@@ -23,6 +23,7 @@ export type PenaltyStatus = 'pending' | 'applied' | 'appealed' | 'overturned';
|
||||
|
||||
export interface PenaltyProps {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
raceId: string;
|
||||
/** The driver receiving the penalty */
|
||||
driverId: string;
|
||||
@@ -51,6 +52,7 @@ export class Penalty implements IEntity<string> {
|
||||
|
||||
static create(props: PenaltyProps): Penalty {
|
||||
if (!props.id) throw new RacingDomainValidationError('Penalty ID is required');
|
||||
if (!props.leagueId) throw new RacingDomainValidationError('League ID is required');
|
||||
if (!props.raceId) throw new RacingDomainValidationError('Race ID is required');
|
||||
if (!props.driverId) throw new RacingDomainValidationError('Driver ID is required');
|
||||
if (!props.type) throw new RacingDomainValidationError('Penalty type is required');
|
||||
@@ -72,6 +74,7 @@ export class Penalty implements IEntity<string> {
|
||||
}
|
||||
|
||||
get id(): string { return this.props.id; }
|
||||
get leagueId(): string { return this.props.leagueId; }
|
||||
get raceId(): string { return this.props.raceId; }
|
||||
get driverId(): string { return this.props.driverId; }
|
||||
get type(): PenaltyType { return this.props.type; }
|
||||
|
||||
Reference in New Issue
Block a user