blob: 8d02c5ea1754f0ffb4c85e3ce5b943d0b8ded1e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 }
|