This commit is contained in:
2025-12-11 11:25:22 +01:00
parent 6a427eab57
commit e4c1be628d
86 changed files with 1222 additions and 736 deletions

View File

@@ -1,3 +1,5 @@
import { RacingDomainValidationError } from '../errors/RacingDomainError';
export class Game {
readonly id: string;
readonly name: string;
@@ -9,11 +11,11 @@ export class Game {
static create(props: { id: string; name: string }): Game {
if (!props.id || props.id.trim().length === 0) {
throw new Error('Game ID is required');
throw new RacingDomainValidationError('Game ID is required');
}
if (!props.name || props.name.trim().length === 0) {
throw new Error('Game name is required');
throw new RacingDomainValidationError('Game name is required');
}
return new Game({