Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
24fed3f
fix revolv buy when building balanace; avoid duplicate run waterfall …
yellowbean Sep 25, 2024
6fb845c
bump version to-> < 0.29.6 >
yellowbean Sep 25, 2024
935dda6
fix multiple entity cf merge
yellowbean Sep 25, 2024
187e598
bump version to-> < 0.29.7 >
yellowbean Sep 25, 2024
4631460
"expose combo sensitivity endpoint"
yellowbean Sep 29, 2024
3d4790a
expose pricing for bond groups
yellowbean Oct 4, 2024
6388927
update version
yellowbean Oct 4, 2024
39a5189
refactor on ledger booking
yellowbean Oct 4, 2024
cf57c68
expose single clear ledger function
yellowbean Oct 5, 2024
52876f4
factor out pay liabilities by sequence
yellowbean Oct 5, 2024
32ad475
add bond prism
yellowbean Oct 7, 2024
b33a317
expose combo
yellowbean Oct 7, 2024
3e6467d
expose writeoffBySeq
yellowbean Oct 7, 2024
07015ca
fix stmt consol
yellowbean Oct 7, 2024
ae8b8cd
expose generic payProRata
yellowbean Oct 7, 2024
d620ba9
minor cleanup
yellowbean Oct 8, 2024
a1c9fe2
expose which pool to liquidate
yellowbean Oct 10, 2024
7f53fba
add new assumption curve with padding last value to rest
yellowbean Oct 11, 2024
2a24f26
fix cors problem
yellowbean Oct 11, 2024
ca5d031
relax cf proj on mortgage
yellowbean Oct 11, 2024
bb6c775
Fix Pool Agg Logic by create a new poolCf2
yellowbean Oct 12, 2024
855487c
expose extra Stress on ppy/def curve
yellowbean Oct 12, 2024
55c73db
bump version to-> < 0.29.9 >
yellowbean Oct 12, 2024
62eaecb
Add var for recording current balance
yellowbean Oct 14, 2024
a195faa
bump version to-> < 0.29.10 >
yellowbean Oct 14, 2024
2675f95
correct begBalance for asset cashflow statuts
yellowbean Oct 15, 2024
7f30255
liquidate action refactor
yellowbean Oct 15, 2024
b4da12c
remove future cashflow if liq a pool
yellowbean Oct 15, 2024
306e5d3
update workflow
yellowbean Oct 16, 2024
7ae5883
Fix if new bought cf is longer than original pool
yellowbean Oct 16, 2024
748a728
bump version to-> < 0.29.11 >
yellowbean Oct 16, 2024
467d24c
Lift bought to performWrap
yellowbean Oct 17, 2024
650cc67
uplift clean up waterfall at end
yellowbean Oct 17, 2024
4f5fce6
bump version to-> < 0.29.12 >
yellowbean Oct 17, 2024
8e58d33
fix if bought asset flow is zero
yellowbean Oct 18, 2024
25218a8
bump version to-> < 0.29.12 >
yellowbean Oct 18, 2024
3fa00ab
bump version to-> < 0.29.13 >
yellowbean Oct 18, 2024
139f2b1
add missing txn comment for group bond int /prin
yellowbean Oct 18, 2024
14c5866
bump version to-> < 0.29.14 >
yellowbean Oct 18, 2024
d6d4f9b
expose transferMultiple
yellowbean Oct 19, 2024
0c6889b
bump version to-> < 0.29.15 >
yellowbean Oct 19, 2024
3df4d05
avoid use infinity
yellowbean Oct 19, 2024
fa0682a
update wf
yellowbean Oct 19, 2024
ad3ccbd
bump version to-> < 0.29.16 >
yellowbean Oct 19, 2024
a3a780e
Merge branch 'master' into 0.29.6
yellowbean Oct 19, 2024
19adbd2
bump version to-> < 0.29.17 >
yellowbean Oct 19, 2024
66e876f
fix wf
yellowbean Oct 19, 2024
01922a1
Fix Cumul calc on revolving pool
yellowbean Oct 21, 2024
9f479a5
update UT
yellowbean Oct 21, 2024
383c4b7
Merge commit '66e876ffd4cc08046947c7d082b3027014593195' into 0.30.x
yellowbean Oct 21, 2024
82284b0
Revert "Merge commit '66e876ffd4cc08046947c7d082b3027014593195' into …
yellowbean Oct 21, 2024
984451c
bump version to-> < 0.29.18 >
yellowbean Oct 21, 2024
e9954a3
fix balance when merging
yellowbean Oct 22, 2024
375b854
BUGFIX: use mergePoolCF2 instead of mergePoolCF1
yellowbean Oct 23, 2024
29c1554
WIP
yellowbean Oct 23, 2024
0f92905
add bond stmt merge edge case
yellowbean Oct 24, 2024
eff1a79
bump version to-> < 0.29.20 >
yellowbean Oct 24, 2024
9d2050c
expose date/int range/set predicate
yellowbean Oct 24, 2024
f92d06a
expose credit calculation type for liqProvider
yellowbean Oct 25, 2024
a70cf29
Fix UT
yellowbean Oct 25, 2024
e81482c
expose PV when liquidate pool
yellowbean Oct 26, 2024
4a9cb7a
Use PvRate when liq
yellowbean Oct 26, 2024
27d5003
remove debug
yellowbean Oct 26, 2024
6c5a77f
bump version to-> < 0.30.1 >
yellowbean Oct 26, 2024
a09c3a9
minor fix on prin pay stmt
yellowbean Oct 26, 2024
f7eda22
bump version to-> < 0.30.1 >
yellowbean Oct 26, 2024
80b876c
update action
yellowbean Oct 26, 2024
f4dcd82
bump version to-> < 0.30.2 >
yellowbean Oct 27, 2024
01f4f0e
fix Over drawn
yellowbean Oct 27, 2024
556f2fe
bump version to-> < 0.30.3 >
yellowbean Oct 27, 2024
a2861f8
fix accure day on liqFacility
yellowbean Oct 27, 2024
6cc0139
bump version to-> < 0.30.4 >
yellowbean Oct 27, 2024
dfd1174
Expose bond factor for single bond
yellowbean Oct 28, 2024
b8e7e97
include UT for liq
yellowbean Oct 30, 2024
f664821
update changelog
yellowbean Nov 1, 2024
606f534
FIX: query on borrower number on current asset
yellowbean Nov 1, 2024
06f6c9f
enhance: getPoolCurrentBal with pool id
yellowbean Nov 2, 2024
043cf98
FIX: balanceSheet with multiple pools
yellowbean Nov 2, 2024
a2a9a0c
include logs in clean up actions
yellowbean Nov 2, 2024
d191bf7
Fix log in trigger effects/action
yellowbean Nov 2, 2024
0c32193
bump version to-> < 0.30.5 >
yellowbean Nov 2, 2024
d49fbaf
new Call Options
yellowbean Nov 4, 2024
26bc95c
expose before on date pattern
yellowbean Nov 4, 2024
e160a3b
add truncate before/after for date pattern
yellowbean Nov 5, 2024
05b6025
bump version to-> < 0.30.8 >
yellowbean Nov 5, 2024
f45d61d
add direction for payGroupPrin/payGroupInt
yellowbean Nov 5, 2024
41d5c5b
bump version to-> < 0.30.9 >
yellowbean Nov 5, 2024
8fad214
complete the txn direction
yellowbean Nov 5, 2024
d539f51
bump version to-> < 0.30.10 >
yellowbean Nov 5, 2024
f15f5fe
seperate each pool balance on financial reports
yellowbean Nov 7, 2024
161c382
patch runtime current balance at begin
yellowbean Nov 7, 2024
9fd6ff5
transform balanacesheet to tree from table
yellowbean Nov 8, 2024
a7a0476
new financial reports
yellowbean Nov 10, 2024
1341da6
bump version to-> < 0.31.0 >
yellowbean Nov 10, 2024
07db3c6
fix UT
yellowbean Nov 10, 2024
54015fe
bump version to-> < 0.31.1 >
yellowbean Nov 10, 2024
75062ce
normalized txn comment when agg
yellowbean Nov 11, 2024
f99ca55
bump version to-> < 0.31.2 >
yellowbean Nov 11, 2024
a9acde9
fix query on default balance/ defaulted rate
yellowbean Nov 19, 2024
727893d
add safeDiv
yellowbean Nov 20, 2024
7df0ccf
WIP
yellowbean Nov 22, 2024
44dec7e
WIP 2
yellowbean Nov 23, 2024
a5c6f52
Expose Error Message
yellowbean Nov 24, 2024
0d4803a
Fix calcFee and financial reports
yellowbean Nov 25, 2024
afce0a4
First test for Error Message version
yellowbean Nov 26, 2024
e12d4aa
bump version to-> < 0.40.1 >
yellowbean Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-image-dev-by-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: yellowbean/hastructure
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}

- name: 'Cleanup build folder'
run: |
Expand Down
377 changes: 373 additions & 4 deletions ChangeLog.md

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion Hastructure.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.35.2.
-- This file has been generated from package.yaml by hpack version 0.36.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -78,12 +78,15 @@ library
, containers
, generic-lens
, hashable
, ieee754
, lens
, monad-loops
, numeric-limits
, openapi3
, regex-base
, regex-pcre-builtin
, regex-tdfa
, scientific
, servant
, servant-openapi3
, servant-server
Expand Down Expand Up @@ -118,8 +121,10 @@ executable Hastructure-exe
, generic-lens
, hashable
, http-types
, ieee754
, lens
, lucid
, monad-loops
, mtl
, numeric-limits
, openapi3
Expand Down Expand Up @@ -159,6 +164,7 @@ test-suite Hastructure-test
UT.AssetTest
UT.BondTest
UT.CashflowTest
UT.CeTest
UT.DealTest
UT.DealTest2
UT.ExpTest
Expand All @@ -181,12 +187,15 @@ test-suite Hastructure-test
, containers
, generic-lens
, hashable
, ieee754
, lens
, monad-loops
, numeric-limits
, openapi3
, regex-base
, regex-pcre-builtin
, regex-tdfa
, scientific
, servant
, servant-openapi3
, servant-server
Expand Down
146 changes: 87 additions & 59 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import System.Environment

import Control.Monad.Catch (MonadCatch, MonadThrow (..))
import Control.Monad.IO.Class (liftIO)
import Control.Monad (mapM)
import Control.Exception (Exception,throwIO,throw)
import Control.Monad.Except
import Control.Monad.Reader
Expand Down Expand Up @@ -86,15 +87,26 @@ import qualified Revolving as RV
import qualified Lib
import qualified Util as U
import qualified DateUtil as DU

-- import Servant.Checked.Exceptions (NoThrow, Throws)
-- import Servant.Checked.Exceptions.Internal.Servant.API (ErrStatus(toErrStatus))

import Data.Scientific (fromRationalRepetend,formatScientific, Scientific,FPFormat(Fixed))
import Control.Lens
import Debug.Trace
import qualified Types as W
import Cashflow (patchCumulative)


debug = flip Debug.Trace.trace


-- instance ToJSON (Ratio Integer) where
-- toJSON r = case fromRationalRepetend Nothing r of
-- Left (sci, _) -> toJSON $ formatScientific Fixed (Just 8) sci
-- -- Right (sci, rep) -> object ["repetend" .= rep, "fraction" .= sci]
-- Right (sci, rep) -> toJSON $ formatScientific Fixed (Just 8) sci


data Version = Version
{ _version :: String
} deriving (Eq, Show, Generic)
Expand All @@ -103,7 +115,7 @@ $(deriveJSON defaultOptions ''Version)
instance ToSchema Version

version1 :: Version
version1 = Version "0.29.17"
version1 = Version "0.40.1"



Expand Down Expand Up @@ -175,6 +187,7 @@ instance ToSchema W.Action
instance ToSchema W.BookType
instance ToSchema W.CollectionRule
instance ToSchema C.CallOption
instance ToSchema CE.LiqCreditCalc
instance ToSchema CE.LiqFacility
instance ToSchema HE.RateSwap
instance ToSchema HE.RateSwapType
Expand All @@ -200,6 +213,8 @@ instance ToSchema AP.IssueBondEvent
instance ToSchema (TsPoint AP.IssueBondEvent)
instance ToSchema (TsPoint AP.RefiEvent)
instance ToSchema AP.RefiEvent
instance ToSchema AP.InspectType
instance ToSchema AP.CallOpt
instance ToSchema AP.NonPerfAssumption
instance ToSchema AP.BondPricingInput
instance ToSchema AP.RevolvingAssumption
Expand Down Expand Up @@ -253,41 +268,41 @@ instance ToSchema ResultComponent
instance ToSchema L.PriceResult
instance ToSchema DealType

type RunResp = (DealType , Maybe (Map.Map PoolId CF.CashFlowFrame), Maybe [ResultComponent],Maybe (Map.Map String L.PriceResult))
type RunResp = Either String (DealType , Maybe (Map.Map PoolId CF.CashFlowFrame), Maybe [ResultComponent],Maybe (Map.Map String L.PriceResult))

wrapRun :: DealType -> Maybe AP.ApplyAssumptionType -> AP.NonPerfAssumption -> RunResp
wrapRun (MDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(MDeal _d,_pflow,_rs,_p) -- `debug` ("Run Done with deal->"++ show _d)
wrapRun (RDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(RDeal _d,_pflow,_rs,_p)
wrapRun (IDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(IDeal _d,_pflow,_rs,_p)
wrapRun (LDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(LDeal _d,_pflow,_rs,_p)
wrapRun (FDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(FDeal _d,_pflow,_rs,_p)
wrapRun (UDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(UDeal _d,_pflow,_rs,_p)
wrapRun (VDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(VDeal _d,_pflow,_rs,_p)
wrapRun (PDeal d) mAssump mNonPerfAssump = let
(_d,_pflow,_rs,_p) = D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
in
(PDeal _d,_pflow,_rs,_p)
wrapRun (MDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (MDeal _d,_pflow,_rs,_p) -- `debug` ("Run Done with deal->"++ show _d)
wrapRun (RDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (RDeal _d,_pflow,_rs,_p)
wrapRun (IDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (IDeal _d,_pflow,_rs,_p)
wrapRun (LDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (LDeal _d,_pflow,_rs,_p)
wrapRun (FDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (FDeal _d,_pflow,_rs,_p)
wrapRun (UDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (UDeal _d,_pflow,_rs,_p)
wrapRun (VDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (VDeal _d,_pflow,_rs,_p)
wrapRun (PDeal d) mAssump mNonPerfAssump
= do
(_d,_pflow,_rs,_p) <- D.runDeal d D.DealPoolFlowPricing mAssump mNonPerfAssump
return (PDeal _d,_pflow,_rs,_p)

wrapRun x _ _ = error $ "RunDeal Failed ,due to unsupport deal type "++ show x

Expand All @@ -303,13 +318,17 @@ data PoolTypeWrap = LPool (DB.PoolType AB.Loan)
deriving(Show, Generic)


type RunPoolTypeRtn = Map.Map PoolId (CF.CashFlowFrame, Map.Map CutoffFields Balance)
type RunPoolTypeRtn_ = Map.Map PoolId (CF.CashFlowFrame, Map.Map CutoffFields Balance)
type RunPoolTypeRtn = Either String RunPoolTypeRtn_

patchCumulativeToPoolRun :: RunPoolTypeRtn -> RunPoolTypeRtn
patchCumulativeToPoolRun = Map.map
(\(CF.CashFlowFrame _ txns,stats) -> (CF.CashFlowFrame (0,Lib.toDate "19000101",Nothing) (CF.patchCumulative (0,0,0,0,0,0) [] txns),stats))
patchCumulativeToPoolRun :: RunPoolTypeRtn_ -> RunPoolTypeRtn_
patchCumulativeToPoolRun
= Map.map
(\(CF.CashFlowFrame _ txns,stats) ->
(CF.CashFlowFrame (0,Lib.toDate "19000101",Nothing) (CF.patchCumulative (0,0,0,0,0,0) [] txns),stats)
)

wrapRunPoolType :: PoolTypeWrap -> Maybe AP.ApplyAssumptionType -> Maybe [RateAssumption] -> RunPoolTypeRtn
wrapRunPoolType :: PoolTypeWrap -> Maybe AP.ApplyAssumptionType -> Maybe [RateAssumption] -> RunPoolTypeRtn
wrapRunPoolType (MPool pt) assump mRates = D.runPoolType pt assump $ Just (AP.NonPerfAssumption{AP.interest = mRates})
wrapRunPoolType (LPool pt) assump mRates = D.runPoolType pt assump $ Just (AP.NonPerfAssumption{AP.interest = mRates})
wrapRunPoolType (IPool pt) assump mRates = D.runPoolType pt assump $ Just (AP.NonPerfAssumption{AP.interest = mRates})
Expand All @@ -326,21 +345,28 @@ data RunAssetReq = RunAssetReq Date [AB.AssetUnion] (Maybe AP.ApplyAssumptionTyp

instance ToSchema RunAssetReq

wrapRunAsset :: RunAssetReq -> ((CF.CashFlowFrame, Map.Map CutoffFields Balance), Maybe [PriceResult])
type RunAssetResp = Either String ((CF.CashFlowFrame, Map.Map CutoffFields Balance), Maybe [PriceResult])


wrapRunAsset :: RunAssetReq -> RunAssetResp
wrapRunAsset (RunAssetReq d assets Nothing mRates Nothing)
= (P.aggPool Nothing ((\a -> (MA.calcAssetUnion a d mRates, Map.empty)) <$> assets), Nothing)
= do
cfs <- sequenceA $ (\a -> MA.calcAssetUnion a d mRates) <$> assets
return (P.aggPool Nothing [(cf,Map.empty) | cf <- cfs], Nothing)
wrapRunAsset (RunAssetReq d assets (Just (AP.PoolLevel assumps)) mRates Nothing)
= (P.aggPool Nothing ((\a -> MA.projAssetUnion a d assumps mRates) <$> assets), Nothing)
= do
cfs <- sequenceA $ (\a -> MA.projAssetUnion a d assumps mRates) <$> assets
return (P.aggPool Nothing [(cf,Map.empty) | (cf,_) <- cfs] , Nothing)

wrapRunAsset (RunAssetReq d assets (Just (AP.PoolLevel assumps)) mRates (Just pm))
= let
assetCf = P.aggPool Nothing $ (\a -> D.projAssetUnion a d assumps mRates ) <$> assets
pricingResult = (\a -> D.priceAssetUnion a d pm assumps mRates) <$> assets
in
(assetCf , Just pricingResult)
=
do
cfs <- sequenceA $ (\a -> MA.projAssetUnion a d assumps mRates) <$> assets
pricingResult <- sequenceA $ (\a -> D.priceAssetUnion a d pm assumps mRates) <$> assets
let assetCf = P.aggPool Nothing cfs
return (assetCf , Just pricingResult)

--TODO implement on running via ByIndex

type ScenarioName = String

data RunDealReq = SingleRunReq DealType (Maybe AP.ApplyAssumptionType) AP.NonPerfAssumption
Expand Down Expand Up @@ -374,10 +400,10 @@ $(concat <$> traverse (deriveJSON defaultOptions) [''RunDealReq, ''RunPoolReq,''
-- Swagger API
type SwaggerAPI = "swagger.json" :> Get '[JSON] OpenApi

type PoolRunResp = Map.Map PoolId (CF.CashFlowFrame, Map.Map CutoffFields Balance)
type PoolRunResp = Either String (Map.Map PoolId (CF.CashFlowFrame, Map.Map CutoffFields Balance))

type EngineAPI = "version" :> Get '[JSON] Version
:<|> "runAsset" :> ReqBody '[JSON] RunAssetReq :> Post '[JSON] ((CF.CashFlowFrame, Map.Map CutoffFields Balance),Maybe [PriceResult])
:<|> "runAsset" :> ReqBody '[JSON] RunAssetReq :> Post '[JSON] RunAssetResp
:<|> "runPool" :> ReqBody '[JSON] RunPoolReq :> Post '[JSON] PoolRunResp
:<|> "runPoolByScenarios" :> ReqBody '[JSON] RunPoolReq :> Post '[JSON] (Map.Map ScenarioName PoolRunResp)
:<|> "runDeal" :> ReqBody '[JSON] RunDealReq :> Post '[JSON] RunResp
Expand All @@ -402,20 +428,24 @@ engineSwagger = toOpenApi engineAPI
& info.license ?~ "BSD 3"



-- showVersion :: Handler (Envelope '[] Version)
showVersion :: Handler Version
showVersion = return version1

runAsset :: RunAssetReq -> Handler ((CF.CashFlowFrame, Map.Map CutoffFields Balance),Maybe [PriceResult])
runAsset req = return $ wrapRunAsset req
runAsset :: RunAssetReq -> Handler RunAssetResp
runAsset req = return $
wrapRunAsset req

runPool :: RunPoolReq -> Handler PoolRunResp
runPool (SingleRunPoolReq pt passumption mRates) = return $ patchCumulativeToPoolRun $ wrapRunPoolType pt passumption mRates
runPool (SingleRunPoolReq pt passumption mRates)
= return $
patchCumulativeToPoolRun <$> (wrapRunPoolType pt passumption mRates)

runPoolScenarios :: RunPoolReq -> Handler (Map.Map ScenarioName PoolRunResp)
runPoolScenarios (MultiScenarioRunPoolReq pt mAssumps mRates) = return $ Map.map (\assump -> patchCumulativeToPoolRun (wrapRunPoolType pt (Just assump) mRates))
mAssumps
runPoolScenarios (MultiScenarioRunPoolReq pt mAssumps mRates)
= return $ Map.map (\assump ->
patchCumulativeToPoolRun <$> (wrapRunPoolType pt (Just assump) mRates))
mAssumps

runDeal :: RunDealReq -> Handler RunResp
runDeal (SingleRunReq dt assump nonPerfAssump) = return $ wrapRun dt assump nonPerfAssump
Expand Down Expand Up @@ -461,7 +491,6 @@ myServer = return engineSwagger
:<|> runDealByRunScenarios
:<|> runDealByCombo
:<|> runDate
-- :<|> error "not implemented"


writeSwaggerJSON :: IO ()
Expand All @@ -477,7 +506,6 @@ app :: Application
app = simpleCors $ serve (Proxy :: Proxy API) myServer



main :: IO ()
main =
do
Expand Down
6 changes: 5 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ dependencies:
- regex-pcre-builtin
- vector
- wai
- monad-loops
- ieee754
- servant
- servant-server
- servant-openapi3
Expand All @@ -44,6 +46,7 @@ dependencies:
- split
- tabular
- numeric-limits
- scientific

library:
source-dirs:
Expand Down Expand Up @@ -78,6 +81,7 @@ executables:
- mtl
- servant
- lucid
- monad-loops
- string-conversions
- attoparsec
- exceptions
Expand All @@ -104,4 +108,4 @@ tests:
- tasty-golden


allow-newer: true
allow-newer: true
Loading
Loading