Feat/affiliate referral system#485
Open
sweetesty wants to merge 3 commits into
Open
Conversation
… and audit allowlist - Fix stats object not closed in subscriptionStore (root cause of 21 TS errors) - Fix previewPlanChange missing if-block closing brace - Restore persist() config argument - Fix broken imports from backend refactoring - Add 6 new GHSA advisories to audit-ci allowlist - Run Prettier across all files
…k, and fraud protection system
|
@sweetesty Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…at/affiliate-referral-system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #385
This PR implements a full affiliate and referral program system for subscription merchants, covering backend commission tracking, payout management, fraud detection, and a frontend affiliate dashboard.
Backend —
backend/services/Referral link generation
crypto.randomBytes— not guessable or sequentialPOST /api/affiliates/links— creates a referral link with configurable commission rate and cookie windowCommission tracking
pending|approved|clawed_back|paid)Payout management
POST /api/affiliates/payouts/request— affiliate requests payout of approved commissions above thresholdpending|processing|completed|failedCookie-based attribution
Fraud detection
under_reviewstatus pending manual approval before commission is approvedFrontend
src/store/affiliateStore.tssrc/screens/AffiliateDashboardScreen.tsxAcceptance criteria met: