module LoggedIn.Model ( Model , init ) where import Model.View.LoggedIn.Edition exposing (..) import Model.User exposing (Users, UserId) import Model.Payment exposing (Payments, PaymentFrequency(..)) import Model.Payer exposing (Payers) import Model.Init exposing (..) import LoggedIn.Account.Model as AccountModel import LoggedIn.AddPayment.Model as AddPaymentModel import LoggedIn.Monthly.Model as MonthlyModel type alias Model = { users : Users , add : AddPaymentModel.Model , monthly : MonthlyModel.Model , account : AccountModel.Model , payments : Payments , paymentsCount : Int , paymentEdition : Maybe Edition , currentPage : Int } init : Init -> Model init initData = { users = initData.users , add = AddPaymentModel.init Punctual , monthly = MonthlyModel.init initData.monthlyPayments , account = AccountModel.init initData.me initData.incomes , payments = initData.payments , paymentsCount = initData.paymentsCount , paymentEdition = Nothing , currentPage = 1 }