From b5a80f69cb2e2793e5134e23a0eb3e72cdbdbe0b Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 22 Sep 2026 03:48:12 +0800 Subject: Add multi-source bond quote probe fields and daily fallback (3d-20) --- qa/stub/fund-lab-python | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'qa/stub/fund-lab-python') diff --git a/qa/stub/fund-lab-python b/qa/stub/fund-lab-python index c9ce981..88372b8 100755 --- a/qa/stub/fund-lab-python +++ b/qa/stub/fund-lab-python @@ -32,13 +32,16 @@ case "$OP" in printf '{"schema_version":"fund-lab.akshare.v1","operation":"nav","source":"stub-synthetic","source_revision":"stub-1","_synthetic":true,"collected_at":"%s","instrument":{"code":"%s"},"observations":[{"nav_date":"2026-09-15","published_at":null,"nav":"1.1000","accumulated_nav":null,"daily_return":null},{"nav_date":"2026-09-16","published_at":null,"nav":"1.1205","accumulated_nav":null,"daily_return":"1.86"},{"nav_date":"2026-09-17","published_at":null,"nav":"1.1180","accumulated_nav":null,"daily_return":"-0.22"},{"nav_date":"2026-09-18","published_at":null,"nav":"1.1500","accumulated_nav":null,"daily_return":"2.86"},{"nav_date":"2026-09-21","published_at":null,"nav":"1.1902","accumulated_nav":null,"daily_return":"3.49"}]}\n' "$TS" "$CODE" ;; bond-quote) - # Synthetic rows mirror the live AKShare convertible-bond spot contract: - # a known live code answers with a name/price, unknown codes fail like the - # "no valid quote" collector error (-> API 503). + # Synthetic rows mirror the live AKShare bond contract: a convertible code + # answers from the spot path (name + price), a treasury-style code answers + # from the daily path (date + clean price, no name), and unknown codes fail + # like the "no valid bond quote" collector error (-> API 503). if [ "$CODE" = "110075" ]; then - printf '{"schema_version":"fund-lab.akshare.v1","operation":"bond-quote","source":"stub-synthetic","source_revision":"stub-1","_synthetic":true,"collected_at":"%s","instrument":{"code":"%s"},"quote":{"name":"南航转债","price":"106.368","maturity_date":"2026-10-15"}}\n' "$TS" "$CODE" + printf '{"schema_version":"fund-lab.akshare.v1","operation":"bond-quote","source":"stub-synthetic","source_revision":"stub-1/hs-cov-spot","_synthetic":true,"collected_at":"%s","instrument":{"code":"%s"},"quote":{"name":"南航转债","price":"106.368","clean_price":"106.368","accrued_interest":null,"date":null,"maturity_date":"2026-10-15"}}\n' "$TS" "$CODE" + elif [ "$CODE" = "019547" ]; then + printf '{"schema_version":"fund-lab.akshare.v1","operation":"bond-quote","source":"stub-synthetic","source_revision":"stub-1/hs-bond-daily","_synthetic":true,"collected_at":"%s","instrument":{"code":"%s"},"quote":{"name":null,"price":"119.858","clean_price":"119.858","accrued_interest":null,"date":"2026-09-21","maturity_date":null}}\n' "$TS" "$CODE" else - echo "AKShare collector failed: no valid quote for $CODE" >&2 + echo "AKShare collector failed: no valid bond quote for $CODE" >&2 exit 2 fi ;; -- cgit v1.2.3