feat(wallet): 解绑微信前对待审核提现二次确认 #46

Merged
marco merged 3 commits from feat/unbind-wechat-reviewing-confirm into main 2026-06-13 03:53:43 +08:00

改动

解绑微信前若有**待审核(reviewing)**提现单,首次解绑被拦下返回二次确认,用户确认后带 force=true 才真解绑。

  • schemas: UnbindWechatRequest{force} + UnbindWechatResultOut{needs_confirm, message}
  • repositories: has_reviewing_withdraw(只看 reviewing)
  • api: unbind-wechat 接受可选 body(兼容旧无 body 客户端);bound 返回真实绑定态
  • docs/api: 同步协议

为什么只拦 reviewing

reviewing 单解绑后审核打款会回读空 openid → 自动退回现金(钱不丢、只为让用户知情);pending 转账已在途、解绑影响不到,不拦。

配套客户端见 shaguabijia-app-android 同名分支。

🤖 Generated with Claude Code

## 改动 解绑微信前若有**待审核(reviewing)**提现单,首次解绑被拦下返回二次确认,用户确认后带 `force=true` 才真解绑。 - `schemas`: `UnbindWechatRequest{force}` + `UnbindWechatResultOut{needs_confirm, message}` - `repositories`: `has_reviewing_withdraw`(只看 reviewing) - `api`: `unbind-wechat` 接受可选 body(兼容旧无 body 客户端);`bound` 返回真实绑定态 - `docs/api`: 同步协议 ## 为什么只拦 reviewing reviewing 单解绑后审核打款会回读空 openid → 自动退回现金(钱不丢、只为让用户知情);pending 转账已在途、解绑影响不到,不拦。 配套客户端见 shaguabijia-app-android 同名分支。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Ghost added 1 commit 2026-06-12 11:46:27 +08:00
有待审核(reviewing)提现时,首次解绑拦下返回 needs_confirm + 提示文案,用户确认后带
force=true 再调才真解绑。reviewing 单解绑后审核回读空 openid → 自动退回现金(钱不丢、
只为知情);pending 已在途、解绑影响不到,不拦。unbind-wechat 接受可选 body 兼容旧
客户端,bound 返回真实绑定态。同步 docs/api。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ghost added 1 commit 2026-06-12 14:30:10 +08:00
原实现只清 openid,reviewing 单的退款推迟到管理员审核打款(execute_withdraw_transfer
回读空 openid)才触发——用户解绑后后台仍挂单、现金不即时退回。改为 force 解绑时直接对
所有 reviewing 单走 _refund_withdraw 立即退回现金 + 置终态(新增 refund_reviewing_
withdraws_on_unbind),让提示文案名副其实、后台不再挂死单。_refund_withdraw 加可选
remark 自定义流水文案。同步 docs/api。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ghost added 1 commit 2026-06-12 23:40:33 +08:00
代码 review(本分支未提交 WIP)发现并修复:
- 高: enable_notification 可重复领取的发放是无锁读-算-写,并发/连点会算出同一序号
  双倍发钱。给 coin_transaction 加 (user_id,biz_type,ref_id) 部分唯一索引(仅 task_*),
  claim 撞唯一约束→IntegrityError 回滚兜底成 AlreadyClaimedError(409),不双发。
  配套 alembic 迁移 coin_txn_task_ref_uq(挂 head=drop_force_onboarding)。
- 中: 加领取封顶 rewards.notification_max_claims(减半到底=1 后不再可领),挡通知一直关着
  时无限刷 1 金币;列表领满后 claimed 置 True 供客户端隐藏。
- 中: _notification_grant_times 改只数 amount>0 流水,避免日后冲正/负向流水把次数算大。
- 低: 合并 ops_marquee._nickname 两个一字不差的重复分支。
- 文档: tasks-list / tasks-claim 补可重复领取/逐次减半/409 语义。
- 测试: 新增「领满到底→409 + claimed=True」用例;test_welfare 全绿(3 个 proxy 失败
  为 pre-existing httpx mock 问题,与本次无关)。

注: review 标的「do_signin 未归一化老 cycle_day」经验算为非 bug(x%LEN+1 对越界值
本就周期正确,且与 get_status 预览公式恒等),未改。

含本分支签到7天改制/任务文案/膨胀金币等 WIP。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
marco merged commit 8d7b91219a into main 2026-06-13 03:53:43 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WonderableAI/shaguabijia-app-server#46