Files
qipai/docs/devlogs/2026-06-24-M07-B-充值优惠.md

29 lines
1.2 KiB
Markdown
Raw Permalink 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-B 充值优惠
- 日期:2026-06-24
- 起始 commit`db1d08e`
- 工程 commit`d9743d3`
- ENGINEERING_DELTA=YES
- 子阶段状态:DONE
## 工程增量
- 新增 `qipai_recharge_plans`,支持充值规则、有效期、适用门店、限购和启停状态。
- 新增 `qipai_recharge_orders`,记录充值单号、客户端请求号、支付记录、支付时间和入账时间。
- 新增 `RechargeService`,创建充值订单时校验规则有效性、门店范围和用户限购。
- 支付成功回调后才调用 `WalletLedgerService.credit` 入账,重复创建请求和重复支付回调均保持幂等。
- 迁移计划、迁移契约、迁移 runner 和全量测试链路已接入 M07-B。
## 验证
- Windows `npm run build`:退出码 0。
- Windows `node tests/recharge-service.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-B 全量后端回归通过。
- 工程 commit 已 push`HEAD == origin/main == d9743d3`
## 后续
游标进入 M07-C 优惠券和套餐:实现权益定义、发放、核销、服务端事务扣减,以及与订单/余额流水的联动。