/**
 * 账户序列号值对象
 * 跨服务关联的唯一标识
 */
export class AccountSequence {
  private readonly _value: string;

  constructor(value: string) {
    if (!value || value.trim().length === 0) {
      throw new Error('AccountSequence cannot be empty');
    }
    if (value.length > 20) {
      throw new Error('AccountSequence cannot exceed 20 characters');
    }
    this._value = value.trim();
  }

  get value(): string {
    return this._value;
  }

  equals(other: AccountSequence): boolean {
    return this._value === other._value;
  }

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

  static create(value: string): AccountSequence {
    return new AccountSequence(value);
  }
}
