Files
junhong_cmp_fiber/.scratch/ur38-agent-main-wallet-credit/issues/08-unified-agent-wallet-refund.md
2026-07-22 17:25:12 +09:00

24 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 08 — 统一代理订单退款回充
**What to build:** 代理钱包订单退款能够沿原扣款流水准确回充原主钱包,并通过统一 Wallet Application 幂等维护余额、版本、退款事实、真实金额流水和可靠事件。原付款使用信用不影响退款定位和金额口径。
**Blocked by:**
- `.scratch/ur38-agent-main-wallet-credit/issues/05-unified-agent-wallet-debit.md` — 05 — 统一代理订单、代购与钱包支付扣款
- `.scratch/ur38-agent-main-wallet-credit/issues/07-unified-agent-wallet-credit-posting.md` — 07 — 统一代理主钱包充值入账与人工调整
- `.scratch/tech-public-foundation/issues/02-transactional-public-outbox-write.md` — 02 — 在业务事务中可靠写入公共 Outbox
- `.scratch/tech-global-audit/issues/01-audit-event-write-loop.md` — 01 — 交付不可变 Audit Event 写入闭环
**Status:** ready-for-agent
**架构通道:** 复杂写Application UseCase → Wallet Domain → Repository/InfrastructureRefund Application 为辅助编排通道。
**完整业务边界:** 本票收口代理订单退款回充主钱包的完整资金用例及历史扣款流水兼容定位。明确不迁移资产钱包退款、佣金回扣、套餐失效和企微审批等非代理主钱包边界。
- [ ] 新订单退款以原扣款流水定位实际付款主钱包和代购关联店铺,历史缺失流水订单按已确定的兼容规则定位且不会退款到错误钱包。
- [ ] 退款状态条件、钱包回充、版本递增、唯一真实退款流水、Audit Event 和 Outbox 在同一事务提交。
- [ ] 退款增加账面余额并自然减少或清偿欠款,不修改冻结金额或信用额度;金额运算溢出时整个事务拒绝。
- [ ] 同一退款与原扣款业务引用形成稳定防重边界重复审批、Worker 重试和并发请求不会重复回充或重复写流水。
- [ ] 代理退款调用点不再直接增加钱包余额,资产钱包退款及其他退款后处理保持原有边界。
- [ ] 测试覆盖现金扣款退款、信用扣款退款、代购退款、历史流水兼容、重复退款、并发退款及任一事务写入失败回滚。