Files
qipai/docs/devlogs/2026-06-24-M07-A-双余额账本.md
T

29 lines
1.2 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.
# M07-A 双余额账本
- 日期:2026-06-24
- 起始 commit`8de3d05`
- 工程 commit`63711ad`
- ENGINEERING_DELTA=YES
- 子阶段状态:DONE
## 工程增量
- 新增 `qipai_wallet_scope_policies`,支持租户/门店余额共享范围配置。
- 新增 `qipai_wallet_accounts`,现金余额和赠送余额分账户保存。
- 新增 `qipai_wallet_ledger_entries`,所有充值、赠送、消费、退款和人工调整以不可变流水记录。
- 新增 `WalletLedgerService`,支持入账、赠送优先扣款、人工调整、余额不足拒绝和业务号幂等。
- 迁移计划、迁移契约和全量测试链路已接入 M07-A。
## 验证
- Windows `npm run build`:退出码 0。
- Windows `node tests/wallet-ledger.test.mjs`:退出码 0。
- Windows `node tests/migration-contract.test.mjs`:退出码 0。
- Windows `node tests/migration-runner.test.mjs`:退出码 0。
- Windows `npm test`:退出码 0,M01-A 至 M07-A 全量后端回归通过。
- 工程 commit 已 push`HEAD == origin/main == 63711ad`
## 后续
游标进入 M07-B 充值优惠:实现充值规则、有效期、适用门店、限购、启停,以及支付成功后才记账。