package com.red.circle.other.infra.database.mongo.service.live;

import com.red.circle.other.infra.database.mongo.entity.live.RoomContributionRankCount;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 房间贡献统计.
 *
 * @author pengliang on 2021/9/15
 */
public interface RoomContributionRankCountService {

  /**
   * 房间贡献累计.
   *
   * @param sysOrigin 归属系统
   * @param roomId    房间id
   * @param userId    用户id
   * @param quantity  数量
   */
  void incr(String sysOrigin, Long roomId, Long userId, BigDecimal quantity);

  @Deprecated
  void decr(Long roomId, Long userId, BigDecimal quantity);

  /**
   * 获取贡献置顶top数量.
   */
  List<RoomContributionRankCount> listTop(String dateType, Long roomId, Integer size);

  /**
   * 获取当天top榜单.
   *
   * @param roomId 房间id
   * @param size   数量
   * @return list
   */
  List<RoomContributionRankCount> listDayTop(Long roomId, Integer size);

  /**
   * 获取指定用户贡献-当天.
   *
   * @param roomId  房间id
   * @param userIds 用户id
   * @return 映射
   */
  Map<Long, Long> mapDayByUserIds(Long roomId, Set<Long> userIds);

  /**
   * 获取当天top 1.
   *
   * @param roomId 房间id
   * @return list
   */
  RoomContributionRankCount getDayTopOne(Long roomId);

  /**
   * 获取当天我的贡献信息.
   *
   * @param roomId 房间id
   * @param userId 用户id
   * @return list
   */
  RoomContributionRankCount getDayByUserId(Long roomId, Long userId);

  /**
   * 矫正数据.
   */
  void correctionData(BigDecimal quantity, Long roomId, Long userId);

}
