import { Injectable, Inject } from '@nestjs/common';
import {
  UserAccountRepository,
  USER_ACCOUNT_REPOSITORY,
} from '@/domain/repositories/user-account.repository.interface';
import { AccountSequence } from '@/domain/value-objects';

@Injectable()
export class AccountSequenceGeneratorService {
  constructor(
    @Inject(USER_ACCOUNT_REPOSITORY)
    private readonly repository: UserAccountRepository,
  ) {}

  async generateNextUserSequence(): Promise<AccountSequence> {
    return this.repository.getNextAccountSequence();
  }
}
