Interface RewardReportService


public interface RewardReportService
A storage service to save/load reward settings
  • Method Details

    • computeRewards

      RewardReport computeRewards(LocalDate localDate)
      Compute rewards swicth configurations for the list of identities passed in parameters
      Parameters:
      localDate - a LocalDate inside the period time that will be retrieved
      Returns:
      a Set of WalletReward with the details of sent tokens and tokens to send
    • computeRewardsByUser

      RewardReport computeRewardsByUser(LocalDate localDate, long userIdentityId)
      Compute rewards By User
      Parameters:
      localDate - a LocalDate inside the period time that will be retrieved
      userIdentityId - User technical identifier (Identity.getId())
      Returns:
      a Set of WalletReward with the details of sent tokens and tokens to send
    • sendRewards

      void sendRewards(LocalDate localDate, String username) throws Exception
      Send rewards transactions
      Parameters:
      localDate - a LocalDate inside the period time that will be retrieved
      username - current username sending rewards
      Throws:
      Exception - if an error occurs while sending the rewards transactions on blockchain
    • getRewardReport

      RewardReport getRewardReport(LocalDate localDate)
      Retrieve a RewardReport corresponding to a period of time
      Parameters:
      localDate - a LocalDate inside the period time that will be retrieved
      Returns:
      RewardReport if there is a saved one, else null
    • getRewardPeriod

      RewardPeriod getRewardPeriod(RewardPeriodType periodType, LocalDate date)
      Return the stored reward period associated to select period type and date
      Parameters:
      periodType - RewardPeriodType
      date - LocalDate
      Returns:
      RewardPeriod
    • getRewardReportByPeriodId

      RewardReport getRewardReportByPeriodId(long periodId)
      Retrieve a RewardReport corresponding to a period identified by its id
      Parameters:
      periodId - technical identifier of RewardPeriod
      Returns:
      RewardReport
    • saveRewardReport

      void saveRewardReport(RewardReport rewardReport)
      Parameters:
      rewardReport - save generated reward report
    • isRewardSendingInProgress

      boolean isRewardSendingInProgress()
      Returns:
      true if reward sending status storage is in progress, else return false
    • getRewardPeriodsInProgress

      List<RewardPeriod> getRewardPeriodsInProgress()
      Returns:
      a List of RewardPeriod that are in progress
    • getRewardPeriodsNotSent

      List<RewardPeriod> getRewardPeriodsNotSent()
    • findRewardReportPeriods

      List<RewardPeriod> findRewardReportPeriods(int offset, int limit)
      Retrieves the list of periods sorted descending by start date
      Parameters:
      offset - offset of query
      limit - limit of results
      Returns:
      List of RewardPeriod
    • listRewards

      List<WalletReward> listRewards(String currentUser, int limit)
      Parameters:
      currentUser - current user listing his rewards
      limit - size limit of items to return
      Returns:
      a List of WalletReward of current user
    • countRewards

      double countRewards(String currentUser)
      Parameters:
      currentUser - the current user listing his rewards
      Returns:
      a total rewards sent for current person
    • replaceRewardTransactions

      void replaceRewardTransactions(String oldHash, String newHash)
      Replaces an old reward transaction hash to a new one, that had boosted the first one
      Parameters:
      oldHash - old Transaction hash
      newHash - new Transaction hash