Skip to content

Commit 3d41089

Browse files
committed
add: ended status with maybe date
1 parent 191ce54 commit 3d41089

File tree

7 files changed

+105
-10
lines changed

7 files changed

+105
-10
lines changed

Hastructure.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ library
7676
src
7777
build-depends:
7878
Decimal >= 0.5.2 && < 0.6,
79-
base >= 4.18.0 && < 4.21,
80-
deepseq >= 1.5.1 && < 1.6,
79+
base >= 4.18.0 && < 4.21.0,
80+
deepseq >= 1.5.0 && < 1.6,
8181
MissingH >= 1.6.0 && < 1.7,
82-
containers >= 0.6.8 && < 0.7,
83-
template-haskell >= 2.20.0 && < 2.21.1.0,
82+
containers >= 0.6.8 && < 0.7.1,
83+
template-haskell >= 2.20.0 && < 2.22.1.0,
8484
bytestring >= 0.12.1 && < 0.13,
8585
-- exceptions >= 0.10.7 && < 0.11,
8686
mtl >= 2.3.1 && < 2.4,
8787
time >= 1.12.2 && < 1.13,
8888
text >= 2.1.1 && < 2.2,
8989
regex-base >= 0.94.0 && < 0.95,
9090
aeson >= 2.2.3 && < 2.3,
91-
hashable >= 1.4.7 && < 1.5,
91+
hashable >= 1.4.7 && < 1.5.1,
9292
dlist >= 1.0 && < 1.1,
9393
scientific >= 0.3.8 && < 0.4,
9494
vector >= 0.13.2 && < 0.14,
@@ -135,7 +135,7 @@ executable Hastructure-exe
135135
build-depends:
136136
Hastructure,
137137
Decimal,
138-
base >= 4.18.0 && < 4.20,
138+
base >= 4.18.0 && < 4.21.0,
139139
deepseq,
140140
MissingH,
141141
containers,

shell-stack.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
pkgs.mkShell {
3+
buildInputs = with pkgs ; [
4+
stack
5+
zlib
6+
];
7+
LANG = "en_US.UTF-8";
8+
LC_ALL = "en_US.UTF-8";
9+
# LD_LIBRARY_PATH = "${pkgs.gcc.cc.lib}/lib:${pkgs.zeromq}/lib";
10+
11+
# shellHook = " ";
12+
}

shell.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
pkgs.mkShell {
3+
buildInputs = with pkgs ; [
4+
cabal-install
5+
cabal2nix
6+
];
7+
LANG = "en_US.UTF-8";
8+
LC_ALL = "en_US.UTF-8";
9+
# LD_LIBRARY_PATH = "${pkgs.gcc.cc.lib}/lib:${pkgs.zeromq}/lib";
10+
11+
# shellHook = " ";
12+
}

src/Deal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ changeDealStatus (d,why) newSt t@TestDeal{status=oldSt} = (Just (DealStatusChang
393393
run :: Ast.Asset a => TestDeal a -> Map.Map PoolId CF.PoolCashflow -> Maybe [ActionOnDate] -> Maybe [RateAssumption] -> Maybe ([Pre],[Pre])
394394
-> Maybe (Map.Map String (RevolvingPool,AP.ApplyAssumptionType)) -> DL.DList ResultComponent
395395
-> Either String (TestDeal a,DL.DList ResultComponent, Map.Map PoolId CF.PoolCashflow)
396-
run t@TestDeal{status=(Ended endedDate)} pCfM ads _ _ _ log = return (t,DL.snoc log (EndRun (Just endedDate) "By Status:Ended"), pCfM)
396+
run t@TestDeal{status=(Ended endedDate)} pCfM ads _ _ _ log = return (t,DL.snoc log (EndRun endedDate "By Status:Ended"), pCfM)
397397
run t pCfM (Just []) _ _ _ log = return (t,DL.snoc log (EndRun Nothing "No Actions"), pCfM)
398398
run t pCfM (Just [HitStatedMaturity d]) _ _ _ log = return (t, DL.snoc log (EndRun (Just d) "Stop: Stated Maturity"), pCfM)
399399
run t pCfM (Just (StopRunFlag d:_)) _ _ _ log = return (t, DL.snoc log (EndRun (Just d) "Stop Run Flag"), pCfM)
@@ -702,7 +702,7 @@ run t@TestDeal{accounts=accMap,fees=feeMap,triggers=mTrgMap,bonds=bndMap,status=
702702
L.payYield d intToPay bnd1)
703703
(bonds t)
704704
bondPricingResult
705-
run t {bonds = depositBondFlow, status = Ended d} Map.empty (Just []) rates calls rAssump $ DL.snoc log (EndRun (Just d) "MakeWhole call")
705+
run t {bonds = depositBondFlow, status = Ended (Just d)} Map.empty (Just []) rates calls rAssump $ DL.snoc log (EndRun (Just d) "MakeWhole call")
706706

707707
FundBond d Nothing bName accName fundAmt ->
708708
let

src/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ data DealStatus = DealAccelerated (Maybe Date) -- ^ Deal is accelerated sta
487487
| PreClosing DealStatus -- ^ Deal is not closed, but has a closing date
488488
| Warehousing (Maybe DealStatus) -- ^ Deal is not closed, but closing date is not determined yet
489489
| Called -- ^ Deal is called
490-
| Ended Date -- ^ Deal is marked as closed
490+
| Ended (Maybe Date) -- ^ Deal is marked as closed
491491
deriving (Show,Ord,Eq,Read, Generic)
492492

493493
-- ^ pricing methods for assets

stack.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This file was automatically generated by 'stack init'
2+
#
3+
# Some commonly used options have been documented as comments in this file.
4+
# For advanced use and comprehensive documentation of the format, please see:
5+
# https://docs.haskellstack.org/en/stable/configure/yaml/
6+
7+
# A 'specific' Stackage snapshot or a compiler version.
8+
# A snapshot resolver dictates the compiler version and the set of packages
9+
# to be used for project dependencies. For example:
10+
#
11+
# snapshot: lts-23.14
12+
# snapshot: nightly-2025-02-15
13+
# snapshot: ghc-9.8.4
14+
#
15+
# The location of a snapshot can be provided as a file or url. Stack assumes
16+
# a snapshot provided as a file might change, whereas a url resource does not.
17+
#
18+
# snapshot: ./custom-snapshot.yaml
19+
# snapshot: https://example.com/snapshots/2024-01-01.yaml
20+
snapshot:
21+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/0.yaml
22+
23+
# User packages to be built.
24+
# Various formats can be used as shown in the example below.
25+
#
26+
# packages:
27+
# - some-directory
28+
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
29+
# subdirs:
30+
# - auto-update
31+
# - wai
32+
packages:
33+
- .
34+
# Dependency packages to be pulled from upstream that are not in the snapshot.
35+
# These entries can reference officially published versions as well as
36+
# forks / in-progress versions pinned to a git hash. For example:
37+
#
38+
# extra-deps:
39+
# - acme-missiles-0.3
40+
# - git: https://github.com/commercialhaskell/stack.git
41+
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
42+
#
43+
# extra-deps: []
44+
45+
# Override default flag values for project packages and extra-deps
46+
# flags: {}
47+
48+
# Extra package databases containing global packages
49+
# extra-package-dbs: []
50+
51+
# Control whether we use the GHC we find on the path
52+
# system-ghc: true
53+
#
54+
# Require a specific version of Stack, using version ranges
55+
# require-stack-version: -any # Default
56+
# require-stack-version: ">=3.5"
57+
#
58+
# Override the architecture used by Stack, especially useful on Windows
59+
# arch: i386
60+
# arch: x86_64
61+
#
62+
# Extra directories used by Stack for building
63+
# extra-include-dirs: [/path/to/dir]
64+
# extra-lib-dirs: [/path/to/dir]
65+
#
66+
# Allow a newer minor version of GHC than the snapshot specifies
67+
# compiler-check: newer-minor
68+
#
69+
nix:
70+
enable: true
71+
packages: [zlib]

swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21186,7 +21186,7 @@
2118621186
"name": "BSD 3"
2118721187
},
2118821188
"title": "Hastructure API",
21189-
"version": "0.50.1"
21189+
"version": "0.50.2"
2119021190
},
2119121191
"openapi": "3.0.0",
2119221192
"paths": {

0 commit comments

Comments
 (0)