Skip to content

Commit

Permalink
uplift clean up waterfall at end
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbean committed Oct 17, 2024
1 parent 467d24c commit 650cc67
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Deal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,12 @@ run t pCfM (Just (StopRunFlag d:_)) _ _ _ log = (prepareDeal t,log++[EndRun (Ju
run t@TestDeal{accounts=accMap,fees=feeMap,triggers=mTrgMap,bonds=bndMap,status=dStatus,waterfall=waterfallM,name=dealName,pool=pt}
poolFlowMap (Just (ad:ads)) rates calls rAssump log
| all (== 0) futureCashToCollect && (queryDeal t AllAccBalance == 0) && (dStatus /= Revolving)
= (prepareDeal $
foldl (performAction (getDate ad)) t cleanUpActions
,log++[EndRun (Just (getDate ad)) "No Pool Cashflow/All Account is zero/Not revolving"]) -- `debug` ("End of pool collection with logs with length "++ show (length log))
= let
-- finalDeal = foldl (performAction (getDate ad)) t cleanUpActions
runContext = RunContext poolFlowMap rAssump rates
(finalDeal,_,newLogs) = foldl (performActionWrap (getDate ad)) (t,runContext,log) cleanUpActions
in
(prepareDeal finalDeal,newLogs++[EndRun (Just (getDate ad)) "No Pool Cashflow/All Account is zero/Not revolving"]) -- `debug` ("End of pool collection with logs with length "++ show (length log))

| otherwise
= case ad of
Expand Down Expand Up @@ -428,6 +431,7 @@ run t@TestDeal{accounts=accMap,fees=feeMap,triggers=mTrgMap,bonds=bndMap,status=
[DealStatusChangeTo d dStatus Called,RunningWaterfall d W.CleanUp]
endingLogs = Rpt.patchFinancialReports dealAfterCleanUp d log
in
-- TODO missing newLogWaterfall_
(prepareDeal dealAfterCleanUp, endingLogs ++ logsBeforeDist ++newStLogs++[EndRun (Just d) "Clean Up"]) -- `debug` ("Called ! "++ show d)
else
let
Expand Down

0 comments on commit 650cc67

Please sign in to comment.