module Update.LoggedIn.Account ( AccountAction(..) , updateAccount ) where import Model.User exposing (UserId) import Model.Payers exposing (..) import Model.View.LoggedIn.Account exposing (..) type AccountAction = ToggleDetail | UpdatePayer UserId Int updateAccount : AccountAction -> Account -> Account updateAccount action account = case action of ToggleDetail -> { account | visibleDetail <- not account.visibleDetail } UpdatePayer userId cost -> { account | payers <- updatePayers account.payers userId cost }