[refactor] 退款域业务代码零读 ods:全状态场景迁 std_*_all 镜像视图 #334
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标:退款域业务代码零读 ods 原始层——全状态语义场景统一迁到 std 层全量镜像视图,ods 回归「仅供数 + 被治理」单一角色。
背景:#332 完成后审计发现仍有 7 类界面/分析读点直读 ods(均已声明例外)。用户拍板:全部迁移使用新表。
方案:
std_refund_online_all/std_wallet_flow_all/std_refund_shanmao_all/std_refund_manual_all/std_refund_record_all(SELECT * FROM ods.*,ods 在 T1 已带采纳四列)std_*采纳集(不动);全状态场景改读std_*_all迁移范围(7 类读点):
_refund_recovery_core+ person_devices/device_analysis/device_detail/recovery_analysis)验收标准:
FROM (ods.)?(refunds|wallet_withdrawals|shanmao_refunds|manual_refunds|refund_record_reports)仅剩采集/采纳/治理三类本职消费关闭凭证核验 (2026-10-19)
b443c1a2d3e4;生产alembic_version=b443c1a2d3e4;五视图行数与 ods 源表逐一相等(204914/37604/2091/10652/40459)grep 'FROM refunds|wallet_withdrawals|shanmao_refunds|manual_refunds|refund_record_reports|FROM ods.'backend/app/services 仅剩 quality_disposition_service(质量治理本职)+ governance 采纳/维表作业ruff check app/ tests/All checks passed;全量 pytest 2513 用例第二轮 0 FAILED(首轮 5 个为既有串扰 flake,单跑全过、重跑收敛)deploy/upgrade.sh --git --branch main→ git-20261019003208;health=ok;A 路采纳 48,622/excluded 156,292,最新作业 2026-10-19 08:06 自动增量成功;决策概览 10-01~18 A 路 2,641 笔/¥345,907.57(与迁移前口径一致,差异仅为期间增量流水)迁移明细:analytics/refund.py 18 处、refund_chain.py 3 处、today/_staff.py 2 处、device_profile 5 处、audit_timeline 7 处、reconcile_check 24 处、matcher 8 处、reconcile.py 7 处(读;写路径一律不动仍落 ods)。quality_disposition_service 保留 ods 读(质量治理本职,铁律第三本职)。
结论:退款域业务代码零读 ods,ods 回归「采集写入/采纳作业/质量治理」三本职。