import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../../errors/RacingDomainError'; export interface DriverIdProps { value: string; } export class DriverId implements ValueObject { private constructor(private readonly value: string) {} static create(value: string): DriverId { if (!value || value.trim().length === 0) { throw new RacingDomainValidationError('Driver ID is required'); } return new DriverId(value.trim()); } toString(): string { return this.value; } equals(other: ValueObject): boolean { return this.props.value === other.props.value; } get props(): DriverIdProps { return { value: this.value }; } }