diff options
author | Joris | 2015-09-06 12:39:03 +0200 |
---|---|---|
committer | Joris | 2015-09-06 12:39:03 +0200 |
commit | e10531ba4e60c8709088798763ae3bae6608f9c9 (patch) | |
tree | f1550fab8833f0b31831ebb2e943a51eeaa41ee2 /src/client/Update/LoggedView/Monthly.elm | |
parent | 24633871359ec9fbd63fdfebf79a6351b2792f77 (diff) |
Show montly payments with an expandable mechanism
Diffstat (limited to 'src/client/Update/LoggedView/Monthly.elm')
-rw-r--r-- | src/client/Update/LoggedView/Monthly.elm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/Update/LoggedView/Monthly.elm b/src/client/Update/LoggedView/Monthly.elm new file mode 100644 index 0000000..8d02c5e --- /dev/null +++ b/src/client/Update/LoggedView/Monthly.elm @@ -0,0 +1,19 @@ +module Update.LoggedView.Monthly + ( MonthlyAction(..) + , updateMonthly + ) where + +import Model.Payment exposing (Payment) +import Model.View.Payment.Monthly exposing (..) + +type MonthlyAction = + ToggleDetail + | AddMonthlyPayment Payment + +updateMonthly : MonthlyAction -> Monthly -> Monthly +updateMonthly action monthly = + case action of + ToggleDetail -> + { monthly | visibleDetail <- not monthly.visibleDetail } + AddMonthlyPayment payment -> + { monthly | payments <- payment :: monthly.payments } |