wip
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
/**
|
||||
* Domain Entity: Car
|
||||
*/
|
||||
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
*
|
||||
* Represents a racing car/vehicle in the GridPilot platform.
|
||||
* Immutable entity with factory methods and domain validation.
|
||||
@@ -90,19 +93,19 @@ export class Car {
|
||||
gameId: string;
|
||||
}): void {
|
||||
if (!props.id || props.id.trim().length === 0) {
|
||||
throw new Error('Car ID is required');
|
||||
throw new RacingDomainValidationError('Car ID is required');
|
||||
}
|
||||
|
||||
if (!props.name || props.name.trim().length === 0) {
|
||||
throw new Error('Car name is required');
|
||||
throw new RacingDomainValidationError('Car name is required');
|
||||
}
|
||||
|
||||
if (!props.manufacturer || props.manufacturer.trim().length === 0) {
|
||||
throw new Error('Car manufacturer is required');
|
||||
throw new RacingDomainValidationError('Car manufacturer is required');
|
||||
}
|
||||
|
||||
if (!props.gameId || props.gameId.trim().length === 0) {
|
||||
throw new Error('Game ID is required');
|
||||
throw new RacingDomainValidationError('Game ID is required');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user