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

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

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

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

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