package com.red.circle.wallet.infra.database.rds.service.diamond;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.mybatis.service.BaseService;
import com.red.circle.tool.core.tuple.PennyAmount;
import com.red.circle.wallet.infra.database.rds.entity.diamond.SalaryDiamondBalance;
import com.red.circle.wallet.inner.model.cmd.UserSalaryDiamondBalanceQryCmd;
import com.red.circle.wallet.inner.model.cmd.UserSalaryDiamondCmd;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户工资钻石余额 服务类.
 * </p>
 *
 * @author zongpubin on 2024-03-13 10:56
 */
public interface SalaryDiamondBalanceService extends BaseService<SalaryDiamondBalance> {

  PageResult<SalaryDiamondBalance> listUserSalaryDiamondBalance(
      UserSalaryDiamondBalanceQryCmd query);

  boolean exists(Long userId);

  boolean incr(UserSalaryDiamondCmd param);

  SalaryDiamondBalance getBalance(Long userId);

  SalaryDiamondBalance decr(UserSalaryDiamondCmd param);

  SalaryDiamondBalance decr(Long userId, PennyAmount amount);

  /**
   * 钻石余额.
   * @param userIds 用户id
   */
  Map<Long, BigDecimal> mapBalance(List<Long> userIds);

  Map<Long, BigDecimal> mapBalanceBySysOrigin(String sysOrigin);
}
