diff --git a/absbox/local/component.py b/absbox/local/component.py index 6ebfb27..a55784d 100644 --- a/absbox/local/component.py +++ b/absbox/local/component.py @@ -178,7 +178,9 @@ def mkDs(x): return mkTag("CurrentBondBalance") case ("债券余额", *bnds) | ("bondBalance", *bnds): return mkTag(("CurrentBondBalanceOf", vList(bnds, str))) - case ("初始债券余额",) | ("originalBondBalance",): + case ("初始债券余额",*bnds) | ("originalBondBalance",*bnds): + if bnds: + return mkTag("OriginalBondBalanceOf", vList(bnds, str)) return mkTag("OriginalBondBalance") case ("到期月份", bn) | ("monthsTillMaturity", bn): return mkTag(("MonthsTillMaturity", vStr(bn))) @@ -247,7 +249,7 @@ def mkDs(x): case ("资产池系数", *pNames) | ("poolFactor", *pNames): if pNames: return mkTag(("PoolFactor", lmap(mkPid,pNames))) - return mkTag("PoolFactor") + return mkTag(("PoolFactor", None)) case ("债券利率", bn) | ("bondRate", bn): return mkTag(("BondRate", vStr(bn))) case ("债券加权利率", *bn) | ("bondWaRate", *bn): @@ -306,6 +308,8 @@ def mkDs(x): return mkTag(("AccTxnAmt", [ans, cmt])) case ("系数", ds, f) | ("factor", ds, f) | ("*", ds, f) if isinstance(f, float): return mkTag(("Factor", [mkDs(ds), f])) + case ("*", *ds): + return mkTag(("Multiply", lmap(mkDs, ds))) case ("Min", *ds) | ("min", *ds): return mkTag(("Min", lmap(mkDs, ds))) case ("Max", *ds) | ("max", *ds): diff --git a/docs/source/howto.rst b/docs/source/howto.rst index d3c450b..c43ec61 100644 --- a/docs/source/howto.rst +++ b/docs/source/howto.rst @@ -1078,3 +1078,11 @@ A string ^^^^^^^^^^^^^^^ Now with that string, user can just write it into a No-SQL document database . or sent via Email , or Fax it . + + +How to use Deal JSON string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The JSON string from `.json()` method can be used as part of post request send to `Hastructure` engine. + +But unfortunately there is no way convert the string back to python class so far. \ No newline at end of file diff --git a/docs/source/modeling.rst b/docs/source/modeling.rst index ac0e00d..eca987a 100644 --- a/docs/source/modeling.rst +++ b/docs/source/modeling.rst @@ -211,6 +211,7 @@ Bond * ``("bondBalance",)`` -> sum of all bond balance * ``("bondBalance","A","B"...)`` -> sum of balance of bond A and bond B * ``("originalBondBalance",)`` -> bond balance at issuance + * ``("originalBondBalance","A","B")`` -> bond balance at issuance of "A" and "B" * ``("bondFactor",)`` -> bond factor * ``("bondDueInt","A","B")`` -> bond due interest for bond A and bond B * ``("lastBondIntPaid","A")`` -> bond last paid interest @@ -226,10 +227,10 @@ Pool * ``("cumPoolDefaultedBalance",)`` -> pool cumulative defaulted balance * ``("cumPoolNetLoss",)`` -> pool cumulative pool net loss balance * ``("cumPoolRecoveries",)`` -> pool cumulative recoveries - * ``("cumPoolCollection", ,....)`` -> pool cumulative on fields :ref:`Pool Sources` - * ``("cumPoolCollectionTill", N,,....)`` -> pool cumulative on fields till Period N :ref:`Pool Sources` - * ``("curPoolCollection", ,...)`` -> pool current sum of fields - * ``("curPoolCollectionTill", N,,...)`` -> pool current sum of fields till Period N + * ``("cumPoolCollection", None, ,....)`` -> pool cumulative on fields :ref:`Pool Sources` + * ``("cumPoolCollectionTill", None, N,,....)`` -> pool cumulative on fields till Period N :ref:`Pool Sources` + * ``("curPoolCollection", None, ,...)`` -> pool current sum of fields + * ``("curPoolCollectionTill", None, N,,...)`` -> pool current sum of fields till Period N .. versionadded:: 0.24.1