Files
qipai/docs/devlogs/2026-06-24-M07-C-优惠券和套餐.md
T

29 lines
1.3 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-C 优惠券和套餐
- 日期:2026-06-24
- 起始 commit`ba99beb`
- 工程 commit`4ae9296`
- ENGINEERING_DELTA=YES
- 子阶段状态:DONE
## 工程增量
- 新增优惠券模板和持券表,支持满减券、时长券、适用门店/房型/房间/星期/节假日、有效期和使用次数。
- 新增套餐计划和用户套餐持有表,支持购买后持有、剩余时长/金额、冻结、核销、退回和过期状态建模。
- 新增 `qipai_benefit_usages`,用订单、权益和 clientRequestId 双幂等约束记录权益冻结/确认/退回。
- 新增 `MarketingBenefitService`,为订单提交提供权益冻结、确认核销和失败退回的可靠补偿流程。
- 迁移计划、迁移契约、迁移 runner 和全量测试链路已接入 M07-C。
## 验证
- Windows `npm run build`:退出码 0。
- Windows `node tests/marketing-benefit-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-C 全量后端回归通过。
- 工程 commit 已 push`HEAD == origin/main == 4ae9296`
## 后续
游标进入 M07-D 会员管理:聚合会员画像、注册/最近下单、订单数、消费额、余额、券、套餐和状态。