package com.red.circle.other.infra.database.mongo.service.user.count;

import com.red.circle.other.infra.database.mongo.entity.user.count.WeekCpValueCount;
import java.util.List;
import org.apache.commons.lang3.tuple.ImmutablePair;

/**
 * 每周cp统计.
 *
 * @author pengliang on 2022/3/2
 */
public interface WeekCpValueCountService {

  /**
   * 累计本周统计.
   */
  void incrThisWeekQuantity(String sysOrigin, Long userIdOne, Long userIdTwo, Long quantity);

  /**
   * 根据区域累计本周统计.
   */
  void incrThisWeekQuantity(String sysOrigin, String userRegionCode, Long userIdOne, Long userIdTwo,
      Long quantity);

  /**
   * 获取我的本周贡献.
   */
  WeekCpValueCount getUserThisWeekCount(String sysOrigin, Long userIdOne, Long userIdTwo);

  /**
   * 获取本周统计记录top.
   */
  List<WeekCpValueCount> listThisWeekTop(String sysOrigin, Integer size);

  /**
   * 根据用户所属区域获取本周统计记录top.
   */
  List<WeekCpValueCount> listThisWeekTop(String sysOrigin, String userRegionCode, Integer size);

  /**
   * 获取上周统计记录top.
   */
  List<WeekCpValueCount> listLastWeekTop(String sysOrigin, Integer size);

  /**
   * 根据用户所属区域获取上周统计记录top.
   */
  List<WeekCpValueCount> listLastWeekTop(String sysOrigin, String userRegionCode, Integer size);

  /**
   * 移除本周cp值.
   */
  void removeThisWeek(Long userIdOne, Long userIdTwo);

  /**
   * 累计本赛季统计.
   */
  void incrThisSeasonQuantity(String sysOrigin, Long userIdOne, Long userIdTwo, Long quantity);

  /**
   * 移除本赛季cp值.
   */
  void removeThisSeason(Long userIdOne, Long userIdTwo);

  /**
   * 获取我的本赛季贡献.
   */
  WeekCpValueCount getUserThisSeasonCount(String sysOrigin, Long userIdOne, Long userIdTwo);

  /**
   * 获取本赛季统计记录top.
   */
  List<WeekCpValueCount> listThisSeasonTop(String sysOrigin, Integer size);

  /**
   * 获取上赛季统计记录top.
   */
  List<WeekCpValueCount> listLastSeasonTop(String sysOrigin, Integer size);

  /**
   * 获取指定赛季cycleKey的统计记录top.
   */
  List<WeekCpValueCount> listSeasonTopByCycleKey(String sysOrigin, String cycleKey, Integer size);

  /**
   * 解析id中cp用户id.
   */
  ImmutablePair<Long, Long> parseUserIdPair(String id);

  /**
   * 矫正数据.
   */
  void correctionData(Long userIdOne, Long userIdTwo, Long quantity);

}
