This commit is contained in:
2025-12-12 01:11:36 +01:00
parent ec3ddc3a5c
commit 6a88fe93ab
125 changed files with 1513 additions and 803 deletions

View File

@@ -102,12 +102,16 @@ export class Penalty implements IEntity<string> {
if (this.props.status === 'overturned') {
throw new RacingDomainInvariantError('Cannot apply an overturned penalty');
}
return new Penalty({
const base: PenaltyProps = {
...this.props,
status: 'applied',
appliedAt: new Date(),
notes,
});
};
const next: PenaltyProps =
notes !== undefined ? { ...base, notes } : base;
return Penalty.create(next);
}
/**