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
    • saveRewardReport

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

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

      List<RewardPeriod> getRewardPeriodsNotSent()
    • 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