Commit 42166e72 authored by Olivia Madrid's avatar Olivia Madrid
Browse files

(feat): Referrals console

parent e41f7044
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@
,Token,How is my daily token reward determined?,"At the end of each day, your Contribution Percentage will be applied to the Daily Reward Pool to determine how many Minds tokens you earned. For example, if your Contribution Percentage is 1% and the Daily Reward Pool is 10,000 Minds tokens, then you would earn 100 Minds tokens (1% * 10,000) for your contributions to the network that day."
,Token,How is my daily token reward determined?,"At the end of each day, your Contribution Percentage will be applied to the Daily Reward Pool to determine how many Minds tokens you earned. For example, if your Contribution Percentage is 1% and the Daily Reward Pool is 10,000 Minds tokens, then you would earn 100 Minds tokens (1% * 10,000) for your contributions to the network that day."
,Token,How is the daily reward pool calculated?,Minds takes the sum of each individual user's contribution score which creates the Total Network Score. The Total Network Score is then multiplied by this number to determine the number of tokens rewarded that day.
,Token,How is the daily reward pool calculated?,Minds takes the sum of each individual user's contribution score which creates the Total Network Score. The Total Network Score is then multiplied by this number to determine the number of tokens rewarded that day.
,Token,How will I receive my daily rewards?,"Daily rewards will be paid out in OffChain tokens. OffChain tokens represent a 1 to 1 reservation of an OnChain Minds token, and after you verify, you can withdraw them at anytime into your OnChain address."
,Token,How will I receive my daily rewards?,"Daily rewards will be paid out in OffChain tokens. OffChain tokens represent a 1 to 1 reservation of an OnChain Minds token, and after you verify, you can withdraw them at anytime into your OnChain address."
,Token,How do I earn tokens for referrals?,"Share your personalized referral links with friends. If a friend signs up for Minds within 24 hours of clicking your link, they will be added to your pending referrals.  Once they sign up for the rewards program by setting up their Minds wallet, the referral is complete and you’ll both get token rewards."
,,,
,,,
,Security,How do I block a user?,"You may block a user by going to the settings on their channel --- the gear wheel by the word ""Subscribe/Message"" -- and selecting ""Block"". You may alternately block a user by going to any of that user's posts, clicking the caret, the""down arrow"", on the upper righthand corner to get a pulldown menu, then selecting ""Block"". "
,Security,How do I block a user?,"You may block a user by going to the settings on their channel --- the gear wheel by the word ""Subscribe/Message"" -- and selecting ""Block"". You may alternately block a user by going to any of that user's posts, clicking the caret, the""down arrow"", on the upper righthand corner to get a pulldown menu, then selecting ""Block"". "
,Security,How do I report a security issue?,"If you believe you have identified a security vulnerability, please contact us immediately at security@minds.com. "
,Security,How do I report a security issue?,"If you believe you have identified a security vulnerability, please contact us immediately at security@minds.com. "
+4 −0
Original line number Original line Diff line number Diff line
@@ -58,6 +58,10 @@ class NotificationDelegate
        $entityGuid = $referral->getReferrerGuid();
        $entityGuid = $referral->getReferrerGuid();
        $entity = $this->entitiesBuilder->single($entityGuid);
        $entity = $this->entitiesBuilder->single($entityGuid);


        if ($referral->getJoinTimestamp()) {
            return;
        }

        $this->dispatcher->trigger('notification', 'all', [
        $this->dispatcher->trigger('notification', 'all', [
            'to' => [$referral->getProspectGuid()],
            'to' => [$referral->getProspectGuid()],
            'entity' => $entity,
            'entity' => $entity,
+4 −0
Original line number Original line Diff line number Diff line
@@ -4,7 +4,11 @@
 */
 */
namespace Minds\Core\Referrals;
namespace Minds\Core\Referrals;


use Minds\Core\Referrals\Referral;
use Minds\Core\Referrals\Repository;
use Minds\Core\Referrals\Repository;
use Minds\Core\Referrals\Delegates\NotificationDelegate;
use Minds\Core\EntitiesBuilder;
use Minds\Common\Repository\Response;
use Minds\Core\Di\Di;
use Minds\Core\Di\Di;


class Manager
class Manager
+11 −9
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ class Referral
     */
     */
    public function getState()
    public function getState()
    {
    {
        // the referral goes from pending to complete when the prospect joins rewards
        // Referral goes from pending to complete when the prospect joins rewards
        if ($this->joinTimestamp) {
        if ($this->joinTimestamp) {
            return 'complete';
            return 'complete';
        }
        }
@@ -64,16 +64,21 @@ class Referral
     */
     */
    public function getPingable()
    public function getPingable()
    {
    {
        // Duration referrer must wait before re-pinging (in seconds)
        $waitTime= 60*60*24*7; // 7 days


        // Duration referrer must wait before re-pinging
        $now = time();
        $waitTime= 1000*60*60*24*7; // 7 days

        $now = time() * 1000;
        $elapsedTime = $now - $this->pingTimestamp;
        $elapsedTime = $now - $this->pingTimestamp;


        if ($this->pingTimestamp && $elapsedTime < $waitTime) {
        if ($this->pingTimestamp && $elapsedTime < $waitTime) {
            return false;
            return false;
        }
        }

        // Also disable ping if they've already joined rewards
        if ($this->joinTimestamp) {
            return false;
        }

        return true;
        return true;
    }
    }


@@ -87,9 +92,6 @@ class Referral
            'referrer_guid' => $this->referrerGuid,
            'referrer_guid' => $this->referrerGuid,
            'prospect' => $this->prospect ? $this->prospect->export() : null,
            'prospect' => $this->prospect ? $this->prospect->export() : null,
            'state' => $this->getState(),
            'state' => $this->getState(),
            'register_timestamp' => $this->registerTimestamp,
            'join_timestamp' => $this->joinTimestamp,
            'ping_timestamp' => $this->pingTimestamp,
            'pingable' => $this->getPingable(),
            'pingable' => $this->getPingable(),
        ];
        ];
    }
    }
+13 −13
Original line number Original line Diff line number Diff line
@@ -64,9 +64,9 @@ class Repository


                $referral->setProspectGuid((string) $row['prospect_guid'])
                $referral->setProspectGuid((string) $row['prospect_guid'])
                    ->setReferrerGuid((string) $row['referrer_guid'])
                    ->setReferrerGuid((string) $row['referrer_guid'])
                    ->setRegisterTimestamp((string) $row['register_timestamp'])
                    ->setRegisterTimestamp(isset($row['register_timestamp']) ? (int) $row['register_timestamp']->time() : null)
                    ->setJoinTimestamp((string) $row['join_timestamp'])
                    ->setJoinTimestamp(isset($row['join_timestamp']) ? (int) $row['join_timestamp']->time() : null)
                    ->setPingTimestamp((string) $row['ping_timestamp']);
                    ->setPingTimestamp(isset($row['ping_timestamp']) ? (int) $row['ping_timestamp']->time() : null);


                $response[] = $referral;
                $response[] = $referral;
            }
            }
@@ -75,7 +75,7 @@ class Repository
            $response->setLastPage($rows->isLastPage());
            $response->setLastPage($rows->isLastPage());


        } catch (\Exception $e) {
        } catch (\Exception $e) {
            $response = $e;
            // $response = $e;
            return $response;
            return $response;
        }
        }


Loading