aboutsummaryrefslogtreecommitdiff
path: root/src/client/Update/LoggedIn
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Update/LoggedIn')
-rw-r--r--src/client/Update/LoggedIn/Account.elm20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/Update/LoggedIn/Account.elm b/src/client/Update/LoggedIn/Account.elm
new file mode 100644
index 0000000..ab07c2e
--- /dev/null
+++ b/src/client/Update/LoggedIn/Account.elm
@@ -0,0 +1,20 @@
+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 }