aboutsummaryrefslogtreecommitdiff
path: root/src/client/LoggedData.elm
blob: e048247ff71b7d3e4c84c7a02f7828c064a09f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module LoggedData exposing
  ( LoggedData
  , build
  )

import Time exposing (Time)

import Msg exposing (Msg)

import Model exposing (Model)
import Model.Translations exposing (..)
import Model.Conf exposing (..)
import Model.Payment exposing (Payments)
import Model.User exposing (Users, UserId)
import Model.Income exposing (Incomes)
import Model.Category exposing (Categories)
import Model.PaymentCategory exposing (PaymentCategories)

import LoggedIn.Model as LoggedInModel

type alias LoggedData =
  { currentTime : Time
  , translations : Translations
  , conf : Conf
  , users : Users
  , me : UserId
  , payments : Payments
  , incomes : Incomes
  , categories : Categories
  , paymentCategories : PaymentCategories
  }

build : Time -> Translations -> Conf -> LoggedInModel.Model -> LoggedData
build currentTime translations conf loggedIn =
  { currentTime = currentTime
  , translations = translations
  , conf = conf
  , users = loggedIn.users
  , me = loggedIn.me
  , payments = loggedIn.payments
  , incomes = loggedIn.incomes
  , categories = loggedIn.categories
  , paymentCategories = loggedIn.paymentCategories
  }