...
 
......@@ -33,6 +33,7 @@ class overview implements Interfaces\Api
'yourContribution' => $overview->getYourContribution(),
'totalNetworkContribution' => $overview->getTotalNetworkContribution(),
'yourShare' => $overview->getYourShare(),
'yourRewardFactor' => $overview->getYourRewardFactor()
];
return Factory::response($response);
}
......
......@@ -8,6 +8,7 @@
namespace Minds\Core\Rewards\Contributions;
use Minds\Core\Analytics\UserStates\RewardFactor;
use Minds\Core\Data\cache\abstractCacher;
use Minds\Core\Di\Di;
use Minds\Core\Util\BigNumber;
......@@ -41,6 +42,8 @@ class Overview
/** @var float */
protected $yourShare = 0;
/** @var float */
protected $yourRewardFactor = 1;
public function __construct($sums = null, $repository = null, $manager = null, $cache = null)
{
......@@ -62,6 +65,7 @@ class Overview
$this->yourContribution = 0;
$this->totalNetworkContribution = 0;
$this->yourShare = 0;
$this->yourRewardFactor = RewardFactor::getForUserState($this->user->getUserState());
return $this;
}
......@@ -161,6 +165,14 @@ class Overview
return $this->yourShare;
}
/**
* @return float
*/
public function getYourRewardFactor()
{
return $this->yourRewardFactor;
}
/**
* Returns the last timestamp stored for a user's contribution
* @return bool|float
......
......@@ -32,7 +32,6 @@ class Repository
user_guid,
metric,
amount,
score,
score_decimal
)
VALUES (?,?,?,?,?)";
......@@ -44,7 +43,6 @@ class Repository
new Varint($contribution->getUser()->guid),
$contribution->getMetric(),
new Varint($contribution->getAmount()),
null,
new Decimal($contribution->getScore())
]
];
......