Skip to content

fix(affiliate): hide commission withdrawal until the backend supports it - #172

Open
echoowall wants to merge 1 commit into
perfect-panel:developfrom
echoowall:fix/hide-commission-withdraw
Open

fix(affiliate): hide commission withdrawal until the backend supports it#172
echoowall wants to merge 1 commit into
perfect-panel:developfrom
echoowall:fix/hide-commission-withdraw

Conversation

@echoowall

Copy link
Copy Markdown
Contributor

问题

联盟页面的「提现」按钮点下去必然失败,用户只会看到一个红色 toast。后端这条链路目前是不完整的。

请求必然报错

internal/module/billing/entity/wallet/wallet.goTableName() 返回 user_withdrawal,而建表的迁移 initialize/migrate/database/{mysql,postgres}/02121_user_withdrawal.up.sql 建的表叫 withdrawals。两个名字从引入这个功能的提交起就没对上过,所以插入必然失败:

ERROR: relation "user_withdrawal" does not exist (SQLSTATE 42P01)

好在整段跑在 InBillingTx 里,插入失败会连同佣金扣减一起回滚,不会丢数据。

即使插入成功,后面也没有路径

  • UserWithdrawalRepo 只有 InsertWithdrawal 一个方法,没有任何更新或查询
  • 提现相关路由只有两条,都在 internal/route/public_user.go,全是用户侧
  • 没有任何管理员路由,后台 SDK 里也没有对应接口,因此不存在审核界面
  • withdrawals.status 一旦写入 0 就再也无法改变
  • 用户侧的 QueryWithdrawalLog 仍是空实现(// todo: add your logic here),所以用户也查不到自己提交过什么
  • 迁移里写入的 WithdrawalMethod 配置项,前后端都无人读取

也就是说:请求成功的那条路径同样是死路,只是从「报错」变成「佣金被扣、记录永远卡在待处理」。

改动

把联盟页面的提现入口整块移除,只留佣金展示。

packages/ui 里的 commissionWithdraw SDK 函数保留不动affiliate.json 里那批 withdraw* 文案也全部保留。等后端把这条链路补完(表名对上、补管理员审核路由与界面、实现 QueryWithdrawalLog),把这次的改动 revert 回去即可,不需要重写文案和接口封装。

验证

  • biome check 通过
  • tsc --noEmit 通过

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@web-ppanel

Copy link
Copy Markdown
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 bun run check, bunx tsc --noEmit -p apps/user/tsconfig.json, and the user app test suite (16 tests); all passed. I did not merge because removing a user-facing capability requires maintainer confirmation, and merging into develop would also trigger the repository’s Build and Release workflow, while this triage run explicitly prohibits product decisions and any action that triggers a release workflow. Leaving this PR open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants