Safe Haskell | None |
---|---|
Language | Haskell2010 |
Accounts
Synopsis
- data Account = Account {}
- data ReserveAmount
- draw :: Amount -> Date -> TxnComment -> Account -> Account
- deposit :: Amount -> Date -> TxnComment -> Account -> Account
- transfer :: (Account, Account) -> Date -> Amount -> (Account, Account)
- depositInt :: Date -> Account -> Account
- data InterestInfo
- buildEarnIntAction :: [Account] -> Date -> [(String, Dates)] -> [(String, Dates)]
- accBalLens :: Lens' Account Balance
- tryDraw :: Amount -> Date -> TxnComment -> Account -> ((Amount, Amount), Account)
- buildRateResetDates :: Date -> Account -> Maybe (String, Dates)
- accrueInt :: Date -> Account -> Balance
- accTypeLens :: Lens' Account (Maybe ReserveAmount)
Documentation
Constructors
Account | |
Fields
|
Instances
data ReserveAmount Source #
Constructors
PctReserve DealStats Rate | target amount with reference to % of formula |
FixReserve Balance | target amount with fixed balance amount |
Either Pre ReserveAmount ReserveAmount | target amount depends on a test, if true, then use first one ,otherwise use second one |
Max [ReserveAmount] | use higher of all reserve formulas |
Min [ReserveAmount] | use lower of all reserve formulas |
Instances
FromJSON ReserveAmount Source # | |||||
Defined in Accounts Methods parseJSON :: Value -> Parser ReserveAmount # parseJSONList :: Value -> Parser [ReserveAmount] # | |||||
ToJSON ReserveAmount Source # | |||||
Defined in Accounts Methods toJSON :: ReserveAmount -> Value # toEncoding :: ReserveAmount -> Encoding # toJSONList :: [ReserveAmount] -> Value # toEncodingList :: [ReserveAmount] -> Encoding # omitField :: ReserveAmount -> Bool # | |||||
Generic ReserveAmount Source # | |||||
Defined in Accounts Associated Types
| |||||
Show ReserveAmount Source # | |||||
Defined in Accounts Methods showsPrec :: Int -> ReserveAmount -> ShowS # show :: ReserveAmount -> String # showList :: [ReserveAmount] -> ShowS # | |||||
Eq ReserveAmount Source # | |||||
Defined in Accounts Methods (==) :: ReserveAmount -> ReserveAmount -> Bool # (/=) :: ReserveAmount -> ReserveAmount -> Bool # | |||||
Ord ReserveAmount Source # | |||||
Defined in Accounts Methods compare :: ReserveAmount -> ReserveAmount -> Ordering # (<) :: ReserveAmount -> ReserveAmount -> Bool # (<=) :: ReserveAmount -> ReserveAmount -> Bool # (>) :: ReserveAmount -> ReserveAmount -> Bool # (>=) :: ReserveAmount -> ReserveAmount -> Bool # max :: ReserveAmount -> ReserveAmount -> ReserveAmount # min :: ReserveAmount -> ReserveAmount -> ReserveAmount # | |||||
type Rep ReserveAmount Source # | |||||
Defined in Accounts type Rep ReserveAmount = D1 ('MetaData "ReserveAmount" "Accounts" "Hastructure-0.50.0-9tFAxbqhtE23KiGoJqUlJG" 'False) ((C1 ('MetaCons "PctReserve" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStats) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rate)) :+: C1 ('MetaCons "FixReserve" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance))) :+: (C1 ('MetaCons "Either" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pre) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ReserveAmount) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ReserveAmount))) :+: (C1 ('MetaCons "Max" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ReserveAmount])) :+: C1 ('MetaCons "Min" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ReserveAmount]))))) |
draw :: Amount -> Date -> TxnComment -> Account -> Account Source #
draw cash from account with a comment
deposit :: Amount -> Date -> TxnComment -> Account -> Account Source #
deposit cash to account with a comment
transfer :: (Account, Account) -> Date -> Amount -> (Account, Account) Source #
move cash from account A to account B
data InterestInfo Source #
Constructors
BankAccount IRate DatePattern Date | fix reinvest return rate |
InvestmentAccount Index Spread DatePattern DatePattern Date IRate | float type: index, spread, sweep dates, rate reset , last accrue day, last reset rate |
Instances
FromJSON InterestInfo Source # | |||||
Defined in Accounts | |||||
ToJSON InterestInfo Source # | |||||
Defined in Accounts Methods toJSON :: InterestInfo -> Value # toEncoding :: InterestInfo -> Encoding # toJSONList :: [InterestInfo] -> Value # toEncodingList :: [InterestInfo] -> Encoding # omitField :: InterestInfo -> Bool # | |||||
Generic InterestInfo Source # | |||||
Defined in Accounts Associated Types
| |||||
Show InterestInfo Source # | |||||
Defined in Accounts Methods showsPrec :: Int -> InterestInfo -> ShowS # show :: InterestInfo -> String # showList :: [InterestInfo] -> ShowS # | |||||
Eq InterestInfo Source # | |||||
Defined in Accounts | |||||
Ord InterestInfo Source # | |||||
Defined in Accounts Methods compare :: InterestInfo -> InterestInfo -> Ordering # (<) :: InterestInfo -> InterestInfo -> Bool # (<=) :: InterestInfo -> InterestInfo -> Bool # (>) :: InterestInfo -> InterestInfo -> Bool # (>=) :: InterestInfo -> InterestInfo -> Bool # max :: InterestInfo -> InterestInfo -> InterestInfo # min :: InterestInfo -> InterestInfo -> InterestInfo # | |||||
type Rep InterestInfo Source # | |||||
Defined in Accounts type Rep InterestInfo = D1 ('MetaData "InterestInfo" "Accounts" "Hastructure-0.50.0-9tFAxbqhtE23KiGoJqUlJG" 'False) (C1 ('MetaCons "BankAccount" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DatePattern) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Date))) :+: C1 ('MetaCons "InvestmentAccount" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Index) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Spread) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DatePattern))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DatePattern) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Date) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate))))) |
buildEarnIntAction :: [Account] -> Date -> [(String, Dates)] -> [(String, Dates)] Source #
build interest earn actions