diff options
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 } |