aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model
diff options
context:
space:
mode:
authorJoris2015-09-12 23:57:16 +0200
committerJoris2015-09-12 23:57:16 +0200
commita48e79e2f7c1ab1ffb52b86ef9e900c75c5d023b (patch)
tree05a613aef2d338f10bcdd394e520450656ed8f1c /src/client/Model
parentd87dbd1360c14df83552fd757438c23e5d7b9f9c (diff)
Adding UI income read-only
Diffstat (limited to 'src/client/Model')
-rw-r--r--src/client/Model/View/LoggedIn/Account.elm19
-rw-r--r--src/client/Model/View/LoggedInView.elm9
2 files changed, 24 insertions, 4 deletions
diff --git a/src/client/Model/View/LoggedIn/Account.elm b/src/client/Model/View/LoggedIn/Account.elm
new file mode 100644
index 0000000..410345c
--- /dev/null
+++ b/src/client/Model/View/LoggedIn/Account.elm
@@ -0,0 +1,19 @@
+module Model.View.LoggedIn.Account
+ ( Account
+ , initAccount
+ ) where
+
+import Model.Payers exposing (..)
+
+type alias Account =
+ { payers : Payers
+ , income : Maybe Int
+ , visibleDetail : Bool
+ }
+
+initAccount : Payers -> Maybe Int -> Account
+initAccount payers income =
+ { payers = payers
+ , income = income
+ , visibleDetail = False
+ }
diff --git a/src/client/Model/View/LoggedInView.elm b/src/client/Model/View/LoggedInView.elm
index cf7f552..12a7294 100644
--- a/src/client/Model/View/LoggedInView.elm
+++ b/src/client/Model/View/LoggedInView.elm
@@ -9,28 +9,29 @@ import Model.Payers exposing (Payers)
import Model.View.LoggedIn.Add exposing (..)
import Model.View.LoggedIn.Edition exposing (..)
import Model.View.LoggedIn.Monthly exposing (..)
+import Model.View.LoggedIn.Account exposing (..)
type alias LoggedInView =
{ users : Users
, me : UserId
, add : AddPayment
, monthly : Monthly
+ , account : Account
, payments : Payments
, paymentsCount : Int
- , payers : Payers
, paymentEdition : Maybe Edition
, currentPage : Int
}
-initLoggedInView : Users -> UserId -> Payments -> Payments -> Int -> Payers -> LoggedInView
-initLoggedInView users me monthlyPayments payments paymentsCount payers =
+initLoggedInView : Users -> UserId -> Payments -> Payments -> Int -> Payers -> Maybe Int -> LoggedInView
+initLoggedInView users me monthlyPayments payments paymentsCount payers income =
{ users = users
, me = me
, add = initAddPayment Punctual
, monthly = initMonthly monthlyPayments
+ , account = initAccount payers income
, payments = payments
, paymentsCount = paymentsCount
- , payers = payers
, paymentEdition = Nothing
, currentPage = 1
}