feat: 实现采购任务安全演练 (#71)

This commit is contained in:
chengma
2026-08-09 23:39:37 +08:00
parent dbc08dc0ec
commit 311d55f0da
7 changed files with 1162 additions and 7 deletions
+18 -4
View File
@@ -544,18 +544,27 @@ CREATE TABLE app_settings (
"purchase": {
"mode": "dry_run",
"requested": {
"color": "黑色",
"size": "L",
"options": {
"color": "黑色",
"size": "L",
"bundle": "标准版"
},
"quantity": 2,
"max_price_cent": 4200
},
"confirmed": {
"color": "黑色",
"size": "L",
"options": {
"color": "黑色",
"size": "L",
"bundle": "标准版"
},
"quantity": 2,
"unit_price_cent": 3990,
"total_price_cent": 7980
},
"confirmation_reached": true,
"order_submitted": false,
"payment_attempted": false,
"order_no": null,
"ordered_at": null,
"ordered_at_raw": null,
@@ -564,6 +573,11 @@ CREATE TABLE app_settings (
}
```
`requested.options` 和 `confirmed.options` 都是动态对象,键名来自 Admin 和 PDD
页面,不允许写死成颜色、尺码,也不做相似匹配。`dry_run` 必须同时满足
`order_submitted=false`、`payment_attempted=false` 和
`match_status=not_submitted`;只表示已经安全到达最终提交前确认页。
真实下单后 `mode` 为 `live`,`match_status` 只能是 `matched`、`ambiguous` 或 `not_found`。只有 `matched` 可以自动报告采购成功。
## 9. JSON 兼容规则