fix(affiliate): hide commission withdrawal until the backend supports it - #172
Open
echoowall wants to merge 1 commit into
Open
fix(affiliate): hide commission withdrawal until the backend supports it#172echoowall wants to merge 1 commit into
echoowall wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Triaged: the diff is focused and the reported failure mode is addressed by removing the unavailable withdrawal path. I reviewed it before execution, then ran |
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.
问题
联盟页面的「提现」按钮点下去必然失败,用户只会看到一个红色 toast。后端这条链路目前是不完整的。
请求必然报错
internal/module/billing/entity/wallet/wallet.go的TableName()返回user_withdrawal,而建表的迁移initialize/migrate/database/{mysql,postgres}/02121_user_withdrawal.up.sql建的表叫withdrawals。两个名字从引入这个功能的提交起就没对上过,所以插入必然失败:好在整段跑在
InBillingTx里,插入失败会连同佣金扣减一起回滚,不会丢数据。即使插入成功,后面也没有路径
UserWithdrawalRepo只有InsertWithdrawal一个方法,没有任何更新或查询internal/route/public_user.go,全是用户侧withdrawals.status一旦写入 0 就再也无法改变QueryWithdrawalLog仍是空实现(// todo: add your logic here),所以用户也查不到自己提交过什么WithdrawalMethod配置项,前后端都无人读取也就是说:请求成功的那条路径同样是死路,只是从「报错」变成「佣金被扣、记录永远卡在待处理」。
改动
把联盟页面的提现入口整块移除,只留佣金展示。
packages/ui里的commissionWithdrawSDK 函数保留不动,affiliate.json里那批withdraw*文案也全部保留。等后端把这条链路补完(表名对上、补管理员审核路由与界面、实现QueryWithdrawalLog),把这次的改动 revert 回去即可,不需要重写文案和接口封装。验证
biome check通过tsc --noEmit通过