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

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

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

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

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