summaryrefslogtreecommitdiff
path: root/qa/stub/fund-lab-python
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 03:48:12 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 03:48:12 +0800
commitb5a80f69cb2e2793e5134e23a0eb3e72cdbdbe0b (patch)
treeeeb22106ceb0d1eb0fe07b7bff18450af11e0d50 /qa/stub/fund-lab-python
parent7dd0e3f42105569b6e6ec02aeeec9b5a8bbd9dd3 (diff)
downloadfund-lab-b5a80f69cb2e2793e5134e23a0eb3e72cdbdbe0b.tar.gz
Add multi-source bond quote probe fields and daily fallback (3d-20)
Diffstat (limited to 'qa/stub/fund-lab-python')
-rwxr-xr-xqa/stub/fund-lab-python13
1 files changed, 8 insertions, 5 deletions
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
;;