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

import com.red.circle.common.business.dto.cmd.PageUserIdCmd;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.wallet.inner.model.cmd.AddBeanIncomeExpenditureCmd;
import com.red.circle.wallet.inner.model.cmd.BeanReceiptCmd;
import com.red.circle.wallet.inner.model.cmd.UserBeanIncomeExpenditurePageQryCmd;
import com.red.circle.wallet.inner.model.dto.BeanBalanceDTO;
import com.red.circle.wallet.inner.model.dto.UserBeanIncomeExpenditureDTO;
import com.red.circle.wallet.inner.model.dto.WalletReceiptDTO;
import java.math.BigDecimal;

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

  /**
   * 用户钱包豆子余额.
   *
   * @param userId 用户id
   */
  BigDecimal getBalance(Long userId);

  /**
   * 改变豆子余额.
   *
   * @param cmd 单据
   * @return 余额
   */
  WalletReceiptDTO changeBalance(BeanReceiptCmd cmd);

  /**
   * 分页查询余额.
   */
  PageResult<BeanBalanceDTO> pageBeanBalance(PageUserIdCmd cmd);

  /**
   * 流水分页列表.
   *
   * @param query 查询条件
   * @return page
   */
  PageResult<UserBeanIncomeExpenditureDTO> pageRunningWater(
      UserBeanIncomeExpenditurePageQryCmd query);

  /**
   * 保存豆子收支
   */
  void saveBeanIncome(AddBeanIncomeExpenditureCmd cmd);
}
