Your Name
efa4edcc15
fix: 修复提现唯一性检查问题 (PRD P0)
问题:Withdraw函数没有检查是否已有处理中的提现,可能导致并发提现
修复内容:
1. 添加新错误码 ErrWithdrawAlreadyProcessing (SUP_SET_4093)
2. 在 SettlementStore 接口添加 HasPendingOrProcessingWithdraw 方法
3. 在 Withdraw 函数中添加检查:已有pending/processing状态提现时拒绝新的提现
4. 在 Repository 中实现 HasPendingOrProcessingWithdraw(检查 pending 和 processing 状态)
5. 在所有 mock 实现中添加该方法
修改的文件:
- domain/settlement.go: 接口定义和 Withdraw 逻辑
- domain/invariants.go: 新错误码
- repository/settlement.go: HasPendingOrProcessingWithdraw 实现
- storage/store.go: InMemorySettlementStore 实现
- cmd/supply-api/main.go: DBSettlementStore 和 InMemorySettlementStoreAdapter 实现
- test mocks: 添加 HasPendingOrProcessingWithdraw
2026-04-08 20:26:50 +08:00
..
2026-04-08 10:01:41 +08:00
2026-04-08 20:26:50 +08:00
2026-04-08 10:01:41 +08:00
2026-04-07 17:46:38 +08:00
2026-04-08 20:26:50 +08:00
2026-04-08 19:00:06 +08:00
2026-04-08 07:44:58 +08:00
2026-04-08 18:20:40 +08:00
2026-04-08 20:26:50 +08:00
2026-04-08 09:00:29 +08:00
2026-04-08 20:26:50 +08:00
2026-04-08 20:26:50 +08:00