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

export type MembershipStatusValue = 'active' | 'inactive' | 'pending';

export class MembershipStatus {
  private constructor(private readonly value: MembershipStatusValue) {}

  static create(value: MembershipStatusValue): MembershipStatus {
    if (!value) {
      throw new RacingDomainValidationError('Membership status is required');
    }
    return new MembershipStatus(value);
  }

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

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