Skip to content

Commit

Permalink
Applicability improvements [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
d-velev committed Apr 8, 2021
1 parent 7cf9d69 commit 1765f6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Expand Up @@ -147,7 +147,7 @@ data ContractTerms = ContractTerms {
contractId :: String
, contractType :: Maybe ContractType
, ct_IED :: Day -- Initial Exchange Date
, ct_SD :: Day -- start date
, ct_SD :: Day -- status date
, ct_MD :: Maybe Day -- maturity date
, ct_TD :: Maybe Day -- termination date
, ct_PRNXT :: Maybe Double -- periodic payment amount
Expand Down
Expand Up @@ -14,7 +14,13 @@ validateTerms t =
Just PAM ->
pure t <*
_X (calendar . scfg) t "calendar" <*
_X (bdc . scfg) t "business day convention" <*
_X (eomc . scfg) t "end of month convention" <*
_NN ct_SD t "status date" <*
_NN ct_CNTRL t "contract role" <*
_NN contractId t "contract id" <*


_NN ct_NT t "notional principal" <*
_NN_I_1 [isJust $ ct_PRD t, isJust $ ct_PPRD t] t ["purchase date", "price at purchase date"] <*
_NN_I_1 [isJust $ ct_TD t, isJust $ ct_PTD t] t ["termination date", "price at termination"] <*
Expand Down
2 changes: 1 addition & 1 deletion marlowe-actus/test/Spec/Marlowe/Actus.hs
Expand Up @@ -30,7 +30,7 @@ contractTerms = ContractTerms {
contractId = "0"
, contractType = Just PAM
, ct_IED = fromGregorian 2020 10 20 -- Initial Exchange Date
, ct_SD = fromGregorian 2007 10 22 -- start date
, ct_SD = fromGregorian 2007 10 22 -- status date
, ct_MD = Just $ fromGregorian 2025 10 22 -- maturity date
, ct_TD = Nothing -- termination date
, ct_PRNXT = Nothing -- Next principal redemption payment (N/A for PAM)
Expand Down

0 comments on commit 1765f6a

Please sign in to comment.