package com.red.circle.wallet.domain.gateway;

import com.red.circle.tool.core.tuple.PennyAmount;
import com.red.circle.wallet.domain.wallet.RecoveryGoldReceipt;
import com.red.circle.wallet.domain.wallet.RefundBackReceipt;
import com.red.circle.wallet.domain.wallet.WalletReceipt;
import com.red.circle.wallet.domain.wallet.WalletReceiptRes;

/**
 * 钱包 - 金币.
 *
 * @author pengliang on 2021/8/20
 */
public interface WalletGoldGateway {

  /**
   * 用户钱包金币余额.
   *
   * @param userId 用户id
   * @return 钱包
   */
  PennyAmount getBalance(Long userId);

  /**
   * 改变金币余额.
   *
   * @return 余额
   */
  WalletReceiptRes changeBalance(WalletReceipt receipt);

  /**
   * 回收金币-退款.
   * <p>金币数额不足， 抹到0<p/>
   */
  void refundBack(RefundBackReceipt receipt);

  /**
   * 回收金币.
   * <p>金币数额不足， 抹到0<p/>
   */
  void recovery(RecoveryGoldReceipt receipt);

}
