aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model/View/PaymentView.elm
blob: 93ab4573ab80853ae767edacae1ee3fc10763c03 (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
module Model.View.PaymentView
  ( PaymentView
  , initPaymentView
  ) where

import Model.User exposing (Users, UserId)
import Model.Payment exposing (Payments)
import Model.Payers exposing (Payers)
import Model.View.Payment.Add exposing (..)
import Model.View.Payment.Edition exposing (..)

type alias PaymentView =
  { users : Users
  , me : UserId
  , add : AddPayment
  , payments : Payments
  , paymentsCount : Int
  , payers : Payers
  , edition : Maybe Edition
  , currentPage : Int
  }

initPaymentView : Users -> UserId -> Payments -> Int -> Payers -> PaymentView
initPaymentView users me payments paymentsCount payers =
  { users = users
  , me = me
  , add = initAddPayment
  , payments = payments
  , paymentsCount = paymentsCount
  , payers = payers
  , edition = Nothing
  , currentPage = 1
  }