feat(swap-service): affiliate stats/swaps reads are partnerCode-only#45
Conversation
Contract step after #44: now that public-api queries by partnerCode, drop the legacy address path from /v1/affiliate/{stats,swaps}. - DTOs require partnerCode, drop the optional address field - controller routes straight to the partnerCode methods (no address branch) - remove the now-dead getAffiliate{Stats,Swaps}ByAddress service methods and their tests partnerAddress remains on swaps (payout snapshot) and the write-path reverse-lookup is untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Each method now has a single variant (the by-address ones are gone), so the suffix is noise: - getAffiliateStatsByPartnerCode -> getAffiliateStats - getAffiliateSwapsByPartnerCode -> getAffiliateSwaps - calculateAffiliateFeesByPartnerCode -> calculateAffiliateFees Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Description
Contract step after #44. Now that public-api queries
/v1/affiliate/{stats,swaps}bypartnerCode(shapeshift/web#12473), drop the legacyaddresspath from those reads —partnerCodeis the sole, canonical attribution key.AffiliateStatsQueryDto,AffiliateSwapsQueryDto):partnerCodeis now required; the optionaladdressfield is removed./swapsand/statsroute straight to the partnerCode methods (noaddressbranch, no "one of" 400).getAffiliateStatsByAddress/getAffiliateSwapsByAddressand their tests.partnerAddressis untouched on the write side — it remains the per-swap payout snapshot and feeds theresolvePartnerreverse-lookup forX-Partner-Addresscallers. This PR only removes the address-based read path.Deploy ordering
Ship after web#12473 (which makes public-api send
partnerCodeon reads). Until then, the only caller is public-api; once it's onpartnerCode, theaddressread path here is dead. swap-service is API-key gated, so there are no other callers.Testing
yarn jest(swap-service): 56/56 pass (removed the 2 obsolete by-address read tests).eslintclean on changed files.