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

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

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

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

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