~singpolyma/jmp-pay

1d3ddd6171e0bad6b485380bc1c4318af3e46c21 — Stephen Paul Weber a month ago 24927de
Baed invite rewards on settlement date

Not just raw creation date. This way eg BTC transactions reward sooner.
1 files changed, 1 insertions(+), 1 deletions(-)

M bin/process_invite_rewards
M bin/process_invite_rewards => bin/process_invite_rewards +1 -1
@@ 36,7 36,7 @@ QUERY = <<~SQL
	WHERE rewarded_at IS NULL AND used_by_id IS NOT NULL AND amount > 0
	GROUP BY used_by_id, code, creator_id, plan_name
	HAVING
		MIN(transactions.created_at) < LOCALTIMESTAMP - '90 days'::interval
		MIN(transactions.settled_after) < LOCALTIMESTAMP - '2 days'::interval
		AND
		SUM(transactions.amount) >= 15
SQL