fix(#1895): points API 字段对齐(P0 修复 + P1 补全) #1951

Merged
auto-approve-bot merged 2 commits from fix/1895-points-api-align into develop 2026-09-16 09:17:34 +08:00

2 Commits

Author SHA1 Message Date
CI Bot 7ab8d4b8e8 style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 5s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 47s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 47s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m7s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m5s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m31s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 3m42s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m40s
AI Code Review / AI Code Review (pull_request) Successful in 6m33s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 7m51s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 11m50s
CI/CD Pipeline / CI Gate (pull_request) Successful in 5s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 8m23s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 52s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 1m5s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 6h6m56s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 6h18m35s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 6h18m44s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 6h6m0s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 6h17m56s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 6h17m57s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 6h17m47s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 6h17m50s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 6h17m52s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 6h17m54s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 6h17m54s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 6h17m55s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 6h18m2s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 6h6m4s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 6h5m59s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 6h6m4s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 6h17m43s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 6h17m44s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 6h17m57s
2026-09-16 01:04:43 +00:00
xiaoxia-agent 1b8209bd06 fix(#1895): points API field alignment for frontend
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 27s
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 43s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m29s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m55s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m4s
AI Code Review / AI Code Review (pull_request) Successful in 6m41s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Failing after 10m58s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m51s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m58s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 11m5s
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
P0 fixes:
- POST /points/check: unknown scene_key returns 400 (UNKNOWN_SCENE) instead of 500
- POST /points/recharge: response now includes points_amount, pay_params (empty dict
  until payment integration), expire_at (48h from creation)

P1 additions:
- PointRuleItem.description: Chinese description for each scene for frontend display
- GET /points/rules: returns description field
- GET /subscription/plans (new): returns all membership tiers with price/duration/discount/features
- FREE_USER_MULTIPLIER confirmed: applied to both display AND actual deduction
  (calculate_points_cost is the single source of truth; ai_title non-member = ceil(1*1.15)=2)

Decisions:
- PointsBalanceResponse.is_member/member_type/member_expires_at: kept but marked
  deprecated (frontend already calls /points/subscription/membership); removal in future
- Refund transactions: type='add' with source prefix 'refund:{scene}' (no separate refund type)
- pay_params currently {} — to be filled when WeChat/Alipay is integrated

Tests: 10 new tests in test_points_routes.py covering all above behaviors.
Full suite: 15523 passed.
2026-09-16 08:45:15 +08:00