feat(report): 上报更低价后端——price_report 表 + 提交/列表接口 #13

Merged
marco merged 4 commits from feat/recompare-deeplink into main 2026-06-06 00:42:40 +08:00

4 Commits

Author SHA1 Message Date
xianze f983b0d369 feat(compare): 比价记录列表改按创建时间倒序(id 兜底)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 19:18:57 +08:00
xianze 7aeed94196 feat(compare): 比价记录列表按店名匹配真实下单标记已下单
list_records 查出本页后,按 store_name 命中该用户 source='compare' 的
savings_record.shop_name 集合算出 ordered(店级、瞬态属性,不加列不迁移);
ComparisonRecordOut 加 ordered 字段(from_attributes 读出,缺省 false)。
下单上报不带 trace_id,只能按店名对齐(两边店名同源:比价意图识别的门店名)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 16:59:51 +08:00
xianze 0662f2ce47 feat(compare): comparison_record 加 best_deeplink 列 + 迁移(再次比价直达商家深链备用)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:27:49 +08:00
xianze fcfac7ad07 feat(report): 上报更低价后端——price_report 表 + 提交/列表接口
- 新表 price_report:关联比价记录,存原最低价快照(反查 best_*)/上报平台+价/截图URL/审核状态(pending/approved/rejected)/奖励字段
- POST /api/v1/report (multipart):反查比价记录填原最低价,校验上报价 < 原最低价(D),截图复用 core.media 落 /media/price_report/,提交一律 pending
- GET /api/v1/report/records?status= :按状态筛选 + 四态 counts,供「上报记录」页
- core.media 加 save_report_image;main 挂 report 路由;models 登记 PriceReport
- alembic 迁移仅建 price_report(autogenerate 误检的「删 order_record」已手动剔除——那是降级为审计的历史表)

奖励发放(通过→钱包+1000金币)是人工审核后台动作,本期不含。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 10:22:21 +08:00