import { DepositTransaction } from '@/domain/aggregates/deposit-transaction';
import { ChainType, TxHash } from '@/domain/value-objects';
import { DepositStatus } from '@/domain/enums';

export const DEPOSIT_TRANSACTION_REPOSITORY = Symbol('DEPOSIT_TRANSACTION_REPOSITORY');

export interface IDepositTransactionRepository {
  /**
   * 保存充值交易
   */
  save(deposit: DepositTransaction): Promise<DepositTransaction>;

  /**
   * 根据ID查找
   */
  findById(id: bigint): Promise<DepositTransaction | null>;

  /**
   * 根据交易哈希查找
   */
  findByTxHash(txHash: TxHash): Promise<DepositTransaction | null>;

  /**
   * 根据状态查找
   */
  findByStatus(chainType: ChainType, status: DepositStatus): Promise<DepositTransaction[]>;

  /**
   * 查找待确认的充值
   */
  findPendingConfirmation(chainType: ChainType): Promise<DepositTransaction[]>;

  /**
   * 查找待通知的充值
   */
  findPendingNotification(): Promise<DepositTransaction[]>;

  /**
   * 根据用户ID查找
   */
  findByUserId(userId: bigint, limit?: number): Promise<DepositTransaction[]>;

  /**
   * 检查交易是否存在
   */
  existsByTxHash(txHash: TxHash): Promise<boolean>;
}
