package com.red.circle.game.fruit.infrastructure.database.repository;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.mybatis.service.BaseService;
import com.red.circle.game.fruit.application.dto.clientobject.GameFruitUserBetRecordCO;
import com.red.circle.game.fruit.infrastructure.database.entity.GameFruitUserBetRecord;
import com.red.circle.game.fruit.inner.model.cmd.GameDataStatisticalCmd;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 用户每轮下注情况 服务类.
 * </p>
 *
 * @author lisizhe on 2023-11-30 19:18
 */
public interface GameFruitUserBetRecordService extends BaseService<GameFruitUserBetRecord> {

  BigDecimal getUserEarnings(Long userId, Long gameId);

  BigDecimal sumInvest(Long userId, Long gameId);

  List<GameFruitUserBetRecordCO> listUserBetByGameId(Long gameId, String sysOrigin);

  void addBetAmount(List<GameFruitUserBetRecord> list);

  void updateOrAddBetAmount(GameFruitUserBetRecord gameFruitUserBetRecord);

  List<GameFruitUserBetRecord> listLotteryInfo(Long gameId, Set<Long> prizeIds);

  void updateWinnerStatus(Long gameId, Set<Long> winnerIds, Set<Long> prizeIds);

  List<GameFruitUserBetRecord> listLotteryUsers(Long gameId, Set<Long> userIds);

  List<GameFruitUserBetRecord> listLotteryUser(Long gameId, Long userId);

  GameFruitUserBetRecord getLotteryInfo(Long prizeId, Long gameId, Long userId);

  Map<Long, List<GameFruitUserBetRecord>> gameFruitWinnerMapList(Long gameId, String sysOrigin);

  Map<Long, List<GameFruitUserBetRecord>> gameFruitTransportMapList(Long gameId, Set<Long> userIds);

  Set<Long> listBetGameId(Long lastId, Long userId);

  Map<Long, List<GameFruitUserBetRecord>> listPlayersBetHistory(Set<Long> gameIds, Long userId);

  PageResult<GameFruitUserBetRecord> pageUserBetRecord(GameDataStatisticalCmd cmd);

  List<GameFruitUserBetRecord> listUserBetRecord(GameDataStatisticalCmd cmd, Integer isWinner);
}
