package com.red.circle.wallet.inner.service.wallet;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.wallet.inner.model.cmd.DiamondReceiptCmd;
import com.red.circle.wallet.inner.model.cmd.UserDiamondBalanceQryCmd;
import com.red.circle.wallet.inner.model.cmd.UserDiamondOriginQryCmd;
import com.red.circle.wallet.inner.model.cmd.UserDiamondRunWaterQryCmd;
import com.red.circle.wallet.inner.model.dto.DiamondBalanceDTO;
import com.red.circle.wallet.inner.model.dto.UserDiamondOriginDTO;
import com.red.circle.wallet.inner.model.dto.UserDiamondRunWaterDTO;
import com.red.circle.wallet.inner.model.dto.WalletReceiptDTO;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Map;

/**
 * @author pengliang on 2023/5/26
 */
public interface WalletDiamondClientService {

  /**
   * 用户钱包钻石余额.
   *
   * @param userId 用户id
   * @return 钱包
   */
  BigDecimal getBalance(Long userId);

  /**
   * 改变钻石余额.
   *
   * @param cmd 单据
   * @return 余额
   */
  WalletReceiptDTO changeBalance(DiamondReceiptCmd cmd);

  /**
   * 钻石余额列表
   */
  PageResult<DiamondBalanceDTO> pageUserDiamondBalance(UserDiamondBalanceQryCmd query);


  /**
   * 钻石余额列表
   */
  PageResult<UserDiamondRunWaterDTO> pageUserDiamondRunWater(UserDiamondRunWaterQryCmd query);


  /**
   * 获取钻石流水分页列表
   *
   * @param query 查询条件
   * @return page
   */
  PageResult<UserDiamondOriginDTO> pageUserDiamondOriginDetails(UserDiamondOriginQryCmd query);


  /**
   * 钻石余额.
   */
  Map<Long, BigDecimal> mapBalance(Collection<Long> userIds);

  /**
   * 工资钻石余额.
   */
  Map<Long, BigDecimal> salaryMapBalance(Collection<Long> userIds);


  void autoExchangeGold(Long userId, BigDecimal amount);
}
