joy-cli/scripts/manhuang/record-shop-outcome.sh
feibisi 4bd5c2abab feat(manhuang): demand CD 钉、货架通知滤噪、成交回填入口
- ensure-cd-watches:默认并入 DEMAND_WATCHES(Plati/GGSel/FunPay 需求页)
- notify-chain:忽略 noise 价差;推送 sold_out/restock 等货架高信号
- record-shop-outcome.sh + 总览三利害卡;post-pay 可接 MANHUANG_SHOP_ID
2026-07-13 15:30:53 +08:00

37 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# 成交回填商家信任(系统外成交后)。包装 ensure-shops.py --record-outcome。
# 用法:
# bash scripts/manhuang/record-shop-outcome.sh <shop_id> --ok
# bash scripts/manhuang/record-shop-outcome.sh <shop_id> --fail [--note "..."]
# bash scripts/manhuang/record-shop-outcome.sh <shop_id> --dispute
# MANHUANG_SHOP_ID=fp-xxx bash scripts/manhuang/record-shop-outcome.sh --ok
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
PY="$ROOT/scripts/manhuang/ensure-shops.py"
BUILD="$ROOT/scripts/manhuang/build-tab-caches.py"
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
sed -n '1,9p' "$0"
exit 0
fi
SHOP=""
REST=()
if [[ $# -gt 0 && "${1:0:2}" != "--" ]]; then
SHOP="$1"
shift
fi
REST=("$@")
SHOP="${SHOP:-${MANHUANG_SHOP_ID:-}}"
if [[ -z "$SHOP" ]]; then
echo "need shop_id or MANHUANG_SHOP_ID" >&2
exit 2
fi
if [[ ${#REST[@]} -eq 0 ]]; then
echo "need --ok and/or --fail and/or --dispute" >&2
exit 2
fi
python3 "$PY" --record-outcome "$SHOP" "${REST[@]}"
python3 "$BUILD" || true
echo "done shop=$SHOP"