Skip to content

Commit 2ff67ec

Browse files
committed
fix date
1 parent 14ff6cd commit 2ff67ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

absbox/local/component.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def mkDatePattern(x):
6565
return mkTag((_x))
6666
case _x if (_x in datePattern.keys()):
6767
return mkTag((datePattern[x]))
68-
case d if isinstance(d, str):
68+
case d if isinstance(d, str) and vDate(x):
6969
return mkTag(("SingletonDate", d))
7070
case _:
7171
raise RuntimeError(f"Failed to match {x}")
@@ -127,13 +127,13 @@ def mkDate(x):
127127
}
128128
return mkTag(("GenericDates",m))
129129
case {"封包日": a, "起息日": b, "首次兑付日": c, "法定到期日": d, "收款频率": pf, "付款频率": bf} | \
130-
{"cutoff": a, "closing": b, "firstPay": c, "stated": d, "poolFreq": pf, "payFreq": bf}:
130+
{"cutoff": a, "closing": b, "firstPay": c, "stated": d, "poolFreq": pf, "payFreq": bf} if (not "cust" in x):
131131
firstCollection = x.get("首次归集日", b)
132132
mr = None
133133
return mkTag(("PreClosingDates"
134134
, [vDate(a), vDate(b), mr, vDate(d), [vDate(firstCollection), mkDatePattern(pf)], [vDate(c), mkDatePattern(bf)]]))
135135
case {"归集日": (lastCollected, nextCollect), "兑付日": (pp, np), "法定到期日": c, "收款频率": pf, "付款频率": bf} | \
136-
{"collect": (lastCollected, nextCollect), "pay": (pp, np), "stated": c, "poolFreq": pf, "payFreq": bf}:
136+
{"collect": (lastCollected, nextCollect), "pay": (pp, np), "stated": c, "poolFreq": pf, "payFreq": bf} if (not "cust" in x):
137137
mr = None
138138
return mkTag(("CurrentDates", [[vDate(lastCollected), vDate(pp)],
139139
mr,
@@ -147,7 +147,7 @@ def mkDate(x):
147147
, closingDate
148148
, [mkTag(("RunWaterfall", [dd, ""])) for dd in ddays]]))
149149
case _:
150-
raise RuntimeError(f"Failed to match:{x} in Dates")
150+
raise RuntimeError(f"Failed to match:{x} in Dates but got: {x.keys()}")
151151

152152

153153
def mkDsRate(x):
@@ -972,7 +972,7 @@ def mkBookType(x: list):
972972
def mkSupport(x:list):
973973
match x:
974974
case ["account", accName, (direction,ledgerName)] | ["suppportAccount", accName, (direction,ledgerName)] | ["支持账户", accName, (direction,ledgerName)] if direction in bookDirection.keys():
975-
return mkTag(("SupportAccount", [vStr(accName), [vStr(bookDirection["direction"]),vStr(ledgerName)]]))
975+
return mkTag(("SupportAccount", [vStr(accName), [vStr(bookDirection[direction]),vStr(ledgerName)]]))
976976
case ["account", accName] | ["suppportAccount", accName] | ["支持账户", accName]:
977977
return mkTag(("SupportAccount", [vStr(accName), None]))
978978
case ["facility", liqName] | ["suppportFacility", liqName] | ["支持机构", liqName]:

0 commit comments

Comments
 (0)