import { RacingDomainValidationError } from '../errors/RacingDomainError';

export class RaceId {
  private constructor(private readonly value: string) {}

  static create(value: string): RaceId {
    if (!value || value.trim().length === 0) {
      throw new RacingDomainValidationError('Race ID cannot be empty');
    }
    return new RaceId(value.trim());
  }

  toString(): string {
    return this.value;
  }

  equals(other: RaceId): boolean {
    return this.value === other.value;
  }
}