Files
Neo-ZQYY/.kiro/steering/feiqiu-data-rules.md

25 lines
1.4 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.
---
inclusion: always
---
# 飞球数据规范(入口索引)
涉及财务、结算、助教、会员、统计、指数、工资、任务调度、DWD/DWS 层开发时必须参考以下两份权威文档fileMatch 自动加载,也可手动引用):
- `dwd-doc-authority.md` — DWD 层 11 条强制规则consume_money 口径、支付恒等式、会员字段断档等)
- `dws-doc-authority.md` — DWS 层 26 条强制规则(幂等策略、课程定价、绩效档位、指数算法、配置表体系等)
- `docs/database/BD_Manual_fdw_reverse_retention_clue.md` — FDW 反向映射手册ETL 库通过 postgres_fdw 只读访问业务库 `member_retention_clue` 维客线索表)
## 最高频硬规则速查(完整规则见上述文档)
1. `consume_money` 禁止直接用于计算 → 用 `items_sum` 拆分字段
2. 助教费用必须拆分:`assistant_pd_money`(陪打)+ `assistant_cx_money`(超休)
3. 支付恒等式:`balance_amount = recharge_card_amount + gift_card_amount`
4. 会员信息一律通过 `member_id` JOIN 维度表(`scd2_is_current=1`),结算单冗余字段不可靠
5. 散客:`member_id ≤ 0`
6. 课程类型/定价/绩效档位/奖金/指数权重 → 全部从配置表读取,禁止硬编码
7. DWS 汇总表默认 delete-before-insert库存表用 upsert
## 参考优先级
DWD-DOC > DWS 权威规范 > BD 手册 > ETL 任务文档 > 业务规则文档 > DDL 注释