Neo d418621951 feat(backend): F1-6 sprint2 #1 60d 消费迁移到 sandbox_replay
迁移 fdw_queries.get_consumption_60d 到 sandbox_replay.consumption_replay,
沿用 sprint 1 模式: @trace_service + @runtime_aware decorator + 显式
stat_date <= ctx.business_date 上界(与视图过滤双保险),fdw_queries 改
thin wrapper 保持 customer_service 2 处调用兼容。

双口径走查 PASS(member=2799207087163141 黄先生):
- 4a live(today=2026-05-05): 小程序 stat 卡条 60天消费 ¥115(consume_amount_60d=115.36)
- 4b sandbox=2026-04-20: 小程序 stat 卡条 60天消费 ¥89(walkthrough 测试快照 88.88)

unit test sprint1+sprint2 累计 15/15 PASS,无回归。

详见 docs/audit/changes/2026-05-06__f1_6_sprint2_consumption_60d.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 00:27:13 +08:00
2026-04-10 06:24:13 +08:00

NeoZQYY Monorepo

台球门店运营助手一体化平台,整合 ETL 数据 Connector、微信小程序后端、小程序前端与管理后台。

项目结构

目录 说明 文档
apps/etl/connectors/feiqiu/ 飞球 ConnectorAPI → ODS → DWD → DWS docs/
apps/backend/ FastAPI 后端13 个路由 · JWT 双认证 · WebSocket README · API 参考
apps/miniprogram/ 微信小程序Donut + TDesign + TypeScript README
apps/admin-web/ 管理后台React + Vite + Ant Design README
apps/mcp-server/ MCP ServerAI 工具集成PostgreSQL 只读查询) README
packages/shared/ 共享包(枚举、金额精度、时间工具) README
db/etl_feiqiu/ ETL 数据库6 层 Schemameta/ods/dwd/core/dws/app README
db/zqyy_app/ 业务数据库auth 认证 + 任务队列 + 调度) README
docs/ 项目文档中心(架构、数据库、部署、审计) README
scripts/ 运维/工具脚本
tests/ Monorepo 级属性测试

快速开始

# 安装全部依赖(需要 uv
uv sync

# 运行 ETL
cd apps/etl/connectors/feiqiu
python -m cli.main --pg-dsn "$PG_DSN" --store-id "$STORE_ID" --api-token "$API_TOKEN"

# 启动后端 API
cd apps/backend
uvicorn app.main:app --reload

# 运行 ETL 单元测试
cd apps/etl/connectors/feiqiu
pytest tests/unit

配置

配置采用分层叠加:根 .env -> 应用 .env.local -> 环境变量 -> CLI 参数。

参见 .env.template 了解可用配置项。

技术栈

  • Python 3.10+, uv workspace4 个成员etl、backend、mcp-server、shared
  • PostgreSQL 四库:etl_feiqiu / test_etl_feiqiuETLzqyy_app / test_zqyy_app(业务)
  • FastAPI + Uvicorn后端 API
  • React 19 + Vite 6 + Ant Design 5管理后台独立 pnpm
  • 微信小程序原生 + Donut + TDesign + TypeScriptC 端)
  • JWT 双认证(管理后台用户名密码 + 小程序微信登录)
  • 多门店隔离(site_id + RLS
Description
桌球运营小程序 Monorepo 统一仓库
Readme 64 MiB
Languages
Python 79.6%
TypeScript 17.4%
PLpgSQL 1.9%
HTML 0.7%
PowerShell 0.4%