diff options
Diffstat (limited to 'src/client/Model')
-rw-r--r-- | src/client/Model/View/LoggedIn/Account.elm | 19 | ||||
-rw-r--r-- | src/client/Model/View/LoggedInView.elm | 9 |
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 } |