feat(coupon): add /api/v1/coupon/step proxy to pricebot #1

Merged
marco merged 6 commits from feature/coupon-claim-integration into main 2026-05-27 16:51:48 +08:00
Owner
  • new POST /api/v1/coupon/step, JWT-authenticated, async httpx forwards body to pricebot
  • new PRICEBOT_BASE_URL / PRICEBOT_REQUEST_TIMEOUT_SEC settings (default localhost:8000)
  • error handling: pricebot unreachable / 5xx -> 502 with friendly message
  • tests: auth, passthrough, 5xx, unreachable, invalid json (5 cases, all pass)

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

- new POST /api/v1/coupon/step, JWT-authenticated, async httpx forwards body to pricebot - new PRICEBOT_BASE_URL / PRICEBOT_REQUEST_TIMEOUT_SEC settings (default localhost:8000) - error handling: pricebot unreachable / 5xx -> 502 with friendly message - tests: auth, passthrough, 5xx, unreachable, invalid json (5 cases, all pass) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
marco added 1 commit 2026-05-27 11:08:41 +08:00
- new POST /api/v1/coupon/step, JWT-authenticated, async httpx forwards body to pricebot
- new PRICEBOT_BASE_URL / PRICEBOT_REQUEST_TIMEOUT_SEC settings (default localhost:8000)
- error handling: pricebot unreachable / 5xx -> 502 with friendly message
- tests: auth, passthrough, 5xx, unreachable, invalid json (5 cases, all pass)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
marco added 5 commits 2026-05-27 16:38:12 +08:00
把 main 的"美团 CPS 模块 + 后端分层重构(integrations/repositories)"合入领券分支。
解决 3 处冲突(均为两边各自新增, 保留双方):
- app/main.py: 同时注册 coupon_router 与 meituan_router
- app/core/config.py: 同时保留 PRICEBOT_* 与 MT_CPS_* 配置
- .env.example: 同上
coupon.py 本身无冲突(仅依赖 deps.CurrentUser 与 core.config, 重构未触及)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 单文件 docs/API.md 拆成 docs/api/: README.md(传送门索引: 11 接口总览表 +
  通用约定 + 复用结构) + 11 个一接口一文件, 便于接口增多后维护
- 补全此前 API.md 与技术文档均遗漏的核心接口 coupon-step.md
  (一键领券透传 pricebot-backend, 唯一需 JWT 鉴权的业务接口)
- 更新 后端技术实现.md: 业务补"领券透传"块、目录补 coupon.py、新增 coupon/step 节、
  配置补 PRICEBOT_*、接口索引改指向 docs/api/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- docs/README.md: 说明文档库结构(后端技术实现.md + api/), 重点讲 api/ 的
  "索引 + 一接口一文件"传送门组织方式, 及新增接口时的维护约定

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- /api/v1/coupon/step 去掉 CurrentUser 鉴权:MVP 领券不鉴权,device_id 透传给
  pricebot 区分设备;user_id 绑定 + 用户级画像见账本 P1,待补
- docs/待办与技术债.md 补「阶段1领券落地遗留」:FloatingButton 死代码、ComparingScreen
  弃用、ApiClient unused 常量、权限引导最简版等待清理项

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
marco merged commit 236907dcd2 into main 2026-05-27 16:51:48 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WonderableAI/shaguabijia-app-server#1