Support row-level spend/merchant targets in referral rewards - #2571
Merged
Merged
Conversation
The referral target moved from $75 to $150 while rewards that qualified on $75 were still in their 30-day payout delay. Their rows read "$145.63/$150 spent" next to "Qualified", which looked like a mistake and was reported as one. The referral summary now sends each row's own bar (spendTargetUsd, merchantTarget): the one a qualified friend cleared, today's for everyone else. The row uses it for the spent line, the "to go" chip and the progress bar, and falls back to the program-level target when talking to a backend that doesn't send it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C4DDGA1KnJ6ADwWHFgUX4Q
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Summary
This change adds support for row-level spend and merchant targets in the referral rewards list, allowing each friend's progress to be measured against the bar they cleared rather than the current program-level targets.
Key Changes
spendTargetUsdandmerchantTargetfields toReferralRewardListItemtype to support per-row targets from the APIReferralFriendRowcomponent to use row-level targets when available, falling back to program-level targets for backward compatibility with older API versionsspendTargetUsd/merchantTargettoprogramSpendTargetUsd/programMerchantTargetto clarify they are program-level defaultsImplementation Details
The change addresses a UX issue where friends who qualified under an older (lower) target would show progress like "$80/$150 spent" next to a "Qualified" status, which appears incorrect. Now, qualified friends are measured against the bar they actually cleared, which may be lower than today's target. The implementation maintains backward compatibility by using program-level targets when the API doesn't provide row-level targets.
https://claude.ai/code/session_01C4DDGA1KnJ6ADwWHFgUX4Q
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.